C# 4.0. w00t.
-
Chris Maunder wrote:
My life is complete.
Not until you've tried women; then you're done.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
-
But, but, you had those in C++ and VB(A). How many times can you complete your life (if you're not a cat)? :)
- S 50 cups of coffee and you know it's on! A post a day, keeps the white coats away!
-
Chris Maunder wrote:
Named and Optional Parameters.
VB has had those since... oh... the dinosaurs. So C# 4.0 is really VB in disguise? ;P
-
VS for C/C++ programmers (not necessarily MFC) has sucked since the end of VS 6. You want help with that function? No, you have too many template classes. It is nice that they continue to make their tabs rounder, and their gradients smoother. I've always said, "you know what VS could use? More gradients!"
-
Chris Maunder wrote:
Nice idea, but I can just picture the code that is going to come from developers who don't understand when and where to use them. And not use them.
Please try explaining that logic to the manufacturers and distributors of firearms. I'd love to live in a world where things like this[^] are unheard of.
:josh: Try Crack![^] Sleep is overrated.
Josh Smith wrote:
I'd love to live in a world where things like this[^] are unheard of.
Mmm, you'll be waiting an awfully long time. Every gun in the world could be destroyed and you'd still get random stabbings, baseball battings, getting run over by cars... the very nature of freedom is one of risk. That's the nature of reality as we currently inhabit it. Now, if we could invent an alternate reality where freedom and absolutely perfectly responsible behavior went hand in hand... but I digress.
-
you mean like in javascript? :rolleyes:
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
-
Optional parameters would be damn handy.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 -
Chris Maunder wrote:
Named and Optional Parameters. My life is complete.
A w00t for that! Jesus Chris, what you doing for Code Projects 9th birthday? Feel like a leisurely flight to Sydney and a few hours of drinking over at old Mount Druitt? You can even bring your snowboard along, we could do with the shade.
Michael Martin Australia "I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible." - Mr.Prakash One Fine Saturday. 24/04/2004
-
Optional parameters are, imho, a bad thing, most of the time. It's a more structured variation of the "Accumulate and fire" antipattern. All too often, optional parameters are actually fields in a class that you are missing. And, if you're missing fields, you're missing methods. This, on the long run, means longer methods, repeated code, and harder to test. For quick and dirty code, it's a good tool, but not on larger projects.
I see dead pixels
-
Optional parameters are, imho, a bad thing, most of the time. It's a more structured variation of the "Accumulate and fire" antipattern. All too often, optional parameters are actually fields in a class that you are missing. And, if you're missing fields, you're missing methods. This, on the long run, means longer methods, repeated code, and harder to test. For quick and dirty code, it's a good tool, but not on larger projects.
I see dead pixels
You know how many string.Format methods there are? 5 You know how many have actual code (instead of calling another overload)? 1 And that is just one example, there are lots of overloads in the .NET frameworks that do nothing else. I don't see how you could handle this with extra fields...
-
Josh Smith wrote:
I'd love to live in a world where things like this[^] are unheard of.
Mmm, you'll be waiting an awfully long time. Every gun in the world could be destroyed and you'd still get random stabbings, baseball battings, getting run over by cars... the very nature of freedom is one of risk. That's the nature of reality as we currently inhabit it. Now, if we could invent an alternate reality where freedom and absolutely perfectly responsible behavior went hand in hand... but I digress.
Patrick Etc. wrote:
Every gun in the world could be destroyed and you'd still get random stabbings, baseball battings, getting run over by cars... the very nature of freedom is one of risk.
True. So, with that logic, why not sell nuclear bombs at K-Mart? :)
:josh: Try Crack![^] Sleep is overrated.
-
Chris Maunder wrote:
Nice idea, but I can just picture the code that is going to come from developers who don't understand when and where to use them. And not use them.
Please try explaining that logic to the manufacturers and distributors of firearms. I'd love to live in a world where things like this[^] are unheard of.
:josh: Try Crack![^] Sleep is overrated.
-
-
Optional parameters would be damn handy.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 -
Chris Maunder wrote:
Nice idea, but I can just picture the code that is going to come from developers who don't understand when and where to use them. And not use them.
Please try explaining that logic to the manufacturers and distributors of firearms. I'd love to live in a world where things like this[^] are unheard of.
:josh: Try Crack![^] Sleep is overrated.
I'd also love to live in a world where are current laws are enforced. Ex-convicts aren't allowed to own firearms, let alone a fully-automatic? If current laws were enforced, this guy would have been in jail for violating two current laws. I guess laws don't stop criminals from selling fully-automatic weapons on the black market to ex-cons.
-
I actually don't program in VB because I think it produces code that's harder to read. This makes it more difficult to understand and thus more difficult to maintain. This is especially true for projects of any complexity or size. I thought with C# that MS had finally learned an important lesson from Java: They need a clean language with a simple, clear syntax and straightforward semantics. It seems like their resolve has begun to waver. They've finally given in to the temptation to turn their most beautiful language to date into something more like it's "easy" sister. I am saddened by this turn of events.
-
Patrick Etc. wrote:
Every gun in the world could be destroyed and you'd still get random stabbings, baseball battings, getting run over by cars... the very nature of freedom is one of risk.
True. So, with that logic, why not sell nuclear bombs at K-Mart? :)
:josh: Try Crack![^] Sleep is overrated.
Josh Smith wrote:
True. So, with that logic, why not sell nuclear bombs at K-Mart?
Hehe you got univoted :) And as for the logic, that was quite a leap there... just because risk is inherent doesn't mean we don't work to mitigate it ;) but that requires the wisdom to know when a risk-mitigation strategy throws the baby out with the bathwater. And that's about all I'm going to say else we dive into SB material.. :D
-
Actually, optional parameters are a feature of C++. I've already stated this before, but the only bad thing optional parameters does is creates an additional thought process when coding because you are faced with choosing between function overloading or the use of optional parameters. There are times would an optional parameter would have been preferable to overloading.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 -
Actually, optional parameters are a feature of C++. I've already stated this before, but the only bad thing optional parameters does is creates an additional thought process when coding because you are faced with choosing between function overloading or the use of optional parameters. There are times would an optional parameter would have been preferable to overloading.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001John Simmons / outlaw programmer wrote:
Actually, optional parameters are a feature of C++.
True, but it's been a while since I've seen people use default values.
John Simmons / outlaw programmer wrote:
There are times would an optional parameter would have been preferable to overloading.
What's your example?
-
I was going to post tomorrow's survey as "Does the thought of Dynamic variables make you break out in a cold sweat?" Nice idea, but I can just picture the code that is going to come from developers who don't understand when and where to use them. And not use them.
cheers, Chris Maunder
CodeProject.com : C++ MVP
Chris Maunder wrote:
I was going to post tomorrow's survey as "Does the thought of Dynamic variables make you break out in a cold sweat?" Nice idea, but I can just picture the code that is going to come from developers who don't understand when and where to use them. And not use them.
Yes, but....what makes that any different from gotos, K & R C function parameters, MAPCARrion in LISP (the rotted remains of programmers trying to understand poorly implemented algorithms using MAPCAR()), etc.? It's just another new potential nightmare...maybe I'm jaded, I dunno :laugh: