Click here to Skip to main content
15,892,927 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: do you use extension methods intensively in your projects? Pin
Chris Maunder17-Oct-16 4:41
cofounderChris Maunder17-Oct-16 4:41 
GeneralRe: do you use extension methods intensively in your projects? Pin
Fabio Franco17-Oct-16 0:19
professionalFabio Franco17-Oct-16 0:19 
GeneralRe: do you use extension methods intensively in your projects? Pin
PSU Steve17-Oct-16 2:49
professionalPSU Steve17-Oct-16 2:49 
GeneralRe: do you use extension methods intensively in your projects? Pin
Harley L. Pebley17-Oct-16 5:11
Harley L. Pebley17-Oct-16 5:11 
GeneralRe: do you use extension methods intensively in your projects? Pin
Matthew Dennis17-Oct-16 5:42
sysadminMatthew Dennis17-Oct-16 5:42 
GeneralRe: do you use extension methods intensively in your projects? Pin
Jim Balter17-Oct-16 6:49
Jim Balter17-Oct-16 6:49 
GeneralRe: do you use extension methods intensively in your projects? Pin
Robert g Blair17-Oct-16 14:30
Robert g Blair17-Oct-16 14:30 
GeneralRe: do you use extension methods intensively in your projects? Pin
mbb0119-Oct-16 23:14
mbb0119-Oct-16 23:14 
I use extension methods somewhat. I'm slowly building a suite of useful methods. There is also the site extensionmethod.net too.

I keep the extension methods in a core library, but the methods are declared in the namespace of the class I'm targeting. That way, when I reference the core library all the extension methods are available without superfluous using statements.

Be careful, there is an ongoing debate on the internets about whether they're a good thing or bad thing. I would say, use sparingly, and note that an extension method is probably sign-posting a limitation in your design.

As well as other suggestions, I've used them to clean up a messy code base I've inherited. In this code base there were a number of inappropriate methods attached to a static globals class. Side-stepping the whole issue of a statics globals class, the methods attached to it were moved onto extension methods. Not a perfect solution, but migrating to extension methods helped me nudge the legacy code in the right direction.
GeneralIt's not even Halloween yet... Pin
R. Giskard Reventlov14-Oct-16 12:54
R. Giskard Reventlov14-Oct-16 12:54 
GeneralRe: It's not even Halloween yet... Pin
Marc Clifton15-Oct-16 3:16
mvaMarc Clifton15-Oct-16 3:16 
GeneralRe: It's not even Halloween yet... Pin
Kschuler17-Oct-16 3:38
Kschuler17-Oct-16 3:38 
General*IGMO Pin
GenJerDan14-Oct-16 6:06
GenJerDan14-Oct-16 6:06 
GeneralRe: *IGMO Pin
devenv.exe14-Oct-16 6:35
professionaldevenv.exe14-Oct-16 6:35 
GeneralRe: *IGMO Pin
GenJerDan14-Oct-16 6:39
GenJerDan14-Oct-16 6:39 
GeneralRe: *IGMO Pin
Ravi Bhavnani14-Oct-16 8:23
professionalRavi Bhavnani14-Oct-16 8:23 
GeneralRe: *IGMO Pin
CDP180214-Oct-16 6:57
CDP180214-Oct-16 6:57 
GeneralRe: *IGMO Pin
kmoorevs14-Oct-16 8:01
kmoorevs14-Oct-16 8:01 
GeneralRe: *IGMO Pin
GenJerDan14-Oct-16 8:15
GenJerDan14-Oct-16 8:15 
GeneralRe: *IGMO Pin
kmoorevs14-Oct-16 8:51
kmoorevs14-Oct-16 8:51 
GeneralRe: *IGMO Pin
GenJerDan14-Oct-16 8:56
GenJerDan14-Oct-16 8:56 
GeneralRe: *IGMO Pin
Eddy Vluggen14-Oct-16 10:22
professionalEddy Vluggen14-Oct-16 10:22 
GeneralThought of the day Pin
OriginalGriff14-Oct-16 5:04
mveOriginalGriff14-Oct-16 5:04 
GeneralRe: Thought of the day Pin
jeron114-Oct-16 5:37
jeron114-Oct-16 5:37 
GeneralRe: Thought of the day Pin
OriginalGriff14-Oct-16 5:39
mveOriginalGriff14-Oct-16 5:39 
GeneralRe: Thought of the day Pin
jeron114-Oct-16 6:10
jeron114-Oct-16 6:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.