PDA

View Full Version : Sloppy code (rant)


JBotAlan
08-30-2007, 07:02 PM
(Begin Rant)

I am *so sick* of professional programmers and their sloppy code.

Today, I spent 4 hours re-installing a web plugin throughout my school building that failed to install the first time. I don't care that it didn't install okay--I understand that if it tries to install in a reduced-privileges environment, it might fail trying to write a registry key or a system file. I don't fault it for failing. What I do care about is the error message it gave me: "Unspecified error."

WHAT!!?? The programmer that compiled the software wrote an error handler because he knew the code might fail. That's ok. However, he should be able to read the documentation for the function he is calling and handle each and every case of failure. And if the error code does not match any of the pre-programmed states, don't just pop up an error saying "Unspecified error", say "Unknown error code, cause #" and the error code. Give me a tech support number to call, and when they hear me read the error message, communicate with the programmers. Figure out what might be going on. Don't make me roll back to an older version because of a vague error message.

After fixing that mess, I came home and tried to log into GMail. However, as soon as I type my details in and hit Enter, I am forwarded not to my mailbox, but to a blank white screen. Why? If the JavaScript on my side isn't getting any data, *tell me*. I'm not stupid. Don't just park there at that beautiful snowy white screen. Give me a meaningful error message describing why you stopped. Help me fix it.

And then, to top that all off, my mom is trying to run some of her addicting games. They crash, giving me a "Could not create primary window" message. It has an OK box. That's all well and good when the box has focus, but no, another window does. I try to give the error box focus with my mouse, but the game has already called upon the Windows API to hide my mouse pointer. I ALT-TAB wildly, to no avail. I press CTRL-ALT-DEL, and the task manager pops up, but my mouse pointer is still invisible. I scoot the mouse around, and eventually stop the game task. A quick duck into the start menu yields the shortcut to play the game that just crashed, but no readme. I get online, but cannot find any help topic relevant to what just happened. What am I supposed to do now? The system specs blow away the minimum, and the error message is less than descriptive...so what now?

People, please get it together. Maybe I'm preaching to the choir here, but if you do any sort of professional coding, please handle your exceptions properly. Crash gracefully and descriptively, not ugly and vague. Help the user out. Don't confuse them. Search your code. Any "Unspecified error" lines in there? Fix them. It just might make you some business.

(To add a touch of irony, I couldn't even make this post right away because my Intel wireless app was suddenly "Unable to connect" to my router. With no reason. And then it just connected. What. The. Heck. :mad: :mad: )

(End Rant)

JBot

DonRotolo
08-30-2007, 07:33 PM
(Begin Rant)
I am *so sick* of professional programmers and their sloppy code.
By (my) definition, professional programmers do not produce sloppy code. They may be getting paid for it, and even making a living on it, but they are neither professional or, IMHO, programmers. I have a name for them, but this is a nice family-friendly site.

I see this all the time, and share your frustration.

When I write code, there are no errors, so I don't need error handlers.

(believe me? I thought not)

Don

EHaskins
08-30-2007, 10:09 PM
When I write code, there are no errors, so I don't need error handlers.

(believe me? I thought not)

Don

lol

I've actually talked to people who believe that.

JBot, I totally agree with your rant.

Eric

artdutra04
08-31-2007, 12:09 AM
// Or when programmers write like entire programs on a single line...
if (isset($display_page) && $display_page != NULL || !(thisFunction() && is_numeric($another_variable)) { echo "<html><head><title>Meeting: ".$meeting."</title></head><body><h1>".$meeting."<p>Time: " . date("H:i:s l, j F, Y", strtotime($date.' '.$time)) . "</p><p>Meeting agenda:".str_replace("\"","&quot;",str_replace("'","'",strip_tags(nl2br($_POST['agenda']),'<p><a><b><i><h1><h2><pre><ul><li><br>')))."</p></body></html>"; } else { echo "This is not an HTML page"; $display_page++; } // I cringe after writing random code that bad...


EDIT:

// Or when
if (....) {
the indenting;
is not uniform;
} else if (
the brackets &&
parenthesis
)
{ follow no;
sort of discernible;
logic;
or rational thought;
is_if->they_are_testing();
the lenient w h i te s p a c i n g rules;
of the compiler;
}

:rolleyes:

chris31
08-31-2007, 05:08 PM
// Or when programmers write like entire programs on a single line...
if (isset($display_page) && $display_page != NULL || !(thisFunction() && is_numeric($another_variable)) { echo "<html><head><title>Meeting: ".$meeting."</title></head><body><h1>".$meeting."<p>Time: " . date("H:i:s l, j F, Y", strtotime($date.' '.$time)) . "</p><p>Meeting agenda:".str_replace("\"","&quot;",str_replace("'","'",strip_tags(nl2br($_POST['agenda']),'<p><a><b><i><h1><h2><pre><ul><li><br>')))."</p></body></html>"; } else { echo "This is not an HTML page"; $display_page++; } // I cringe after writing random code that bad...


EDIT:

// Or when
if (....) {
the indenting;
is not uniform;
} else if (
the brackets &&
parenthesis
)
{ follow no;
sort of discernible;
logic;
or rational thought;
is_if->they_are_testing();
the lenient w h i te s p a c i n g rules;
of the compiler;
}

:rolleyes:

All I have to say is...My eyes! they burn!