|
Jonnty posted:How many programmers you know regularly work on radius calculation programmes? That's the point I was making; that the people making fun of him in the comments are mean-spirited since this guy obviously isn't a programmer.
|
# ? Jan 16, 2011 11:08 |
|
|
# ? May 15, 2024 16:43 |
|
yaoi prophet posted:That's the point I was making; that the people making fun of him in the comments are mean-spirited since this guy obviously isn't a programmer. Oh sorry, I thought you were saying the opposite because posting on stackoverflow makes you a professional programmer or something. My mistake
|
# ? Jan 16, 2011 11:38 |
|
NotShadowStar posted:And of course the dripping pit of Aspergers, Stackoverflow, just rip into him instead of actually guiding him.
|
# ? Jan 16, 2011 12:39 |
|
zootm posted:My favorite instance of this form of nerd rage was in an IRC channel, where someone continually rked into a beginner's program's time complexity instead if helping the guy with his elementary syntax problem. The internet's supply of self-righteous arseholes is seemingly inexhaustible. It was said on a Starcraft forum but it holds true everywhere: People don't post on forums because they want to be helpful or to discuss things. They post on forums because they want to be right. And what better way to be right than by making someone feel terrible for being wrong?
|
# ? Jan 16, 2011 22:04 |
|
Ryouga Inverse posted:It was said on a Starcraft forum but it holds true everywhere: People don't post on forums because they want to be helpful or to discuss things. They post on forums because they want to be right. I like that. I will use that quote in the future. I find that if you don't want to be a douche, try to interpret other people's comments/questions in the most charitable way possible. For example, with the code under question, you could assume the guy is an idiot, or you could assume he's just ignorant.
|
# ? Jan 17, 2011 00:29 |
|
code:
|
# ? Jan 18, 2011 14:32 |
|
Lysandus: Placeholder for validation logic? Please?
|
# ? Jan 18, 2011 14:36 |
|
Probably a typo or slip of the brain. Likely meant 'return _itemID' or some such. Slow coding horror weeks!
|
# ? Jan 18, 2011 16:33 |
|
Internet Janitor posted:Lysandus: Placeholder for validation logic? Please? It's existed for three versions of the software and there are no comments around it indicating it might be. NotShadowStar posted:Probably a typo or slip of the brain. Likely meant 'return _itemID' or some such. Here's the best part. The only place it's used. code:
|
# ? Jan 18, 2011 17:07 |
|
code:
This breaks a major feature in XMBC, and has gone unnoticed for months because of differences in how major versions of python handle int(boolean).
|
# ? Jan 18, 2011 19:25 |
|
Lysandus posted:Here's the best part. The only place it's used. I found one like this a while ago, I think some people just think in broken ways. code:
|
# ? Jan 18, 2011 20:39 |
|
Recently for my degree, we had to participate in a 6-man group project to combine 3 different scripting languages (JS, perl, python) to produce some kind of product that could be pitched to our lecturers. We ended up choosing an online poker game that is run from a webpage, much like like a flash game but written in JS. Our group comprised of me, my 2 housemates, a friend, and 2 other guys who none of us knew but had added themselves to our group on the student wiki. Fine, we weren't too bothered since we didn't really have any other people to take on. We were a little skeptical however since one of them has failed the year before and his previous scripting project had been written at the last minute and comprised of 300 lines of perl python and JS. Anyway, they'd volunteered to write the Python side of the product which comprised of creating the actual rules and gameplay of our poker game. It would then send a JSON gamestate to the javascript via AJAX. They had been adamant throughout the project that things were going well and they were making good progress on the game, but when we finally came round to testing it, the python was completely broken and didn't at all resemble a poker game. Their code was absolutely atrocious to the point that it defies belief. There seemed to be an almost total lack of loops in favor of exhaustive enumeration using ifthenelse statements. Check this out; code:
code:
In total the entire python code, which was simply a game of poker, amounted to over 1200 lines. I learned a good lesson here however, do it all yourself. PIGEOTO fucked around with this message at 04:56 on Jan 19, 2011 |
# ? Jan 18, 2011 22:16 |
|
quote:3 different scripting languages (JS, perl, python) to produce some kind of product that could be pitched to our lecturers Real horror found. What the gently caress. Javascript for client UI and you need just one language for a server. Tying together two languages just for a server is madness and stupid. quote:I learned a good lesson here however, do it all yourself. That's a good way on getting burned out in life. I'll tell you that I learned this far later than I should have. What you the other group members should do is go to the professor and explain that the other people were promising but not actually delivering, and what they are delivering is unworkable; but since they weren't working with you that you couldn't catch it.
|
# ? Jan 18, 2011 22:47 |
|
NotShadowStar posted:Real horror found. What the gently caress. Javascript for client UI and you need just one language for a server. Tying together two languages just for a server is madness and stupid. quote:That's a good way on getting burned out in life. I'll tell you that I learned this far later than I should have. What you the other group members should do is go to the professor and explain that the other people were promising but not actually delivering, and what they are delivering is unworkable; but since they weren't working with you that you couldn't catch it. PIGEOTO fucked around with this message at 00:07 on Jan 19, 2011 |
# ? Jan 18, 2011 22:56 |
|
I'm digging through a connection class for one of our internal apps and there is no handling for HTTP 401 responses from the server. And by no handling I mean the entire app crashes if the server returns a 401.
|
# ? Jan 20, 2011 16:08 |
|
PIGEOTO posted:terrible poker horror I did something like this when programming my first game ever. Back when I was 13. Except it was a platformer, and I didn't know what arrays were for, so I did that, and there were only 9 platforms allowed at any one time. I gave up because my program eventually became such a glitchy mess that teenager me didn't know how to debug it (I had a bug where damaging one enemy once would cause all the others to take tons of damage at once or die), but it was a fantastic learning experience. That said, this guy has had previous programming classes. I don't mean to be condescending to him, but come on. Arrays and loops are some of the first things you learn about in programming, and if he's not new at this and taking classes, that's just .
|
# ? Jan 20, 2011 23:09 |
|
PalmTreeFun posted:I did something like this when programming my first game ever. Back when I was 13. Except it was a platformer, and I didn't know what arrays were for, so I did that, and there were only 9 platforms allowed at any one time. I gave up because my program eventually became such a glitchy mess that teenager me didn't know how to debug it (I had a bug where damaging one enemy once would cause all the others to take tons of damage at once or die), but it was a fantastic learning experience. PIGEOTO fucked around with this message at 00:24 on Jan 21, 2011 |
# ? Jan 21, 2011 00:18 |
|
Found a routine today that assigns a waybill number for a certain shipping company. You would think that it'd be easy; connect to the shipping company via API, grab a waybill number, record/relate it, and move on. Apparently the first step is impossible because the shipping company can't definitively determine the status of waybill number at assignment, it has to clear their system after 24 hours. Instead we're assigned ranges of shipping numbers that are 'ours' in the format of <char>12345, usually from 0-9999. This part is the horror. The previous guy made a proc that basically goes 'WayBillNo = <char> + Substring(WaybillsPrimaryKey,2,5)' after inserting each waybill registration. For those not following at home the horrors are: - Every time the 'range' changes you have to manually increment the primary key to match the new range. So if the new range was 500-15000 you'd have to make sure the next PK inserted is x00500. - Every time the <char> changes (which it does every time the range does) you have to change the stored proc's hardcoded value of <char> - Because of the first part the primary key will grow unnaturally fast as you're always jumping to the next thousand/ten thousand/hundred thousand after a range change. - The best part, related to the above: the whole thing will fail as soon the primary key reaches the next significant digit (e.g. moving from 10,000 to 100,000, 100,000 to 1,000,000, etc.) because the substring call doesn't care how long the thing is (there's a convert(varchar) I left out of the above for clarity). I wonder how many other ticking time bombs like this waiting to be discovered... I mentioned it to a coworker and he just smiled and said "job security!" EDIT-bonus points to whoever works in logistics and can identify the shipping company based on the structure of their waybill numbers EDIT EDIT-It gets better; he's storing the result WayBillNo as a string in a varchar column. The column's defined size is varchar(6); as soon as the numbers pass 5 digits it would have broke there too. Scaramouche fucked around with this message at 00:58 on Jan 21, 2011 |
# ? Jan 21, 2011 00:48 |
|
I don't know if this qualifies as a HORROR, but it really irked me. I'm taking a Digital Signal processing lab, and we use C to program a Blackfin 535 emulator (one of these). On Friday, we ran through a basic familiarize-yourself-with-the-development-environment sort of lab. Part of it was compiling and running some sample code, that looked something like this... code:
Also int output=0.0;? whats that about? I also cannot figure out where math.h is used. When I asked the TA he condescendingly told me that obviously they wouldn't make two functions that did the same thing, and to check more carefully. When I showed him line by line that they were identical, he said it was because they were trying to be less confusing. Personally, I felt this to be a LOT more confusing that just using 1 function, especially since I wasted 10 minutes checking, rechecking, running the functions with different inputs, and talking to the TA.
|
# ? Jan 23, 2011 20:48 |
|
What is the point of code:
|
# ? Jan 23, 2011 21:17 |
|
darkhand posted:What is the point of In ANSI C you can't declare the variable i inside the for loop.
|
# ? Jan 23, 2011 21:18 |
|
code:
|
# ? Jan 23, 2011 21:22 |
|
Maybe it used to be something else and the parenthesis were left in.
|
# ? Jan 23, 2011 21:40 |
|
Mustach posted:Despite being totally harmless, whenever I see a parenthesized return expression, I feel that it's a very telling instance of bad style. Edit: But return(stuff); is just weird. Malloc Voidstar fucked around with this message at 21:50 on Jan 23, 2011 |
# ? Jan 23, 2011 21:47 |
|
Mustach posted:
Some C/C++ compilers used to do that*. return a + b would return a without adding b to it and debugging that a few times will create a strong habitual aversion to leaving off parentheses as well as leave a pile of your hair on the floor behind the chair. *Borland 4.something? did back in the late 90s. I don't remember if they fixed it in 5, but maybe I had learned to never try it again. Munkeymon fucked around with this message at 22:53 on Jan 23, 2011 |
# ? Jan 23, 2011 22:51 |
|
Mustach posted:Even worse, do they think that return is a function? Clearly return is the continuation implicitly passed to the current function, and if C supported higher-order programming you'd be able to pass it as a parameter to other functions for continuation-passing-style programming. People who use parenthesis on return are just planning ahead to be future-compatible with FunctionalC.
|
# ? Jan 23, 2011 23:20 |
|
TasteMyHouse posted:I don't know if this qualifies as a HORROR, but it really irked me. void main() is always a horror.
|
# ? Jan 24, 2011 00:52 |
|
HORATIO HORNBLOWER posted:void main() is always a horror. Not when you're programming a DSP...
|
# ? Jan 24, 2011 01:36 |
|
Outlaw Programmer posted:The other developer will get offended and say that code reviews are only for finding bugs, not for criticizing "style." That's a total bullshit attitude. We treat code reviews as an overall sanity check, which includes calling people out on bad/questionable stylistic choices. Luckily, I work on a small team and the boss is a hardass who will outright tell you to stop being a pussy if you complain about someone being "mean" in a code review. I've gotten my rear end handed to me in code reviews, and I like to think that I came away having learned something as a result. I mean, some stuff is personal preference... I don't like the ternary operator, but I'm not going to insist that someone not use it unless it makes the code an unreadable shitpile.
|
# ? Jan 24, 2011 05:02 |
|
TRex EaterofCars posted:In ANSI C you can't declare the variable i inside the for loop. You can according to C99, although compilers like gcc require you to explicitly enable C99 features.
|
# ? Jan 24, 2011 06:41 |
|
dark_panda posted:You can according to C99, although compilers like gcc require you to explicitly enable C99 features. I don't understand your point. ANSI C is not C99 and while C99 is becoming the standard, ANSI C is portable to compilers that don't support C99, so if you program for portability it is beneficial to pick the standard with the most compiler support. That said, the reason for it being chosen is more likely that it was programmed by someone who learned C before C99 became common.
|
# ? Jan 24, 2011 10:21 |
|
Or in this case probably because someone learned by example from someone who learned by example from someone who learned C before C99 became common
|
# ? Jan 24, 2011 11:30 |
|
Edison was a dick posted:I don't understand your point. ANSI C is not C99 and while C99 is becoming the standard, ANSI C is portable to compilers that don't support C99, so if you program for portability it is beneficial to pick the standard with the most compiler support. C99 is ANSI C, along with C90 and C89. What am I missing? http://en.wikipedia.org/wiki/ANSI_C Similar pedant post of the day on Stackoverflow, "UTF-8 isn't guaranteed by the C++ standard so you shouldn't use it": http://stackoverflow.com/questions/4766301/windows-console-and-qt-unicode-text/4769080#4769080 I deliberately use UTF-8 to gently caress over stupid MSVC users, I have no problem in MSVC 2010, OS X, Solaris or Red Hat. Just because Windows likes UCS2-LE internally doesn't mean you have to use it anywhere else. MrMoo fucked around with this message at 15:08 on Jan 24, 2011 |
# ? Jan 24, 2011 15:02 |
|
MrMoo posted:C99 is ANSI C, along with C90 and C89. What am I missing? quote:C89
|
# ? Jan 24, 2011 22:27 |
|
Jethro posted:So C99 has been adopted by ANSI as the current standard for the C Programming language, but it is not "ANSI C". Anyways, my point was that it's valid C according to C99 and that some people are used to seeing it these days. It's not "ANSI C", granted, I just meant that it's valid C now is all. Jeez.
|
# ? Jan 25, 2011 00:49 |
|
Mustach posted:
None of the above. Seriously, few people think they're anything but syntactic idioms. Over the years, I've learned to let things like this slide. My boss got up on my rear end a bit at first about "if (x)" vs "if(x)", "return(x)" vs "return x", and so forth. (They're big on the bracketed returns, if you haven't guessed). The justification was that it was easier for humans to scan, and that justification even extends to their tab width selection. The coding standards doc has references, but I haven't checked them out. Everyone has their coding peccadilloes -- for instance, despite my preference for "return x", I had a habit of putting brackets around unary operators, despite precedence. Letting the little things slide in exchange for having everyone on a team code in a consistent manner is a very good tradeoff -- one very much appreciated in the dark hours of the morning.
|
# ? Jan 25, 2011 04:06 |
|
Is there anyone in the world who upon seeing the words "ANSI C" would think "C99"?
|
# ? Jan 25, 2011 16:16 |
|
Well I wouldn't jump to thinking C89 either.
|
# ? Jan 25, 2011 17:34 |
|
gcc's -ansi gets you close enough to C89, though.
|
# ? Jan 25, 2011 17:47 |
|
|
# ? May 15, 2024 16:43 |
|
Tumblr lets users reblog/like posts they see on their dashboard. When you look at an individual post, it also shows you the last 50 or so 'notes' (reblogs, likes, and replies) on that post, not only by that user, but by all people who reblogged that post. Pretty interesting, right? Sounds like the sort of data you might want to visualize if you're into that sort of thing. Well, you can't. There's no way, API or scraping, to get all the notes; you have to manually do XmlHttpRequests. And even then you can't get all of them because it likes repeating notes and at some point it gives you the same set of 50 over and over again. Fortunately, you can detect this because it gives you the same XHR url, but still. Ugh. Bonus horror: your tumblr URL is username.tumblr.com. Usernames can begin or end with dashes. The grammar suggested by RFC 1035 for DNS doesn't allow that. So it's a crapshoot as to whether usernames that begin/end with dashes will actually work in any given program. And it's common to use dashes as a 'someone else got to this username before I did' thing. Opinion Haver fucked around with this message at 19:31 on Jan 25, 2011 |
# ? Jan 25, 2011 17:56 |