|
thel posted:
|
# ? Jul 5, 2011 02:28 |
|
|
# ? Apr 26, 2024 06:59 |
|
tef posted:is it wrong to want a version of awk that handles xpath
|
# ? Jul 5, 2011 17:20 |
|
tef posted:is it wrong to want a version of awk that handles xpath I keep telling you man, XQuery. Of course there's no good command line version. :-(
|
# ? Jul 5, 2011 20:33 |
|
tef posted:is it wrong to want a version of awk that handles xpath Not xml, but check this out http://code.google.com/p/spawk/ I can only imagine that fantastic scripts you could make with this.
|
# ? Jul 5, 2011 21:44 |
|
Wow, if only that worked with Postgres, it probably would've been perfect for something that I just did for work (with the one true awk).
|
# ? Jul 5, 2011 22:19 |
|
I cant really post the code that makes me cry... its a single "small" java class, part of a bean for an article on a website. 15448 lines long, 113 lines of import statements, and where i worked, only the senior devs were allowed to make changes in case anyone else broke it. the next largest class was a paltry 5000 lines (and it was extended from this one) /me sits down and weeps some more at the inhumanity of the class... oh and this is a key part of a live website needing low latency
|
# ? Jul 6, 2011 10:29 |
|
Putting an article on a web site has always been one of the hardest problems to solve in computer science.
|
# ? Jul 6, 2011 13:50 |
|
A A 2 3 5 8 K posted:Putting an article on a web site has always been one of the hardest problems to solve in computer science.
|
# ? Jul 6, 2011 14:06 |
|
I found this today.code:
|
# ? Jul 6, 2011 21:28 |
|
Lysandus posted:Nothing identifying around it. Just that. I'm convinced there's a whole subset of programmers that do this kind of thing just to gently caress with you. Gotta say though, after reading this thread, I'm convinced something like this would be more par for the course: code:
|
# ? Jul 6, 2011 22:19 |
|
code:
|
# ? Jul 6, 2011 22:58 |
|
benitocereno posted:I'm convinced there's a whole subset of programmers that do this kind of thing just to gently caress with you. Maybe it's a canary. When you see one you're supposed to figure out who wrote it, ask them what the hell they were doing, and they say "ahh, you've actually read the code! Excellent!"
|
# ? Jul 6, 2011 23:17 |
|
TheresaJayne posted:I cant really post the code that makes me cry... 15888 lines, 230 imports
|
# ? Jul 7, 2011 01:58 |
|
Ensign Expendable posted:
You're not thinking code:
|
# ? Jul 7, 2011 03:09 |
|
You forgot to account for the case where the boolean is both true and false. This is affecting production.
|
# ? Jul 7, 2011 03:17 |
|
Ensign Expendable posted:
|
# ? Jul 7, 2011 03:22 |
|
It took me ages to understand why !Boolean.toString(bool).length()==5; was relevant. I think that's a good thing? As for Thel's code... . Going to be honest here, whenever I write a really bad piece of code I at least try to make the comments entertaining. Why throw such a boring error when you can insult the person responsible for breaking it?
|
# ? Jul 7, 2011 03:23 |
|
Ensign Expendable posted:You forgot to account for the case where the boolean is both true and false. This is affecting production. Ah but I did, it would throw an InvalidArgumentException ... I think. (If anyone actually has a system with true-and-false booleans, then I'm a bit scared.)
|
# ? Jul 7, 2011 03:33 |
|
perl six
|
# ? Jul 7, 2011 07:02 |
|
code:
|
# ? Jul 7, 2011 10:12 |
|
Thel posted:You're not thinking Is it good that I couldn't come up with nonsense like this even if I tried?
|
# ? Jul 7, 2011 10:14 |
|
Contra Duck posted:15888 lines, 230 imports if its called Article.java, say hi to the guys there and i see they added more stuff, did the GWT stuff go in then
|
# ? Jul 7, 2011 10:29 |
|
qntm posted:Is it good that I couldn't come up with nonsense like this even if I tried? Yes. I don't know what it says about me that I was able to improvise that in about five minutes. My thought process was basically "Enterprise, so let's throw in a redundant factory class. Hurf some completely ridiculous logic checks in there, some awful and useless exception throws, and we're good to go." e: Ironically, there's some accidental horrors in there too.
|
# ? Jul 7, 2011 11:13 |
|
This is the best part. People around me were poking their heads out of their cubes to see why I was laughing so hard.code:
|
# ? Jul 7, 2011 13:12 |
|
Wheany posted:
This is just someone who's not used to version control and/or wants the logic of those functions readily available for some reason.
|
# ? Jul 7, 2011 13:46 |
|
TheresaJayne posted:if its called Article.java, When I first saw your post I thought "Oh dear, that sounds awfully familiar", but no, mine is an entirely separate 15,000 line horror. There is a part of me that desperately wants to refactor this beast but the part of me that doesn't want to be responsible for it is overriding it.
|
# ? Jul 7, 2011 14:25 |
|
Factor Mystic posted:This is just someone who's not used to version control
|
# ? Jul 7, 2011 15:38 |
|
Ensign Expendable posted:
"ifTrue" and "ifFalse" are methods defined on the True and False classes. Smalltalk owns.
|
# ? Jul 7, 2011 15:59 |
|
Ensign Expendable posted:
I've seen almost that in real-world code. It was something like code:
|
# ? Jul 7, 2011 17:52 |
|
http://coding.smashingmagazine.com/2011/07/07/my-favorite-programming-mistakes/ Almost everything in there, including the advice given.
|
# ? Jul 7, 2011 17:59 |
|
My god, the advice he gives is awful. He enables debugging to the screen on production and his first piece of advice is "Avoid working late at night" instead of "Don't debug on loving production".
|
# ? Jul 7, 2011 18:50 |
|
MononcQc posted:http://coding.smashingmagazine.com/2011/07/07/my-favorite-programming-mistakes/ "Don’t reinvent the wheel, even very small wheels that look easy from the outside." "Don’t reinvent the time wheel either: strtotime is a powerful function." [implements stupid proprietary spam detection algorithm based on number of consonants in a row that leads to inevitable false positives that he fixes by considering "w" to be a vowel]
|
# ? Jul 7, 2011 19:36 |
|
benitocereno posted:I'm convinced there's a whole subset of programmers that do this kind of thing just to gently caress with you. Gotta say though, after reading this thread, I'm convinced something like this would be more par for the course: Am I missing something or will this always return false?
|
# ? Jul 7, 2011 19:41 |
|
MononcQc posted:http://coding.smashingmagazine.com/2011/07/07/my-favorite-programming-mistakes/ Hmm, learning by making mistakes is only good if you draw the right conclusions from the mistakes.
|
# ? Jul 7, 2011 19:43 |
|
poemdexter posted:Am I missing something or will this always return false? Except in the case where _true == FileNotFound
|
# ? Jul 7, 2011 20:30 |
|
poemdexter posted:Am I missing something or will this always return false? Why wouldn't you expect a function named isTrue passed a bool named _true to always return false? (no you're not missing anything) Sedro posted:Except in the case where _true == FileNotFound Sorry, to handle that I think you need an enterprise solution.
|
# ? Jul 7, 2011 22:09 |
|
I was going to do a FizzBuzz using Rx, but Rx is a little funky. So I thought I'd see how much I could abuse the language instead. The below code works. You wouldn't expect it to, but the first call to GetAction is with a value of 1, and not 0 as you would initially intuit.code:
|
# ? Jul 8, 2011 00:20 |
|
minato posted:My god, the advice he gives is awful. He enables debugging to the screen on production and his first piece of advice is "Avoid working late at night" instead of "Don't debug on loving production". Actually, not working late is good advice that a lot of agile shops get great results codifying. And he probably assumed that people could tell that, when he's telling the Horrific Tale of Debug Enabled In Production, enabling debug in production is a bad thing. The article as a whole is pretty sad, though
|
# ? Jul 8, 2011 00:20 |
|
MononcQc posted:http://coding.smashingmagazine.com/2011/07/07/my-favorite-programming-mistakes/ quote:Paul Tero is an experienced PHP programmer
|
# ? Jul 8, 2011 01:52 |
|
|
# ? Apr 26, 2024 06:59 |
|
Milotic posted:but the first call to GetAction is with a value of 1, and not 0 as you would initially intuit. It's the whole lambda scoping thing. Lambdas close over variables, not values.
|
# ? Jul 8, 2011 04:02 |