I saw that, and for some reason I thought that you were commenting on misspelling or something. Then about 45 seconds later I got the joke. I think I've only actually seen that compiler error once.Fred wrote: throw an "unreachable code" error
examples of bad code (and why) ?
Re: examples of bad code (and why) ?
:-p
Re: examples of bad code (and why) ?
Having a slow day? :-)
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
Re: examples of bad code (and why) ?
I found this on the interwebs:
Bad variable naming, times two, plus magic number, times one, equals meaningless code.
Fred.
Code: Select all
if (i<3 && b<0) {}
Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
Re: examples of bad code (and why) ?
Pointless code:
Whose code is this, you ask? Mine! :-o
How the hell that made it near a source file I have NO idea. Possibly auto-generated or possibly a hang over from a loop with more than 1 in it?
It's gone now...
Fred.
Code: Select all
for (int i = 0; i < 1; i++) {
// Lots of code, none of which referenced 'i'
}
How the hell that made it near a source file I have NO idea. Possibly auto-generated or possibly a hang over from a loop with more than 1 in it?
It's gone now...
Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
Re: examples of bad code (and why) ?
Not really bad code per se, but:
Tell me why I got these warnings? :-)
Code: Select all
[WARNING] Messages.java:247: warning - @param argument "a" is not a parameter name.
[WARNING] Messages.java:247: warning - @param argument "the" is not a parameter name.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
Re: examples of bad code (and why) ?
M$?
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
Re: examples of bad code (and why) ?
Code: Select all
try
{
// Make one-line call
} catch (Throwable e)
{
throw new Exception(e);
}
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
- russian
- LQFP112 - Up with the play
- Posts: 154
- Joined: Fri Feb 01, 2013 4:18 pm
- Location: Jersey City, USA
Re: examples of bad code (and why) ?
I believe
is bad code.
And some people do agree with me - http://stackoverflow.com/questions/2580 ... e-into-shi
There is the whole http://code-wtf.livejournal.com/ on this - I know it's a bit in Greek but most of it is code anyway
Code: Select all
a = a >> 1;
And some people do agree with me - http://stackoverflow.com/questions/2580 ... e-into-shi
There is the whole http://code-wtf.livejournal.com/ on this - I know it's a bit in Greek but most of it is code anyway
Re: examples of bad code (and why) ?
Working on some horrendous code at the moment. Most of it is fairly average and normal, but a certain person did some stuff to it in the past that has rendered it nearly unusable now. The only example that I can succinctly post here is the following:
Removed 770,000 rows from a db table, none of which were used. This took over an hour to achieve. The database has no forreign key constraints. WTF. I can't explain more, really, but the 770 were autogenerated rows with no value... bleh.
Fred.
Removed 770,000 rows from a db table, none of which were used. This took over an hour to achieve. The database has no forreign key constraints. WTF. I can't explain more, really, but the 770 were autogenerated rows with no value... bleh.
Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!