|
I'm sorry you've had such bad experiences, but mine have been the opposite.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
Female <- not biased, just stating the fact
One of my (female) colleague accepts the fact that females aren't technically that sound. (I just mentioned her thought, not mine ! )
- Malli...!
|
|
|
|
|
Not saying females aren't technically sound, just saying their track record isn't exactly up to scratch, which is kind of contradicting myself, so ignore my first statement...
|
|
|
|
|
Because it is a proof of the long held belief that (generally) women can not program. There are exceptions of course, but overall male programmers out number female programmers at least 2,3 to 1.
|
|
|
|
|
Not sure about the sql query your colleague wrote. That had to be a joke on a dull Friday afternoon
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
else if ( ((isEXEDLL == true) || (isEXEConfig == true))
&& ((staysTheSameEXEDLL == false) || (EXEDLLPathExistsSoCanProcess == true))
)
{
if ( ((isEXEDLL == true) || (isEXEConfig == true))
&& (staysTheSameEXEDLL == false)
)
{
if (canCopy.DoCopy == true)
{
I'm faint !
- Malli...!
|
|
|
|
|
I have a couple of apps that I maintain (originally written by, yes, a female, human as well, and an entry-level developer) who constantly checked for (boolean_value = true).
|
|
|
|
|
(boolean_value = true) || (boolean_value == true)
|
|
|
|
|
VentsyV wrote: (boolean_value = true) || (boolean_value == true)
LMAO...Reading this, I was suddenly taken back to Irving M. Copi's _Introduction_to_Logic_, which I used as a textbook for an independent study in high school...it's the definition of a tautology...making it "too true"
|
|
|
|
|
You have good chances for a lot of small talk.
Greetings from Germany
|
|
|
|
|
I just found this in the project that I inherited ... it is working code. You don't have to be expert in ColdFusion to see that's something wrong with this
<cfloop index="i" from="1" to="1">
<cfloop list="#structKeyList(xnA)#" index="x">
<cfset y='xnA['&i&'].'&#x#&'.XMLtext'>
<cfset temp = QuerySetCell(clientQuery,"#x#",#evaluate(y)#, #i#)>
</cfloop>
</cfloop>
|
|
|
|
|
That's nothing wrong, it's simply a respectable horror.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
looks like code that at one time did something, but then got changed but never cleaned up
Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer.
-Fred Brooks
|
|
|
|
|
ditto, and maybe it was intentionally left that way because it may change yet again
|
|
|
|
|
StevenWalsh wrote: Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer.
-Fred Brooks
That's actually not matter of faith: while nature obeys God's plans, the software engineer deals with project manager's ones.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I've done that; I've shrunk the range of a for loop for testing and then forgot to put it back.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Yuck.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
First, let me say that the code excerpt below is not an egregious violation (and maybe not a violation at all), but it is a coding horror for my programming style and I am curious as to what the others here think about it.
So, in reviewing a coworker's code I come across the following line:
m_boolVar = (intVar == 0 ? false : true) ;
Yes, parenthesization and spacing exactly as shown above. Were it my code, it would have been written as:
m_boolVar = intVar != 0;
...or if I was feeling in a bit more perverse mood:
m_boolVar = !!intVar;
There were much bigger fish to fry in this code, but there are times when I just can't let things like this go by. These things are like misspelled words that shout out at me from among the surrounding text.
modified on Tuesday, September 16, 2008 3:02 AM
|
|
|
|
|
Uhm I think your code would have a bug....
You better write it this way:
m_boolVar = intVar != 0;
|
|
|
|
|
Yeah, thanks, I typed too fast. Sometimes (as you get older) what you are thinking doesn't quite translate into what you are typing!
|
|
|
|
|
geoffs wrote: as you get older
Don't worry about it, I can have that too, and I'm not that old yet (little over 30). And luckily not everything I think is being translated into what I'm typing
As to your original post, I completely agree with you. I have the unlucky position to have to tackle code that has multiple gems like these.
Is the logical expression that difficult to read for some that they have to literally assign a 'true' or 'false'? Or perhaps the coder fears that the logical expression returns a different kind of bool than true or false?
I myself find it bad code-practice.
|
|
|
|
|
geoffs wrote: Yeah, thanks, I typed too fast. Sometimes (as you get older) what you are thinking doesn't quite translate into what you are typing!
Which can also happen when coding, and the original version would be less prone to this kind of error. Although I wouldn't have done it that way either. I find your last solution to be way more of a horror than the original though.
I also like putting parentheses around something like "Foo = (Bar != 0)" as it makes it visually more obvious what is going on.
He said, "Boy I'm just old and lonely,
But thank you for your concern,
Here's wishing you a Happy New Year."
I wished him one back in return.
|
|
|
|
|
David Kentley wrote: I find your last solution to be way more of a horror than the original though.
I did use the word perverse with regards to the last solution. But sometimes I feel that way.
I must disagree with you with regard to the first version as I feel that it is just as prone, if not more so, to errors from mistyping.
|
|
|
|
|
Your code is shorter, but the other one is easier to read.
Your code is still pretty easy to read but I think readability is more important than conciseness.
When you look at someone's or even your own code after a while (to find a bug or whatever), it's best if you can easily read and immediately grasp the function of the code.
If everything is as concise as possibly, you often have hard to read code, which takes much longer to comprehend.
So, writing easy to read code will save you time later.
|
|
|
|
|
That's what people are always saying and perhaps rightfully so. However, coming from a background of programming stemming from the mid-70's when I had 4KB of memory to program with and compilers that weren't as optimizing as today's, conciseness was a virtue. After so many years it has become a habit but hopefully not to the point where I am so concise that I generate obfuscated code.
For me, verbose code is actually painful to read so maybe it works both ways.
And maybe there is no absolute wrong or right in this case either...
|
|
|
|