tags:

views:

526

answers:

10

Every so often while writing code you do a double take at the function you just made and realise you've just created a very stupid function name! It might be descriptive and accurate, but totally inappropriate, or it might be completely off topic due to a mind warp!

What are the best, funniest, strangest or stupidest function or code names that you've seen, or have written yourself?

I'll post my contibutions in a seperate answer :).

Edit: Similar to: what is the worst class/variable/function name you have ever encountered

+2  A: 

While writing some C# using a stack I found I actually needed to acess both ends. I hurridly wrote myself a destack (instead of the sendible option of using a dequeue or whatever) - which led to my favorite method names I've yet to write:

Push();
Pop();

and

Peek();

where complemented with:

PushBottom();
PopBottom(); //my favorite!

and

PeekBottom(); //:D.

What are yours?

xan
PopBottom==shift PushBottom==unshift
Brad Gilbert
+1  A: 

The worst was a SQL Column actually named

NotActive bit

We immediately made a derived column, "Active".

Patrick Szalapski
What sick person would do that?
Saul Dolgin
The kind who thinks it bad to have "true" for a default, I suppose...
Patrick Szalapski
+3  A: 

When I was at a financial data delivery company in the early to mid 90s we were migrating from 16 bit application to 32 bit (for Windows). The previous version was 2.16 (or "two-sixteen")

We had to do some odd gyrations in the code to keep the app from screwing up after an install over the old version. (the distribution mechanism was amazing - this was before the internet was used widely and the company had its own network infrastructure to its clients and during off hours new software versions were pushed down to PCs - it was a really great mechanism back then...)

the funciton name was

Get216OutOfShit()

Another one was KillTheWabbit()

the first could be argued to be a valid name, but the other one was horrible. I was not the author - I had just joined the company.

Tim
+3  A: 

I like to use SoylentGreen as an enum value to indicate the most serious level of something...

public enum Severity
{
  None,
  Low,
  Medium,
  High,
  SoylentGreen
}
Will
So people are more severe than High? Interesting.
Thomas Owens
Not exactly... EATING PEOPLE is more severe than high.
Will
A: 

When I was working on a testing framework there was an SQL table named TestCycle with a column named is_cyclic which was a boolean. Just about everybody was asking the obvious questions about it.

A: 

a website i visited a while back failed to load with a javascript error; when i looked at the source, the body onload event was calling a function named "JoshIsCool", which of course was failing (I forget why).

Josh was apparently too cool to test his function in IE6 [years ago, sorry for the confusion]

Steven A. Lowe
Why the hell are you using IE6?
Malfist
@Malfist: This was years ago - hence the phrase "a while back"
Steven A. Lowe
+3  A: 

Not a method call but we have a old ASP 2.0 application here where I work, and there is a comment above a method called GenerateReport that says

'Do not uncomment this line or the application will break
RandomNoob
Lol, I like this one :)
Along the lines of: "DO NOT PUSH THIS BUTTON!" - surely you tried uncommenting it? :D
xan
A: 

Definitely

umount
I found it confusing at the beginning, and now i've to smile about it :p They unmounted the n :)

Johannes Schaub - litb
+1  A: 

In a system I once built, Companies could have associated suppliers.

Of course, in the Company object, there was a collection of associated suppliers:

public List<Supplier> AssSuppliers
{
}

I thought I was funny the day I wrote that.

FlySwat
That made me chuckle :).
xan
+1  A: 

I once saw a C++ function called "setPuedeMolestar". In spanish, it means something like "setCanAnnoy". Also, I saw a debug trace that simply said "NADA" (nothing). Both were from the same developer. Luckily for all of us, he was fired.

Marc
I read that as "setPrudeMolestor"
Will