|
"If you have to explain a joke, it isn't funny".
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Exactly. If the compiler catches it all, then why is it even a problem to be discussed?
If it doesn't compile, it shouldn't be checked in. Which means I'll never get to see your broken code.
(well, not any code that breaks any syntax rule...)
|
|
|
|
|
Maybe take it to "Weird and Wonderful" ?
It does point out why computer languages should not be based on natural language.
|
|
|
|
|
Better yet...
Start a "Weird and Not So Wonderful"
Remember, no matter where you go... there you are.
|
|
|
|
|
the compiler is the best friend of the programmer
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Nah ... the compiler is a mate (a good mate, but not besties) - the debugger is his best friend!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Pfft, no. The debugger is more like a programmer's mother-in-law.
|
|
|
|
|
Member 3983331 wrote: If (mike =jerk) In many popular programming languages that if statement will always resolve as true and you will be mutating mike to be a jerk.
So in effect, generalising for many popular programming languages, mike is always a jerk based on the code above.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
GuyThiebaut wrote: ...mike is always a jerk based on the code above.
Still better than mike = Karen;
(No offense meant to those Karen's who haven't appeared on the numerous YouTube vids now prelevant.)
|
|
|
|
|
I am so tempted to make a comment on that, but given the current climate, anything I said would get me into trouble...
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
"There be sharks in them waters!"
|
|
|
|
|
Is this a commentary against IDEs not picking up the mistakes before compilation? Or about developers who simply don't have the skills to code being offered jobs, without adequate on the job training, making life hard for others in the team? Or are you simply bashing the 80% of the Earth's population that don't speak English?
cheers
Chris Maunder
|
|
|
|
|
It just seems trollish to me.
|
|
|
|
|
I think he's bashing the people who do speak English, but never paid attention in school.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
It might be a rant typed into an interpreter after a bad day at the office.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
I'm gonna guess a spoonful of #3 with a drizzle of #2 to really bring out the flavor.
|
|
|
|
|
I understood what you are saying.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
A situation where I was dead certain it cannot happen but ...
Rings a bell?
|
|
|
|
|
I always place assert(false) or its equivalent in places where I am sure that it "can't happen". I've caught many nasty bugs this way.
A usage example would be the 'default' clause in a switch statement (when there is no reasonable default).
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
I throw an exception:
switch (unit)
{
default: throw new ArgumentException($"Unknown Unit type: {unit.ToString()}");
case Unit.Mm: mult = 1.0f; break;
case Unit.Cm: mult = 10.0f; break;
case Unit.Imperial: mult = 25.4f; break;
}
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
In C++, C#, or Java, I agree that's what you should do. In C, the best you can do is something like I outlined.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Interesting, I always thought you needed to have the default clause last.
Well that adds readability.
I think.
Wrong is evil and must be defeated. - Jeff Ello
Never stop dreaming - Freddie Kruger
|
|
|
|
|
I like all my validations at the top of a method, so it's just an extension of that: since cases can get quite long when there a few of them it's just more obvious to me that there is a "default fail".
If it's off the bottom of the screen it's harder to see and associate with the switch.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I made the experience that logging "this shouldnt not happen" is more cool, because in such situation I am to angry and nervous to mess with an exception stack.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
I see two problems with this approach:
- You may not notice the entry in the log (is happens even to the best of us, sometimes )
- Executing the "can't happen" code may cause the output to be corrupted. In many cases, it is better to get truncated output than wrong output.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|