|
I prefer the first form specifically where you are simulating named argument support in a C# compiler that doesn't support it directly (VS2008 for example). This form is useful when the argument has a lot of default values, only a few of which you typically override.
I also prefer the first form in general. My local variables are usually named according to their use locally, and not according to their potential use as arguments. For that reason, my locals may not identify themselves well when used in the second form.
Software Zen: delete this;
|
|
|
|
|
Well, it depends.
If it was only one method, then the top has a slightly better flow-read going for it.
But if this was one of literally 10's or 100's of methods. Then the bottom method would reduce the tedium involved in scanning the code, and comparing for missing or finding what I want.
|
|
|
|
|
It's all about the 80-column limit. Remember, from when you typed into dumb terminals that only displayed 80 columns by 24 rows of text (thank god those days are gone). In the modern world, the 80 column limit is still adhered to because it's harder to read code that sprawls across the whole width of the screen. Yeah, I like the keyword = value thing too for documentation purposes, but that's not the (only) reason I lay my code out vertically.
|
|
|
|
|
I prefer constructor parameters for pieces of data that must be set for the object to work properly -- as a parameter because the compiler will catch it if you forget something. Not so with constructor initializers -- if you forget some critical parameter, nobody will know until they exercise the code that depends on it at runtime.
I also have a philosophical dislike of the encapsulation breakage that constructor initializers allow. It limits the controls that a class designer has over what they want to allow others to do with the internals of the class, and pollutes unrelated code with dirty knowledge of internal implementation details of a class. This makes it harder to refactor the internal implementation of a class.
|
|
|
|
|
I mostly maintain my own code, and I prefer the former as 1+ years later, I definitely won't remember the parameter order. Explicit is better for maintainability, even if it requires more typing. And way easier to explain the odd time when I have to bring another developer up to speed.
Also, when I show the code to clients, it looks like I have done more work.
A short little line of code does not look impressive.
|
|
|
|
|
Have you had to walk 500 miles?
Were you advised to walk 500 more?
You could be entitled to compensation.
Call the Pro Claimers NOW!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
what are you havering on about now?
Installing Signature...
Do not switch off your computer.
|
|
|
|
|
Oh. My. God.
Unintellegible but for a few blessed human beings. My wife is a Tennant superfan so I got it but... woah.
* CALL APOGEE, SAY AARDWOLF
* GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- ++>+++ y+++* Weapons extension: ma- k++ F+2 X
* Never pay more than 20 bucks for a computer game.
* I'm a puny punmaker.
|
|
|
|
|
|
Two hours of pushing broom only earned me 4 bits for a room. This is clearly below minimum wage, do I have a claim?
|
|
|
|
|
No, but at least you're King of the road!
Anything that is unrelated to elephants is irrelephant Anonymous
- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944
- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
For the time context, was it below minimum wage?
But.. love the song, miss the artist.
|
|
|
|
|
This[^] is all I can discern, which, in turn, is of little concern.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
hmm, something[^] a bit less aged
Installing Signature...
Do not switch off your computer.
|
|
|
|
|
Well - if they get the voices and the harmony and the arrangements and all those details they might be comparable to the vintage model. For now, however, I'll pass.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
"I'm on My Way" to cut your Internet off so we don't have to read your jokes anymore.
|
|
|
|
|
Are you taking the Roundabout?
"Go forth into the source" - Neal Morse
|
|
|
|
|
That's OK - I'll do it my way!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
You mean 0800-PRO CLAIMERS
|
|
|
|
|
Nah - that'd be spam...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Wow.
|
|
|
|
|
May your code compile, may your unit tests all pass and may your builds be successful
"There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." - C.A.R. Hoare
Home | LinkedIn | Google+ | Twitter
|
|
|
|
|
May you have disabled Windows 10 automatic updates ?
selfish adj. Defines someone who does not think of me.
|
|
|
|
|
That actually bit me on the bum just this week
"There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." - C.A.R. Hoare
Home | LinkedIn | Google+ | Twitter
|
|
|
|
|
I did deactivate them in August this year, after my Lenovo laptop lost his audio device driver subsequently to a MS automatic update. Responsability could be on MS, or on Lenovo, or on a combination of both of them ; I just don't have time to spend to investigate on this kind of problem at the moment (especially because the "Factory Restore" method on this laptop does not seem to work properly). So I decided to deactivate updates, being extra careful on which sites I visit and which executables I download. Anyway, I never use any downloaded executable before testing it in a sandbox virtual machine first.
selfish adj. Defines someone who does not think of me.
|
|
|
|