|
Maybe he didn't know about code snippets....
|
|
|
|
|
I find it brilliant. 100% bug-free!
|
|
|
|
|
I feel your pain. I've just finished going through a similar process. After a while you stop getting annoyed and start laughing. The one that made me laugh most was:
public class OrderName
{
public String getName {
return "Order";
}
}
That was the class in totality. One method that returned a hard coded value.
[EDIT] I just found a better one:
for (int i = 1; i < 2; i++) {
}
"You get that on the big jobs."
modified on Sunday, August 14, 2011 10:23 PM
|
|
|
|
|
Reminds me of things like this...
for (int i = 0; i < 5; i++) {
switch (i) {
case 1: {
}
case 2: {
}
case 3: {
}
case 4: {
}
case 5: {
}
default: {
}
}
}
|
|
|
|
|
This code feels like some Zen koan or something..
If a tree falls in the forest but no one is around, does it make a noise?
|
|
|
|
|
|
Reminds me of an application I support that had the following gem in it.
Not only was this method called only once in the entire solution, but apparently someone "forgot" to code anything in it. I'm sure this isn't the first time someone has seen this one, too.
private bool IsValid()
{
return true;
}
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
I've actually done something like this (but never left it in the production code) on a rapidly evolving piece of a class. The purpose behind it is that you originally start out with a method with let's say, 100 lines of code, then the person that was driving the requirements no longer wants the checking, so you go back, and in order to test your entire application quickly without refactoring, you throw the "return true" in there.
Not saying it isn't stupid to allow something like that to end up in production, just saying I've actually done it before for quick testing.
|
|
|
|
|
|
Collin Jasnoch wrote: if(_globalBannnaOrderView == null)
{
_globalBannnaOrderView = new BannaOrderView();
...
}
else
{
_globalBannanaOrderView.Focus();
}
Are _globalBannanaOrderView and _globalBannnaOrderView different variables, or just a typo? Because doing that on purpose would be an even worse Coding Horror.
Also, if you mean the fruit, it's spelled Banana. Not that it really matters, but it might be easier to be consistent... (I see Banna, Bannna, and Bannana in just the quoted section)
|
|
|
|
|
Collin Jasnoch wrote: not bug fixing.. These bugs then come back as zombies
+5 for this line
Greetings - Jacek
|
|
|
|
|
Only the comment after the method declaration is not mine. Some things have been changed to protect the innocent:
public DataTable GetFooByID(int memberID)
{
try
{
string query = "SELECT DISTINCT * FROM Foo WHERE bar=" + barId;
DataTable dt = Utils.ExecuteReader(query);
if (dt != null)
{
return dt;
}
else
{
return null;
}
}
catch (Exception ex)
{
throw new Exception("MethodID:= #210, Error:=" + ex.Message);
}
}
This sort of thing is repeated many times due to the delights of cut-and-paste. We've also cunningly embedded our data access stuff in our object models, no need to look in more than one place! We've not made any attempt at making Data Access easy for ourselves with proxy classes etc.
Mutters....
|
|
|
|
|
That if/else is a classic anti-pattern that I have seen far too many times as is the catch everything clause. However, giving the exception a MethodID number is not something I have seen very often, clearly this person is inventive. And I am sure that the Method ID will be of great use to the end user.
Copy and paste inheritance is in use everywhere. I'm even guilty of using that myself sometimes to get something working quickly. But, overall this code example is a classic horror.
Just because the code works, it doesn't mean that it is good code.
|
|
|
|
|
lol The comments are priceless. I really hope you left them in.
"You get that on the big jobs."
|
|
|
|
|
No code on this one, just a shameless story.
A few years ago I was working for a not very nice person (no comments). We were doing a small application for Microsoft (we were an MS vendor), and they asked us to convert it to SharePoint Web Parts.
Well, at that time (looooong time ago) we were just starting with SharePoint so we didn't know how. Instead of taking the time to learn and do it right, the boss spent COUNTLESS HOURS copying how a SharePoint site looked like, pretty much taking CSS and submenus and he went to Microsoft to give the demo. Luckily I was not there, I wouldn't be able to lie like that.
Luckily the MS guys didn't pay much attention to the demo, they just kind of saw the UI and the meeting went on.
The point is: how shameless do you have to be to blatantly lie to your customer? (and your only one for that matter)
Oh well... some people go in life being dishonest ...
Not me. Honesty is like virginity. You can go around in life being dishonest, but once you lose it you never get it back!
|
|
|
|
|
Unfortunately, most businesses work that way. Ethics seldom exist in business.
|
|
|
|
|
Tis sad tis true, tis true tis sad.
Just because the code works, it doesn't mean that it is good code.
|
|
|
|
|
CIDev wrote: Tis sad tis true, tis true tis sad.
That quote is, "Tis true, tis pity, and pity tis tis true." Hamlet, act 2, scene 2.
See ma? I didn't just take geek classes in college.
|
|
|
|
|
U r completely right dude! Now a days it more about Money then Ethics! And unfortunately that's true every where.
Richard Menezes
|
|
|
|
|
it's called Sales.
worked for a guy that was "12 credits from a Software Engineering degree" is what he'd tell his hires. Didn't know jack about software engineering, but could sell a freezer to an Eskimo. He routinely sold my time & talent by overcommitting me to deadlines and technologies.
I was there 7 months.
|
|
|
|
|
There is sales and then there is sales...
You can't build your company on a lie. You can sell stuff you don't have, like Bill Gates did but that is one thing. You can't show something and lie straight to that other person's face.
Oh, forgot to say. This guy was also fired from Microsoft 2 years before for trying to steal from them And then he started selling products TO Microsoft hahahaha
Just my humble opinion
My new toy: www.cloudclipx.com
-- If I have 8 hours to chop down a tree, I spend 6 sharpening my ax!
|
|
|
|
|
I don't believe this ever happened.
Sounds like a total LIE to me.
|
|
|
|
|
I know it is hard to believe.
My new toy: www.cloudclipx.com
-- If I have 8 hours to chop down a tree, I spend 6 sharpening my ax!
|
|
|
|
|
xavier morera wrote: Honesty is like virginity. You can go around in life being dishonest, but once you lose it you never get it back!
I've never sold out...
I'd blame it on the Brain farts.. But let's be honest, it really is more like a Methane factory between my ears some days then it is anything else...
-----
"The conversations he was having with himself were becoming ominous."-.. On the radio...
|
|
|
|
|
As someone in this thread will note, its called sales. My way of dealing with those lying bastards is to try to get myself as high in the decision making tree as possible. I've been bit too many times by sales. After they sell a system that CAN'T work, you get the blame because you weren't competent enough to do the job, while the salesman smiles and spends his commission on a new car.
I was doing a conveyor system once and after it was done, I did some timing tests and told the salesman who happened to be on platform at the time, that it was doing 22 cartons a minute and could be ramped up to a maximum of 40 CPM. He goes, "Sssh, sssh, we sold it saying it could do 80." Dumbfounded, I exclaimed it could never do that! He pointed to the existing system that was working at the maximum it could with the existing human workflow, and said it would never need to.
This attitude combined with the one that software could ALWAYS overcome hardware problems, came back to bite them big time on two projects. Unfortunately, I was on one of them. The other system worked only if everything worked perfectly. The first thing you learn in material handing is NOTHING works 100%, 90% at best, that and FIFO doesn't work. But the system I was on, I got to function at 65 CPM. The floor manager was extremely pleased with it. But corporate was not. The contract said 120 CPM and they weren't going to sign off on it until they saw it do 120. I made myself unpopular by doing math (I always pi$$ people off when I do math) and found if everything worked perfectly, the hardware maxed out at 114. The salesman not only had used the wrong formula, he designed it with only a 1% safety margin using that formula. So the fallout---my manager was fired and the salesman is still there. I left shortly after this wonderful manager had been fired and they had brought in the bozo who virtually nothing about software.
Psychosis at 10
Film at 11
|
|
|
|