|
It gets even better. I've even seen something akin to this in Basic...
Let x = 5
Jeremy Falcon
|
|
|
|
|
Or:
double x = 0.1;
Which is actually a lie.
|
|
|
|
|
I've seen something like that, except the writer of the comment started about memory and how it works internally... Except the comment clearly showed the writer had no clue what actually happened
Can't remember where I've seen it or what the comment said though
It's an OO world.
public class SanderRossel : Lazy<Person>
{
public void DoWork()
{
throw new NotSupportedException();
}
}
|
|
|
|
|
Ughhh. It should really be:
<br />
check_connection();<br />
|
|
|
|
|
Just because he's a pro at naming a function doesn't mean the comment is bad.
|
|
|
|
|
I don't always comment my code, but when I do...
//TODO: insert comment here.
|
|
|
|
|
// Whereas we wish for this application to interact with a database
// and whereas such interaction will require a connection to the server and instance of said database
// and whereas a connection of this type relies on many fluctuating unknowns within the server and network infrastructure
// and further, given the business-critical nature of this application and its associated interaction with the database
// it has therefore been determined that checking whether or not such a connection can be successfully negotiated as early as possible
// in the event that such a connection cannot be negotiated, then remediatory actions may be activated in a more timely manner than otherwise feasible
checkConnection();
|
|
|
|
|
Found stuff like that too.
SaveCustomer()
Even worse:
SaveProduct()
The code was copy/pasted and then changed, but of course the comments were overlooked.
But that's not all:
Dim helper As String
helper = "Something"
If someCondition Then
MessageBox.Show(helper)
End If
Yes, in that last part the 'helper variable' is actually a constant string that may or may not be used further in the function... Good thing it was commented
And you wonder why VB has a bad name? This has nothing to do with VB, but with coders that can't code...
It's an OO world.
public class SanderRossel : Lazy<Person>
{
public void DoWork()
{
throw new NotSupportedException();
}
}
|
|
|
|
|
Sander Rossel wrote: coders that can't code...
I disagree... the whole purpose of code is to not be readable.
|
|
|
|
|
Most comments (or error messages) are written by the same master of the obvious.
The language is JavaScript. that of Mordor, which I will not utter here
I hold an A-7 computer expert classification, Commodore. I'm well acquainted with Dr. Daystrom's theories and discoveries. The basic design of all our ship's computers are JavaScript.
|
|
|
|
|
My favorite was akin to this:
// Actually means hasn't been modified except in the function in file xxx.c
bool isModified = false;
The comment was actually accurate and isModified really did switch meaning multiple times throughout the code.
|
|
|
|
|
I prefer the obvious to comments that are lies. Given time and a few updates, most of them head that way.
//NEVER DO X.
Code evolves to do X when the following condition are true.... Comment never updated.
|
|
|
|
|
Amen brother! I recently had the extreme headache pleasure of looking at assembler code that had commenting issues. Nothing like taking a 5 minute task and making it a half day project.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
|
|
|
|
|
This code was sponsored by the Ministry of Obvious and Redundancy and Redundancy.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Entropy isn't what it used to.
|
|
|
|
|
I've changed the name of the method from checkConnection() to openConnectionIfPossibleAndNecessary() because that is what it really does (checks for not null not already open, and then provisionally (no pun intended) creates a new connection).
|
|
|
|
|
The thing is: If you use something like JavaDoc or DoxyGen, comments like that can actually be useful.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Just as astronomers/physicists have created the ideas of "Dark matter" and "Dark energy" to explain the currently unexplained behaviour of the observed universe, so I have coined "Dark logic" to explain the unexplained behaviour of my software.
|
|
|
|
|
What happens when ordinary logic meets dark logic? Do you get a logic/anti-logic explosion? If so, how can we weaponize it?
|
|
|
|
|
You have to collapse the probability field in order to resolve that - typically this is done by deploying the application in production
|
|
|
|
|
Ian Shlasko wrote: ordinary logic meets dark logic
Apparently, when my logic meets other people's one, they vanish. So yes, I believe there indeed is an explosion.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Entropy isn't what it used to.
|
|
|
|
|
Rage wrote: when my logic meets other people's one, they vanish
No, they run away.
There is a difference!
You looking for sympathy?
You'll find it in the dictionary, between sympathomimetic and sympatric
(Page 1788, if it helps)
|
|
|
|
|
Ah, I should have guessed...
Griff ? GRIFF ???
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Entropy isn't what it used to.
|
|
|
|
|
Ian Shlasko wrote: What happens when ordinary logic meets dark logic?
You get Quick Answers[^]
You looking for sympathy?
You'll find it in the dictionary, between sympathomimetic and sympatric
(Page 1788, if it helps)
|
|
|
|
|
This has already been put into equations. Hence the SAK dark constant.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Entropy isn't what it used to.
|
|
|
|
|
Ian Shlasko wrote: What happens when ordinary logic meets dark logic? Do you get a logic/anti-logic explosion?
Kind of... it is more of an intellectual explosion (rather than a physical one) such that everyone becomes dumber if they are around when it happens.
Ian Shlasko wrote: If so, how can we weaponize it?
I cannot talk about it here... but if you go to the soapbox, you'll see several politically based jokes that will explain it.
|
|
|
|