|
The Noble Nobbler posted:They have Unit Tests. That's more than most places. Commonly heard at my old job (a web company): "Oh gently caress oh gently caress oh gently caress. The server went down / the login page started throwing exceptions / etc right after we rolled out our new dlls. gently caress gently caress gently caress gently caress gently caress." No testing or validation or review whatsoever beyond what the programmer felt like doing at the time. The amazing thing is that they service over 50 colleges at this point and have only lost three of them in five years of doing business. To contribute (I can't remember whether I've posted this before): quote:My boss (no programming experience whatsoever before he picked up VB.NET) wrote this code: Another sample of his programming skillz: quote:Dim x As Integer = datareader.GetInt32(0) If you're wondering how anyone could gently caress up data types that badly: he literally just typed and used Visual Studio code completion until it compiled.
|
# ? Jul 4, 2009 19:56 |
|
|
# ? May 16, 2024 17:20 |
|
At my last job, our entire codebase was littered with CInt(0) or CInt(1) on method calls - you know, just to be extra sure that the compiler doesn't interpret a literal integer as a long or float or something.
|
# ? Jul 4, 2009 22:00 |
|
plushpuffin posted:No testing or validation or review whatsoever beyond what the programmer felt like doing at the time. So I don't work for Lockheed Martin, but I have to work with Lockheed Martin. Let me summarize their approach to testing/debugging: quote:Reboot until it sort of works, then the problem never existed.
|
# ? Jul 5, 2009 09:25 |
|
I like reading this thread for "What no to do"(s). But I wish you explained why what you posted is wrong and the correct way they should have done it, more often. This thread is a good resource for that sort of thing.
|
# ? Jul 5, 2009 12:57 |
|
BigRedDot posted:So I don't work for Lockheed Martin, but I have to work with Lockheed Martin. Let me summarize their approach to testing/debugging:
|
# ? Jul 5, 2009 16:19 |
|
Dijkstracula posted:Remind me to never get into a plane again Don't worry, Boeing and Airbus make our planes, they just make our missile defense, spy satellite, air superiority, nuclear strike capability, and manned space exploration equipment To contribute, I work with computer modelling of buildings and have found that you cannot refine finite plate elements with a certain very widely used program that has been around for decades. Such an oversight means having to basically enter in hundreds of units manually at great time expense. They plan on solving this, to get competitive with other comparable softwares, in version 30.
|
# ? Jul 5, 2009 18:25 |
|
Jon93 posted:I like reading this thread for "What no to do"(s). But I wish you explained why what you posted is wrong and the correct way they should have done it, more often. You can't teach people that way. They'll (you'll) just make equally dubious decisions that are ever-so-slightly different from what's listed here. Everyone's got (at least) 10,000 lines of awful code in them so you just have to get that out of your systyem first.
|
# ? Jul 5, 2009 20:27 |
|
Avenging Dentist posted:You can't teach people that way. They'll (you'll) just make equally dubious decisions that are ever-so-slightly different from what's listed here. Everyone's got (at least) 10,000 lines of awful code in them so you just have to get that out of your systyem first. Hahaha oh man you should've seen my Tetris clone from high school. Let's just say there were local variables named xxxxx and yyyyy.
|
# ? Jul 6, 2009 15:09 |
|
Even though obfuscated code is arguably not an intentional coding horror, I was reminded of this hilarious rock-paper-scissors bot from my AI class a few years back:code:
code:
|
# ? Jul 6, 2009 17:57 |
|
ColdPie posted:Hahaha oh man you should've seen my Tetris clone from high school. Let's just say there were local variables named xxxxx and yyyyy. I wish I could find my old IRC library. I created a very bad state machine to parse messages from the server, one byte at a time. One giant while loop with a switch(state) and case 3: if (byte == ':') then state = 4; etc... Oh and I thought I was being "cute" with monty python quotes in the comments.
|
# ? Jul 6, 2009 18:13 |
|
Reviewing some OLD code a while back, I found myself scratching my head. What was this idiot thinking? Then I realised: It was MY code... Amongst it, and one of the factors that helped me recognise it, was this: code:
|
# ? Jul 6, 2009 20:54 |
|
Mikey-San posted:
Masked Pumpkin posted:
|
# ? Jul 6, 2009 21:09 |
|
Not necessarily a coding horror, but I bet you've never thought to make a "weirdness handler" for your website:code:
|
# ? Jul 7, 2009 14:25 |
|
Ehh, that's just a debug function. But if you look real close, you'll see that there's also a wierdness function. Even the subject line of the mail message takes that as the canonical spelling...
|
# ? Jul 7, 2009 15:10 |
|
Triple Tech posted:Ehh, that's just a debug function. No I know, I just thought it was amusing that the whole function is centered around "weirdness" instead of "errors" or "bugs" or whatever. Again, not a coding horror, but I just thought it was funny nomenclature and couldn't think of a better place to post it.
|
# ? Jul 7, 2009 15:54 |
|
This code is now my favorite code:code:
|
# ? Jul 7, 2009 18:01 |
|
Lexical Unit posted:This code is now my favorite code:
|
# ? Jul 7, 2009 20:42 |
|
gibbed posted:Why is this a horror? If you don't take one look at this and instantly get scared or nervous like that time when you were in 6th grade and you felt like you were going to poo poo your pants because some huge 8th grader was going to eat you alive ... then you're probably a bad programmer.
|
# ? Jul 7, 2009 20:54 |
|
gibbed posted:Why is this a horror? - random, pointless printing to cerr - creating a T instance makes the byteswap function a lot less generic than it could be - pointless runtime switching (this will almost certainly get optimized away, though) among other crimes
|
# ? Jul 7, 2009 20:55 |
|
To say nothing of that ridiculous switch statement could be removed (edit: or at least simplified) if the author had known about fls()
Dijkstracula fucked around with this message at 21:03 on Jul 7, 2009 |
# ? Jul 7, 2009 21:01 |
|
Not a horror, butcode:
We had a fun time in the channel kicking around why Linus might have chosen the ((void)0) construct.
|
# ? Jul 7, 2009 21:09 |
|
Otto Skorzeny posted:We had a fun time in the channel kicking around why Linus might have chosen the ((void)0) construct. What do you mean? That's idiomatic C for "do nothing".
|
# ? Jul 7, 2009 21:22 |
|
Not everybody itc knew that
|
# ? Jul 7, 2009 21:29 |
|
Painless posted:among other crimes code:
|
# ? Jul 7, 2009 21:44 |
|
Lexical Unit posted:In case y'all were curious, here are the lines of code that lead me to inspect the byteswap header file in the first place, God dammit people are stupid.
|
# ? Jul 7, 2009 21:50 |
|
Lexical Unit posted:In case y'all were curious, here are the lines of code that lead me to inspect the byteswap header file in the first place, A horribly wrong way to use a horribly implemented function and simultaneously ignore the existence of a horribly implemented utility function? Nice.
|
# ? Jul 7, 2009 21:53 |
|
code:
Mustach fucked around with this message at 22:31 on Jul 7, 2009 |
# ? Jul 7, 2009 22:27 |
|
Lexical Unit posted:Yes, those comments were checked in. Funny comments checked into the code could make for an interesting twitter feed. I'm pretty sure the codebase I work on could supply a few hundred. code:
code:
code:
code:
code:
code:
code:
code:
|
# ? Jul 7, 2009 22:32 |
|
I sympathize with some (not really) of them. Sometimes I write a simple interface and document what's missing. Then I change the interface but ignore the nearby comments. Now the comments sound crazy, referring to things that don't exist but are sort of kind of related.
|
# ? Jul 7, 2009 22:39 |
|
How about using RTL characters as delimiters in query strings? Took me forever to figure out what ר is (it's a Hebrew "resh"). Here's an edited version of a nice simple link to an RSS feed: http:/example.com/rss?sr=ר9+ר575d01ר63"ר 1">ר24ר18ANDר16ר45ר26anyר21ר8contains ר7ר54salmonר51ר28ר17ר341ר22ר4910 ר36ר14trueר13ר65trueר66ר46ר47engר 44ר31ר39ר35domainר20ר35topicר20ר35creator ר20ר35creationdateר20ר35rtypeר20ר35langר 20ר35lccר20ר35jtitleר20ר35facet_tlevelר20ר 29ר67vertitleר68ר67titleר68ר67creatorר68ר 67contributorר68ר67publisherר68ר67creationdateר68 ר40ר50+valueר63"scope%3A(UNI)"+typeר63"local"+ר575d00 ר63"ר0"%2F>ר30ר4&ctx=ר15+ר57%3Acomר 63"ר2">ר3772603C4AA1C6012CF90EEAF14A6CBAD3ר25ר43DEMOר 27ר53GUESTר52<com%3ApdsGroup%2F>ר387720091591968372009791915 ר33ר56444.444.444.444ר55ר48trueר41ר72trueר 73ר12s>ר11NOT+scope%3A("VENDOR")ר6ר5ר10&ver=2_1_4 Especially keen is the behaviour when you try to highlight parts of that...
|
# ? Jul 8, 2009 00:35 |
|
FeloniousDrunk posted:Especially keen is the behaviour when you try to highlight parts of that... Holy poo poo.
|
# ? Jul 8, 2009 00:57 |
|
FeloniousDrunk posted:Especially keen is the behaviour when you try to highlight parts of that... I didn't know text could do that.
|
# ? Jul 8, 2009 01:16 |
|
Painless posted:- random, pointless printing to cerr Dijkstracula posted:To say nothing of that ridiculous switch statement could be removed (edit: or at least simplified) if the author had known about fls() It seemed mostly OK to me, although I wouldn't make it a template.
|
# ? Jul 8, 2009 01:17 |
|
Dijkstracula posted:To say nothing of that ridiculous switch statement could be removed (edit: or at least simplified) if the author had known about fls() What is fls()? Thanks, for some reason the machine I'm on don't have man pages for those. Weird. vvvv floWenoL fucked around with this message at 01:54 on Jul 8, 2009 |
# ? Jul 8, 2009 01:42 |
|
floWenoL posted:What is fls()?
|
# ? Jul 8, 2009 01:44 |
|
Dijkstracula posted:To say nothing of that ridiculous switch statement could be removed (edit: or at least simplified) if the author had known about fls() Did he specify he was on a BSD? ffs(3) and its extensions are in POSIX.1-2001, but fls(3) and friends are BSD-specific from what I can tell. e: more than BSD-specific, fls(3) first appeared in FreeBSD 5.3 circa November 2004 Blotto Skorzany fucked around with this message at 02:26 on Jul 8, 2009 |
# ? Jul 8, 2009 02:22 |
|
Seth Turtle posted:I didn't know text could do that. Your text system is trying to decide whether that block reads left-to-right or right-to-left and failing.
|
# ? Jul 8, 2009 02:53 |
|
Otto Skorzeny posted:Did he specify he was on a BSD? ffs(3) and its extensions are in POSIX.1-2001, but fls(3) and friends are BSD-specific from what I can tell. edit:
|
# ? Jul 8, 2009 02:58 |
|
gibbed posted:This is nitpicking and platform specific, although the cerr thing is stupid, yes.
|
# ? Jul 8, 2009 03:19 |
|
|
# ? May 16, 2024 17:20 |
|
BigRedDot posted:It almost certainly doesn't work as intended for floating point variables, yet it accepts them silently. There is no generalized way to byte-swap IEEE 754 numbers anywhere, they are for all intents and purposes non-portable.
|
# ? Jul 8, 2009 03:26 |