|
Pollyanna posted:I just found out that the bioinformatics intro class I'm taking online will be primarily using Perl. I'd be concerned if it was PHP. Perl isn't a horrible language. Edit: at least not enough to go "oh god " Volmarias fucked around with this message at 13:04 on Sep 19, 2013 |
# ? Sep 19, 2013 13:01 |
|
|
# ? May 21, 2024 08:08 |
|
Volmarias posted:Perl isn't a horrible language. It's true. Kind of like my dog never throws his cat litter across the floor.
|
# ? Sep 19, 2013 13:04 |
|
Yeah, my previous employer (a genomics lab) was actually a Perl shop, although we designed our stuff in the same way you'd write any modern software project, and we had unit tests, CI, and modern version control. Basically, we wrote Perl because that's what the analysts in the lab, downstream of our software, who wrote the academic papers used. That being said: every day that I don't have to write Perl anymore is a day that the sun is a little brighter, the grass is a little greener, and my kid smiles a little more than the day before.
|
# ? Sep 19, 2013 14:48 |
|
I can't post any examples, but a common practice in my current workplace is to just comment or #if/#endif out old, incorrect or dead code instead of just deleting it. And since this product has been in development for 15+ years, we have some files that are tens of thousands of lines long, where a giant fuckoff long block in the middle of the file might be #if 0'd out, but there's no easy way to tell when you are just scanning the file. And yes we use source control, but no one here understands how to properly use it
|
# ? Sep 19, 2013 16:08 |
|
astr0man posted:I can't post any examples, but a common practice in my current workplace is to just comment or #if/#endif out old, incorrect or dead code instead of just deleting it. And since this product has been in development for 15+ years, we have some files that are tens of thousands of lines long, where a giant fuckoff long block in the middle of the file might be #if 0'd out, but there's no easy way to tell when you are just scanning the file. And yes we use source control, but no one here understands how to properly use it Holy hell, delete it all. I'm sure no one needs 99% of it, and if they do they should learn how to utilize source control.
|
# ? Sep 19, 2013 16:14 |
|
Yeah, I delete poo poo like that when I come across it. But I guess part of the problem is that we use Oracle's proprietary internal source control which is sort of like clearcase except that it's not clearcase (but is still just as terrible as clearcase) .
|
# ? Sep 19, 2013 16:18 |
|
I think (it's been a while since I used it) that Visual Studio will mark inaccessible blocks from defs like comments, so that might make it easier to find. And as far as Perl, I write it every day as the backend to some Web pages. The only thing that drives me nuts is that there is no debugger, and printing variables out isn't practical in all contexts. Oh, and piss poor (read: practically no) IDE support.
|
# ? Sep 19, 2013 16:57 |
|
How could it know though? There's nothing to prevent someone passing -DFOO on the command line.
|
# ? Sep 19, 2013 17:19 |
|
It marks the ones it knows about, which should be all of them as long as you do things The Visual Studio Way (preprocessor definitions should be specified in the configuration properties). What's a command line?
|
# ? Sep 19, 2013 17:37 |
|
JavaScript code:
|
# ? Sep 19, 2013 17:59 |
|
ManlyWeevil posted:And as far as Perl, I write it every day as the backend to some Web pages. The only thing that drives me nuts is that there is no debugger, and printing variables out isn't practical in all contexts. Oh, and piss poor (read: practically no) IDE support. There totally is a Perl debugger, although it gets hairier if you're trying to remotely debug a script running on a server. ActiveState has some remote debugging hooks in Komodo IDE though so you can debug CGI or mod_perl, but that costs money. The downside to the Perl debugger is that the GUI to it is in TK, and it has this bug in the TK interaction where 10% of the time hitting "continue" will cause the thing to run away on you and ignore every breakpoint downstream.
|
# ? Sep 19, 2013 18:10 |
|
EntranceJew posted:
Can't even tell if it's lovely use of texting abbreviations in code or just terrible spelling or a mixture of both or something worse.
|
# ? Sep 19, 2013 18:20 |
|
kitten smoothie posted:There totally is a Perl debugger, although it gets hairier if you're trying to remotely debug a script running on a server. ActiveState has some remote debugging hooks in Komodo IDE though so you can debug CGI or mod_perl, but that costs money. I haven't perl'd for closing in on ten years but I remember making heavy use out of some kind of text mode debugger.
|
# ? Sep 19, 2013 18:30 |
|
And if bioinformatics is anything like any of the other scientific code out there in the world, perl'll be the least of your problems. (I think it was the forums poster who got renamed 'dognostic' worked on a bioinformatics research team and made conclusions about science and programming and the nature of the universe from that experience).
|
# ? Sep 19, 2013 18:33 |
|
fritz posted:And if bioinformatics is anything like any of the other scientific code out there in the world, perl'll be the least of your problems. Perl isn't a bad language if you consider the inventor and the purpose for which he originally wrote it. If I had one complaint about Perl, it would be that so many people for a while seemed to want to do things for which it wasn't really designed. Amazingly, parsing DNA strings fits well into what Perl does well. Coding horror of the day: Everyone is supposed to use Eclipse and use the officially blessed set of preferences. What do these preferences contain? Spaces up, tabs down. Thanks. I didn't like being able to set my tab stops. I know Eclipses code formatter for Java is kind of poo poo in that the tab stop length fucks with the maximum line length.
|
# ? Sep 19, 2013 19:45 |
|
I just fixed a bug in one of our websites where a user with a corrupted cookie would cause a very slow stack overflow. To determine who was logged in, the security code was checking the session for an auth variable. If not found, it would check for a valid encrypted auth cookie then set the session variable (e.g. refresh the login). If the auth key was un-encryptable for any reason, the security layer would throw an exception which was caught and logged. The logger, however, calls to the security layer to check who is logged in, which would then throw an exception... ad infinitum. The crash would take like 5 minutes to happen since each exception was wrapped in a try/catch which significantly slowed down the loop. It was a particularly bad security bug, because all an attacker has to do is screw with their auth cookie and the whole site slowly crashes.
|
# ? Sep 19, 2013 20:00 |
|
HFX posted:Spaces up, tabs down. What does this mean? Is this some technical language I haven't encountered before, or is it just your idiosyncratic way of saying your standard mandates spaces and not tabs BTW let's not take this anywhere we don't want to go.
|
# ? Sep 19, 2013 21:15 |
|
No Safe Word posted:Can't even tell if it's lovely use of texting abbreviations in code or just terrible spelling or a mixture of both or something worse. I think it's just a failure to grasp the English language -- which means the code they write using primarily English keywords will be very good and undoubtedly decorated with comprehensive comments.
|
# ? Sep 19, 2013 21:45 |
|
Hammerite posted:What does this mean? Is this some technical language I haven't encountered before, or is it just your idiosyncratic way of saying your standard mandates spaces and not tabs Tabs down, spaces up, that's the way we indent stuff
|
# ? Sep 19, 2013 22:33 |
|
yaoi prophet posted:Tabs down, spaces up, that's the way we indent stuff Great idea; too bad it only lines up properly as "space down, tabs up" (which is really the wrong way around). Ah gently caress it, cue brodustrial https://www.youtube.com/watch?v=WouR3mwIHNk
|
# ? Sep 19, 2013 22:40 |
|
IMlemon posted:
mixed 5 and 7 space indent???? e: ahhh and the brackets don't even line up to the correct outer-indent
|
# ? Sep 19, 2013 22:51 |
|
code:
|
# ? Sep 20, 2013 01:45 |
|
I spent the better part of 3 hours today rewriting a PHP script that queried inventory levels from different stores to display them. The entire piece of software is PHP and html smashed together with no way to modifying the template without diving into all of the business logic. I had to clean up one of these abominations: code:
Each of the 4 while loops above was spitting out HTML too. HTML with <font> tags!
|
# ? Sep 20, 2013 03:34 |
|
EntranceJew posted:I think it's just a failure to grasp the English language -- which means the code they write using primarily English keywords will be very good and undoubtedly decorated with comprehensive comments. I immediately saw the genius in this. code:
Pythagoras a trois fucked around with this message at 03:41 on Sep 20, 2013 |
# ? Sep 20, 2013 03:35 |
|
Cheekio posted:I immediately saw the genius in this. It could be cant won't or don't.
|
# ? Sep 20, 2013 06:38 |
|
fritz posted:It could be cant won't or don't. Or "shouldn't".
|
# ? Sep 20, 2013 09:29 |
|
It could have been, but it n't.
|
# ? Sep 20, 2013 15:01 |
|
fritz posted:I haven't perl'd for closing in on ten years but I remember making heavy use out of some kind of text mode debugger.
|
# ? Sep 20, 2013 18:03 |
|
So our codebase is (still) full good ol' $result = mysql_query($query) code. Maybe about a year ago I decided that at least I shouldn't add to it and looked at the options and saw mysqli and pdo. I chose mysqli. So yesterday I got fed up with writing so much god drat boilerplate and I actually looked up pdo. Why the hell didn't I choose pdo in the first place?
|
# ? Sep 22, 2013 23:25 |
|
Wheany posted:So our codebase is (still) full good ol' $result = mysql_query($query) code. Maybe about a year ago I decided that at least I shouldn't add to it and looked at the options and saw mysqli and pdo. I chose mysqli. So yesterday I got fed up with writing so much god drat boilerplate and I actually looked up pdo. I prefer PDO, but having used both I never found that much difference in the amount of boilerplate?
|
# ? Sep 23, 2013 01:29 |
|
fidel sarcastro posted:I prefer PDO, but having used both I never found that much difference in the amount of boilerplate? Well, if I just learned the bare minimum of mysqli and managed to use it in some particularly idiotic and verbose way, that's on topic as well.
|
# ? Sep 23, 2013 07:21 |
|
Wheany posted:Well, if I just learned the bare minimum of mysqli and managed to use it in some particularly idiotic and verbose way, that's on topic as well. It's definitely more verbose, since you can't do things like pass an array of parameters to execute. I just don't remember wanting to tear my hair out last time I used it. PDO is absolutely the better choice, at any rate. jony neuemonic fucked around with this message at 12:16 on Sep 23, 2013 |
# ? Sep 23, 2013 12:11 |
|
So back in 2008, I was still pretty new to coding in general. I'd done a bunch of VB6 garbage and some .NET stuff by then I think; I was pretty big into C#. One day I found out about the magic of inline conditionals. Then I went ahead and did whatever the christ this is. I'm posting a pastebin for a reason - 568 chars, 27 left parentheses, 1 line. Included is my attempt to actually put it in proper C# syntax, sorta. 5 years later, I still have no idea how I wrote this. It actually works pretty well (!!) considering the rest of the project it's from. All this does is draw little falling peak indicators over the bars in a VU meter custom control. They fall faster near the top, which is, from what I remember, why the code is so confusing. That and apparently I was paranoid about the compiler getting the order of operations right on the math. That whole project was a train wreck, if you couldn't guess. Almost 20k lines (not including .cs libs I took from the internet) for a basic music player. I just searched Form1.cs (5k lines) for comments and there is one, ONE that is even remotely helpful. "//don't call this, it's broken" above a reimplementation of string.Contains(). All the rest are disabling code. I could probably open any of these .cs files and find something horrible within seconds. And there are PLENTY of cs files, oh yes, almost 50! Basically what happened is I tried to write an interface for Bass.NET and ended up with the plastic swiss army knife of music players. It does a whole ton of things, but none of them are very useful and most of them break easily. Want to change songs by sending arbitrary strings to a network port? You're in luck, my lovely player has a control server (which crashes if you send anything to it)! Media keys? Hell yeah, but only sometimes. Logitech G15 LCD support? Why not, let's add a 700 line function to handle that. Do you want a large spectrum analyzer dancing around on your desktop, wasting CPU cycles on basically nothing? Well it's got it! Lyrics search? Only if Songmeanings.net hasn't changed at all in 5 years! I have written some dodgy stuff intentionally before, but this whole project...
|
# ? Sep 23, 2013 13:19 |
|
That's adorable, it's like digging up an elaborate macaroni-and-glitter art project from when you were six years old
|
# ? Sep 23, 2013 15:15 |
|
fidel sarcastro posted:It's definitely more verbose, since you can't do things like pass an array of parameters to execute. I just don't remember wanting to tear my hair out last time I used it. There are about a billion little pdo libraries that makes working with arrays of parameters a cinch. Or you can write your own, your call.
|
# ? Sep 23, 2013 20:45 |
|
Is it seriously called pdo? Is it pronounced like pedo?
|
# ? Sep 23, 2013 22:19 |
|
return0 posted:Is it seriously called pdo? Is it pronounced like pedo? It never occurred to me to read it that way. I always assumed it was pronounced "pee dee oh".
|
# ? Sep 23, 2013 22:26 |
|
Hammerite posted:It never occurred to me to read it that way. I always assumed it was pronounced "pee dee oh". I thought that was what it probably was, but I am very juvenile.
|
# ? Sep 23, 2013 22:35 |
|
PHP Data Objects are no laughing matter, mister.
|
# ? Sep 23, 2013 23:33 |
|
|
# ? May 21, 2024 08:08 |
|
If we could not talk about poop dough that'd be great. puns are ok though
|
# ? Sep 24, 2013 03:49 |