|
Bunny Cuddlin posted:that was posted yesterday and? I wasn't implying it was old, just that it's getting enough run to have had responses and responses to those responses and then responses to those...
|
# ? Jan 25, 2013 22:40 |
|
|
# ? Jun 8, 2024 05:48 |
|
ymgve posted:Unless you are on some especially braindead operating system, the OS should take care of any unclosed file handles and other resources the program used. Depends on if buffered IO was flushed first: code:
|
# ? Jan 25, 2013 22:47 |
|
This is, far-and-away, the most smug, bay-area sounding thing I've ever read.
|
# ? Jan 25, 2013 23:05 |
|
Hard NOP Life posted:2. It can't open any more files and shits itself? Close but no cigar. Async mode can be writing multiple files at once. It shits on everything it is writing at the time. The code explicitly bombs on error. For some reason. Like, it singles that error out. Thermopyle posted:Why is ridiculing with no context an effective way of making this happen? (Assuming the intention is to limit the amount of such code out there rather than just inflating your own ego) Pretty sure it made her feel bad.
|
# ? Jan 25, 2013 23:23 |
|
Zombywuf posted:Pretty sure it made her feel bad. And we come full circle. Why is this good? What is the intention?
|
# ? Jan 25, 2013 23:33 |
|
1337JiveTurkey posted:She can at least delete that herself. But it's infused with... pride? It just seems like there's hordes of employers who wouldn't bat an eye at winding up a javascript engine just to bat some text around, while documentation of shattering at anonymous, unfounded internet criticisms might be more problematic.
|
# ? Jan 25, 2013 23:40 |
|
Thermopyle posted:And we come full circle. Why is this good? What is the intention? I don't think you meant to use the word effective. As for why, well anything that lessens the chance I will ever see this code in prod is good by me. Maybe eventually I'll quit smoking and drinking so much. Maybe if some of the Gnome or MySQL devs posted whines about all the people being mean about their code they'd write less of it and I could sleep better at night.
|
# ? Jan 25, 2013 23:41 |
|
Her post was pure ownage. Lots of people wouldn't have noticed what shitlords steveklabnik and coreyhaines are if it weren't for that post.
|
# ? Jan 25, 2013 23:47 |
|
Zombywuf posted:I don't think you meant to use the word effective. You must be a wonderful coworker.
|
# ? Jan 25, 2013 23:48 |
|
GrumpyDoctor posted:You must be a wonderful coworker. Ask tef
|
# ? Jan 26, 2013 00:22 |
|
People who write terrible code shouldn't be ridiculed, they should just be fired, that's much nicer
|
# ? Jan 26, 2013 02:36 |
|
npe posted:People who write terrible code shouldn't be ridiculed, they should just be fired, that's much nicer People who write bad code should be handled by adults, not tried and convicted by immature manchildren. God drat.
|
# ? Jan 26, 2013 04:48 |
|
Everyone should be deeply ashamed of their code and make every attempt to conceal it. If you expose it to the open air, people will laugh and ridicule you, and deservedly so. Only a small amount of code that has ever been written is worth looking at, and the rest is highly corrosive and radioactive and should be kept in a lead container inside a concrete sarcophagus rather than on github where people might accidentally look at it.
|
# ? Jan 26, 2013 05:41 |
|
Ithaqua posted:In my experience, the Ruby world has a very high concentration of pretentious pricks. First time I really heard of ruby was when that Matt Aimiotti dude did the "Runs like a Porn Star" presentation a few years ago.
|
# ? Jan 26, 2013 07:14 |
|
ultramiraculous posted:This is, far-and-away, the most smug, bay-area sounding thing I've ever read. Telling me. God drat if it isn't the most self serving pile of words I've ever seen as a defence of ... something.
|
# ? Jan 26, 2013 07:48 |
|
Volte posted:Everyone should be deeply ashamed of their code and make every attempt to conceal it. If you expose it to the open air, people will laugh and ridicule you, and deservedly so. Only a small amount of code that has ever been written is worth looking at, and the rest is highly corrosive and radioactive and should be kept in a lead container inside a concrete sarcophagus rather than on github where people might accidentally look at it. That being said, I'd like to share a horror anyways! I was trying to get a USB relay to be software-controlled. It came with a Windows GUI application that kind of, sort of worked, but it had quirks. It would sometimes just post "Unspecified Error" in a dialog box when trying to use it. It forced you to wait 5 seconds before doing a power cycle with the relay by showing a dialog box "Wait X seconds" if you tried to switch too soon. Like, if you turned it off and 2 seconds later, you wanted to turn it back on, you'd get "Wait 3 seconds." They could have, you know, just put that wait time into the GUI. It would also sometimes just fail to detect the stupid relay. You could sometimes fix this by fidgeting and fumbling around with it on a different USB port. So we figured we could do that software better, and we kind of had to if we wanted to control it hands-free. I looked at their SDK, which was basically the source code for that project. The project was a Visual C++ 2008 project, and it came with the bin\Release path already existing, so if you tried to build it, it would tell you it was already up-to-date unless you cleaned it up first. Yeah, that is in the installer's archive. It had a ReadMe.txt, which I've learned by now whenever you see that in this poo poo, it's just the "The Windows App Wizard slid all these files out of its rear end and this is what you should put in them." That's just the stub you get when creating a default project. Of course it had no useful information. I've learned that when I see these, the code is probably terrible. So the real horrors began. The relay comes up in device manager as a USB->serial adapter, COM port and all. I was expecting to see the application doing serial I/O. But no, it would open the USB device as a raw USB device, using the vendor and product IDs, and transact with it using ioctl wrappers! Okay, fine, maybe that was a way to allow two programs to access the port at once, since COM ports block. But if you opened up two instances of this program, well, God help you. Second, most of the commands were single-byte, hex sequences. Here is how they put a control code in one of their buffers: code:
code:
There was some shorter sample code I had found to talk to the device, and that was rather straight-forward. The problem was that if any other USB ports on the host PC changed, whether adding or removing a device, the relay would just turn off. Plug in a new keyboard, turn off. Unplug a thumb drive, turn off. The test application didn't do that, and I wanted to know why, but I knew it wasn't actually using the USB-serial driver as serial device, so I couldn't snoop it that way. It was time for the software USB protocol analyzer! I bring that thing up and start capturing. It was very odd to see such a large volume of traffic, and then I realized what it was doing. In the GUI example, if you told the relay to turn on, this program would just constantly poll that port and tell it, "Turn on turn on turn on turn on turn on turn on turn on turn on turn on turn on turn on." Similarly, if you told the relay to open and turn off the power, it would poll the port with "Turn off turn off turn off turn off turn off turn off turn off turn off turn off turn off." So it wasn't that it actually did it any better, it just wasn't obvious. It was also pretty clear to me they knew about the problem and decided this was the solution. So if you were running it and, say, plugged in a thumb drive to the same host PC, it would be like "Turn on turn on turn on turn on turn on turn on turn on [Remove thumb drive and it shuts off for a split second] turn on turn on turn on turn on turn on." So if you had a computer on that thing, you'd realize it had rebooted, but when you looked at the relay, it would appear that it was on and everything was okay. Seriously, what the flying gently caress? Rocko Bonaparte fucked around with this message at 08:51 on Jan 26, 2013 |
# ? Jan 26, 2013 08:48 |
|
Found this little gem while refactoring some code. It's not really a standalone method, actually part of a much longer method that is equally convoluted. Java code:
|
# ? Jan 26, 2013 10:57 |
|
This is exactly why the use of null in place of a collection should be loving banned. There's really no reason that you can't just return an empty collection instead, which would really clean up a lot of the code that deals with that poo poo. If you want to force the caller to deal with something, throw an exception. If you want the caller to be able to write clean and obvious code yet still work correctly, return an empty collection. If you want the worst of both worlds, be an idiot and return null.
|
# ? Jan 26, 2013 11:35 |
|
Zombywuf posted:I don't think you meant to use the word effective.
|
# ? Jan 26, 2013 17:41 |
|
Doctor w-rw-rw- posted:People who write bad code should be handled by adults, not tried and convicted by immature manchildren. God drat. I'm being super lame by posting this but I was being facetious. I've worked with and rehabilitated people responsible for far worse things. But more posting bad code, less talking about bad coders.
|
# ? Jan 26, 2013 18:11 |
|
Rocko Bonaparte posted:Seriously, what the flying gently caress? Don't deal with hardware too much? This is pretty par for the course - EEs as a group are horrible programmers that think themselves smarter than "lowly CS majors". They then proceed to do everything at the lowest level possible and in the worst possible way.
|
# ? Jan 26, 2013 18:12 |
|
hobbesmaster posted:Don't deal with hardware too much? This is pretty par for the course - EEs as a group are horrible programmers that think themselves smarter than "lowly CS majors". They then proceed to do everything at the lowest level possible and in the worst possible way. EEs code is generally either sad or depressing, but in my experience this isn't why. There are a lot of people out there who graduated in the late 80s or early 90s who drank a full pitcher of the contemporary OO kool-aid who wind up trying to implement something like GObject on an AVR or PIC. Imagine Martin Fowler stamping on a human face, forever.
|
# ? Jan 26, 2013 18:23 |
|
(and of course there are the far more common EEs who aren't working at too high or low a level of abstraction, but rather are just not experienced with coding and thus write really repetitive code with obvious mistakes, but who think this must be a reasonable way to write programs because hey we got it to mostly work the last three times! This is a common pattern in production support people who get roped into writing some automation or calibration software as well, although they have the added bonus of Visual Basic inspired horrors)
|
# ? Jan 26, 2013 18:27 |
|
hobbesmaster posted:Don't deal with hardware too much? This is pretty par for the course - EEs as a group are horrible programmers that think themselves smarter than "lowly CS majors". They then proceed to do everything at the lowest level possible and in the worst possible way. A lot of my experience with contemporary electrical engineers is that they took a course on something usually involving C and maybe scientific applications. They never learned data structures, or any structure at all for that matter. So they think that is all that programming is, and they think that all programming languages are C. How this manifests can vary. Some of them do look down upon "software people" as if those people just took that same programming course over and over in college or something. Others are not full of themselves, but aren't interested in improving either, so you get "works on my machine" galore. Then there are some others that are generally interested in improving and work towards it.
|
# ? Jan 26, 2013 18:47 |
|
Otto Skorzeny posted:Ask tef Bad code is a trigger for zombywuf. you guys need to be more patient with people who are obviously traumatised.
|
# ? Jan 26, 2013 19:11 |
|
There is a difference between making fun of anonymous code snippets in a small forum, and linking to someone's github and saying "this is exactly what is wrong with javascript". At least when Torvalds is an rear end in a top hat, it is normally in reply to something directed at him. On the other hand, waking up to find a couple of thousand people arguing about the merits of a small script you wrote, often on trivialities, is a bit of a shock.
|
# ? Jan 26, 2013 19:14 |
|
Ithaqua posted:In my experience, the Ruby world has a very high concentration of pretentious pricks. I don't know if this is true but ruby seems to have much more of a celebrity coder environment. I haven't found a correlation between dickheadedness and choice of language myself, but I don't know of any other language community that seems to run on so much drama fuel. http://www.rubydramas.com tef fucked around with this message at 19:22 on Jan 26, 2013 |
# ? Jan 26, 2013 19:18 |
|
quote:As for why, well anything that lessens the chance I will ever see this code in prod is good by me. I don't think making fun of random github code in a driveby fashion is a reasonable use of celebrity fuelled attention. It's a kinda vapid circlejerk. It doesn't seem to have any correlation between their code and your production environment. quote:Maybe eventually I'll quit smoking and drinking so much. Maybe if some of the Gnome or MySQL devs posted whines about all the people being mean about their code they'd write less of it and I could sleep better at night. If the thought of other people writing code keeps you awake at night, smoking and drinking aren't going to help.
|
# ? Jan 26, 2013 19:21 |
|
I blame the huge influx of young developers to Ruby from the "create a blog in 15 minutes with rails" screencast from 2007 (i think).
|
# ? Jan 26, 2013 19:23 |
|
Otto Skorzeny posted:I blame the huge influx of young developers to Ruby from the "create a blog in 15 minutes with rails" screencast from 2007 (i think). That and it inherited a whole bunch of zealots from perl too.
|
# ? Jan 26, 2013 19:29 |
|
Otto Skorzeny posted:I blame the huge influx of young developers to Ruby from the "create a blog in 15 minutes with rails" screencast from 2007 (i think). scaffolding!
|
# ? Jan 26, 2013 19:32 |
|
My favorite thing was the followup with plone http://oodt.jpl.nasa.gov/better-web-app.mov Where it discussed making a random CMS with various frameworks and then they figure out that hey, when you use this already-built CMS, it's super fast! edit: youtube https://www.youtube.com/watch?v=DWODIO6aCUE Suspicious Dish fucked around with this message at 19:47 on Jan 26, 2013 |
# ? Jan 26, 2013 19:35 |
|
tef posted:That and it inherited a whole bunch of zealots from perl too. I don't know how many perl zealots went to ruby as opposed to normal perl users, but Perl certainly had similar problems in the mid to late 90s, and is dealing with their fallout still. These started with Matt Wright problems and evolved into Matt Trout problems.
|
# ? Jan 26, 2013 19:42 |
|
"We're all fuckheads sometimes. Cut the other fuckhead a little slack, willya?" Amen.
|
# ? Jan 26, 2013 19:47 |
|
Yeah, this is why I shouldn't drink so much. But you know you could have linked to the terrible code I've put on github or something. But hey, if people's appearance is the best you can do well that's just precious.
|
# ? Jan 26, 2013 20:46 |
|
http://nsaunders.wordpress.com/2012/10/22/gene-name-errors-and-excel-lessons-not-learned/ Gene names such as MAR1, DEC1, OCT4 and SEPT9 are now reformatted as dates.
|
# ? Jan 27, 2013 13:43 |
|
tef posted:http://nsaunders.wordpress.com/2012/10/22/gene-name-errors-and-excel-lessons-not-learned/ Damnit Joel.
|
# ? Jan 27, 2013 15:06 |
|
Bunny Cuddlin posted:Seriously? I didn't even realize this person was a woman until I read this post. What does this have to do with gender? The original mocking was stupid anti-Node tribalism. On the other hand, the social justice lectures resulting from it are ridiculous and amplified because the author is female. No software developer should put code on Github if they're going to weep uncontrollably when someone is mean on Twitter. Such a developer should get a grip, for God's sake. Toady fucked around with this message at 01:30 on Jan 28, 2013 |
# ? Jan 27, 2013 23:40 |
|
Zombywuf posted:Yeah, this is why I shouldn't drink so much. But you know you could have linked to the terrible code I've put on github or something. But hey, if people's appearance is the best you can do well that's just precious. I dunno man, making fun of someone on a personal level because of their code seems just as justifiable to me as making fun of them because of their lack of care toward their physical appearance. Seriously man, groom yourself, you're an example of everything that's wrong with software developers.</s> That is to say when you see bad code you should critique the code, not the person. Every single one of us has written bad code, whether out of sheer ignorance, out of resource constraints, or because a quick and dirty hack was all there was time for. That doesn't make us terrible people.
|
# ? Jan 28, 2013 00:06 |
|
|
# ? Jun 8, 2024 05:48 |
|
look at this codeC code:
Pardot fucked around with this message at 06:11 on Jan 29, 2013 |
# ? Jan 28, 2013 00:13 |