What was the most interesting, funny or silly Code you have ever read?
-
At the Company i am working in the Intellicence gave me These two methods. Microcernel.Create(). 1. PrintLabel() 2. PrintLable() Both methods contained the same oneliner. this._Label();
-
At the Company i am working in the Intellicence gave me These two methods. Microcernel.Create(). 1. PrintLabel() 2. PrintLable() Both methods contained the same oneliner. this._Label();
-
At the Company i am working in the Intellicence gave me These two methods. Microcernel.Create(). 1. PrintLabel() 2. PrintLable() Both methods contained the same oneliner. this._Label();
Mine was a comment left by a former employee "This is where the magic happens, Im a genius and it has nothing to do with Ducks!"
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
-
I'm not sure, but I've always thought it would be funny to leave this in some code and see people's faces:
if(10 != 10){
abort();
}=====
\ | /
\|/
|
|-----|
| |
|_ |
_) | /
_) __/_
_) ____
| /|
| / |
| |
|-----|
|===
You need to combine that with an adapted vague comment:
// Perform t53-i check on the v3-23 kernel.
// Abort if failure.~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus Do not feed the troll ! - Common proverb
-
At the Company i am working in the Intellicence gave me These two methods. Microcernel.Create(). 1. PrintLabel() 2. PrintLable() Both methods contained the same oneliner. this._Label();
Where 1=1 I mean that is obvious..
-
Where 1=1 I mean that is obvious..
That's a good point to start complex
WHERE
clauses. Just add all other constraints with anAND X=Y
. You do not need to worry if the statement is the first statement (noAND
required) or not (AND
required). -
At the Company i am working in the Intellicence gave me These two methods. Microcernel.Create(). 1. PrintLabel() 2. PrintLable() Both methods contained the same oneliner. this._Label();
Just make sure they do not come up with PrintLibel() and this._Libel.
-
Where 1=1 I mean that is obvious..
As a variation on that, you could do something like this:
if ('l' == '1')
{
Abort();
}Just to play with people who would use fonts that don't distinguish the two well...
-
At the Company i am working in the Intellicence gave me These two methods. Microcernel.Create(). 1. PrintLabel() 2. PrintLable() Both methods contained the same oneliner. this._Label();
My favorite that I have seen is this...
if variable < 24 And variable > 26 then
'...
end if -
My favorite that I have seen is this...
if variable < 24 And variable > 26 then
'...
end ifAh,
variable
is surely of type MagnitudeNumber, yes? With a value of -50? It is both less than 24 (because it's negative) and its magnitude is greater than 26. The comparison operator obviously checks both the signed and unsigned number, and returns true if either satisfy the condition. -
Ah,
variable
is surely of type MagnitudeNumber, yes? With a value of -50? It is both less than 24 (because it's negative) and its magnitude is greater than 26. The comparison operator obviously checks both the signed and unsigned number, and returns true if either satisfy the condition.Uhhhh... sure! :) Just kidding. The programmer at the time just probably forgot that they checked the same variable twice. Maybe it was supposed to be another variable. I have no clue what the intention was, but its still active in the program. I don't have the heart to comment it out because of how funny the goof is. :laugh:
-
At the Company i am working in the Intellicence gave me These two methods. Microcernel.Create(). 1. PrintLabel() 2. PrintLable() Both methods contained the same oneliner. this._Label();
if (this == null)
{
//WTF just happened?!?!!
Environment.Exit(-1);
}I cannot remember the exact code block, but it was something along those lines. And yes, somehow, that condition happened. And 'this' was the actual keyword, not some redefinition of it. I still don't know how that one happened.
I think computer viruses should count as life. I think it says something about human nature that the only form of life we have created so far is purely destructive. We've created life in our own image. Stephen Hawking
-
Where 1=1 I mean that is obvious..
yes it could happen
-
if (this == null)
{
//WTF just happened?!?!!
Environment.Exit(-1);
}I cannot remember the exact code block, but it was something along those lines. And yes, somehow, that condition happened. And 'this' was the actual keyword, not some redefinition of it. I still don't know how that one happened.
I think computer viruses should count as life. I think it says something about human nature that the only form of life we have created so far is purely destructive. We've created life in our own image. Stephen Hawking
your object was finalized before the time, probably it had a unmanaged reference, when it had no more managed references, the GC collected it... Forgeting to pin a object is really a PITA, especially when it's the first time you are doing P/Invoke :sigh: (i was speaking of me, not sure if this is your case)
I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p)
-
At the Company i am working in the Intellicence gave me These two methods. Microcernel.Create(). 1. PrintLabel() 2. PrintLable() Both methods contained the same oneliner. this._Label();
A professor of Computer Science -- a world-renowned expert on PL/I -- once wrote the following: if ((i != 1) || (i != 2)) ... else ... (Yes, the above is in C. I can't remember the PL/I syntax.) He spent most of a day trying to figure out why the "else" branch was never executed. A graduate programming assistant had to point it out to him. (This message is programming you in ways you cannot detect. Be afraid.)
-
At the Company i am working in the Intellicence gave me These two methods. Microcernel.Create(). 1. PrintLabel() 2. PrintLable() Both methods contained the same oneliner. this._Label();
-
At the Company i am working in the Intellicence gave me These two methods. Microcernel.Create(). 1. PrintLabel() 2. PrintLable() Both methods contained the same oneliner. this._Label();
When I first saw this comment, I thought it was ridiculous, but now I see a lot of beauty in the f actuality and irony of it. Here it is: // Note that there are 1024 milliseconds in a second
-
That's a good point to start complex
WHERE
clauses. Just add all other constraints with anAND X=Y
. You do not need to worry if the statement is the first statement (noAND
required) or not (AND
required).That's specially useful when you need to constantly comment in and out some of the conditions to find the right records. Without that you'd have to worry to every time replace the AND for a WHERE and vice-versa.
To alcohol! The cause of, and solution to, all of life's problems - Homer Simpson ---- Our heads are round so our thoughts can change direction - Francis Picabia
-
At the Company i am working in the Intellicence gave me These two methods. Microcernel.Create(). 1. PrintLabel() 2. PrintLable() Both methods contained the same oneliner. this._Label();
You mean aside from this[^]? At one place I worked, we were under deadline and a coworker was going to take some time off. He said his part of the project was done and tested. He gave me a copy to integrate into my code and went on vacation. I installed it and it promptly fell on its face. Looking through the code, it was a complete mess. I ended up taking a hatchet to it, but one routine caught my eye. It was supposed to center some text on a line. Instead of taking the length of the line, subtracting the length of the string, then dividing by two to get the number of spaces to print before the string, he instead created a string of spaces for the length of the line, overlaid the string at the beginning, and then iteratively added spaces at the beginning and removed spaces at the end until they were equal or the leading spaces was longer than the trailing spaces. It was the only routine that worked and I left it in place to illustrate the type of code I had to deal with. I still tried to cover for him, but since rewriting his code impacted the development of my code, when the manager came by breathing fire because I was falling behind, I had to show his work to her. When he came by after his vacation I showed him my changes, he said, "Yes, that's my code." I snarled internally that this bozo couldn't even recognize his code and how I had changed it (chopped 1/3 or more of it out) and then I advised him to take a tube of KY Jelly with him to his meeting with our supervisor because I knew she was going to ream him out.
Psychosis at 10 Film at 11 Those who do not remember the past, are doomed to repeat it. Those who do not remember the past, cannot build upon it.
-
At the Company i am working in the Intellicence gave me These two methods. Microcernel.Create(). 1. PrintLabel() 2. PrintLable() Both methods contained the same oneliner. this._Label();
It wasn't funny at the time, but any VB.Net code that looked like this is hilarious in retrospect:
try
' lots of statements
catch
end tryOr even worse:
On Error Resume Next
' lots of statements
The developer's excuse? "My code doesn't crash!" Yeah. It also didn't work.