|
Janin posted:I propose a new phrase "ozark bugs", meaning a bunch of errors which combine to mostly work. This is why I stopped fixing things. Subtly broken implementations get broken even more when you fix them.
|
# ? Jun 23, 2010 21:14 |
|
|
# ? May 14, 2024 10:24 |
|
Tikki posted:I think there might be some confusion, as to how the issue numbers are used. Do this: add a ticket sequence column into whatever table has the tickets. Then show him this Ticket.maximum(:sequence_number, :group => :event) Now force him to explain to him what the gently caress. If he says 'the old way is faster' then get him to benchmark it or some poo poo because gently caress. I've seen some stupid loving poo poo but goddamn.
|
# ? Jun 23, 2010 21:20 |
|
TRex EaterofCars posted:This is why I stopped fixing things. Subtly broken implementations get broken even more when you fix them. But that is 90% of the code I work on. When I recommend fixing them by fixing the design I'm told not to do it and just concentrate on getting the bug fix out for whatever looming deadline.
|
# ? Jun 23, 2010 21:38 |
|
Tikki posted:I think there might be some confusion, as to how the issue numbers are used.
|
# ? Jun 24, 2010 04:11 |
|
A guy I work with will take code like this:code:
code:
He also hates to use functions because "it makes the code too hard to follow."
|
# ? Jun 24, 2010 16:05 |
|
Don't you have some sort of standards wherever you work in which one of you (I'm assuming him, since I hate his style) is blatantly breaking a rule?
|
# ? Jun 24, 2010 16:40 |
|
Lysandus posted:A guy I work with will take code like this: Can I hand you a bat. Wack once a minute throughout the day until he quits.
|
# ? Jun 24, 2010 16:42 |
|
Lysandus posted:A guy I work with will take code like this: Does he have a background in LISP? Also rollback his commits and use as much harsh language as possible. That's just idiotic.
|
# ? Jun 24, 2010 17:04 |
|
Parantumaton posted:Does he have a background in LISP? A background in LISP would make him more likely to use functions, not less likely.
|
# ? Jun 24, 2010 17:39 |
|
Lysandus posted:He then commits it to the repository with the comment "Code cleanup."
|
# ? Jun 24, 2010 17:41 |
|
Parantumaton posted:Does he have a background in LISP?
|
# ? Jun 24, 2010 18:51 |
|
Dijkstracula posted:Given how much he wants to make the opening and closing braces as invisible as possible, Python was actually the first thing to come to mind. Unless he's never used Python/C, but in that case, why are you giving little kids commit privileges?
|
# ? Jun 24, 2010 19:52 |
|
He's gotten better at not doing that over the years, but he'll still complain about functions being hard to follow. He's actually pretty smart when it comes to some of the weird poo poo we need to figure out. Here is another gem I found in some old networking code we have: code:
|
# ? Jun 24, 2010 20:49 |
|
Orzo posted:Don't you have some sort of standards wherever you work in which one of you (I'm assuming him, since I hate his style) is blatantly breaking a rule? I'm my department yes, but he is in another department and they put up with it.
|
# ? Jun 24, 2010 20:51 |
|
Lysandus posted:He's gotten better at not doing that over the years, but he'll still complain about functions being hard to follow. He's actually pretty smart when it comes to some of the weird poo poo we need to figure out. Presumably they were going to add a way of changing useHTTPS later? That's not a colossal horror if so.
|
# ? Jun 24, 2010 20:54 |
|
Jonnty posted:Presumably they were going to add a way of changing useHTTPS later? That's not a colossal horror if so. I would hope, but by the time I inherited the code it was already 2 years old and the original programmer was long gone. I ended up rewriting most of the networking library anyway.
|
# ? Jun 24, 2010 20:57 |
|
Found in the Cisco AXL documentation:code:
At least I'm pretty sure it's auto-generated
|
# ? Jun 24, 2010 22:01 |
|
Kilson posted:Found in the Cisco AXL documentation: code:
Fake edit: and also a code:
|
# ? Jun 24, 2010 22:51 |
|
It's SQL and not 'code' per se but I just wacked this query together for a onetimer to get a series of strings I needed:code:
|
# ? Jun 24, 2010 23:46 |
|
code:
|
# ? Jun 25, 2010 10:59 |
|
C# 3.5, so we can't have nice things like named and optional parameters. That still doesn't excuse this: code:
edit: oh, and there are a ton of these. Dessert Rose fucked around with this message at 16:56 on Jun 29, 2010 |
# ? Jun 29, 2010 15:53 |
|
Ryouga Inverse posted:C# 3.5, so we can't have nice things like named and optional parameters. I was going to say that switch statement looks like it belongs in a for loop, but holy poo poo I think that version may actually be worse.
|
# ? Jun 29, 2010 18:43 |
|
I'm guessing cases don't fall through in C#? They eliminated that from C/C++, but kept goto statements?
|
# ? Jun 29, 2010 20:42 |
|
mr_jim posted:I'm guessing cases don't fall through in C#? They eliminated that from C/C++, but kept goto statements? Correct, a case falling through is a compile error in C#. edit: except empty cases, yeah, to provide for the pattern where you want multiple cases to have the same behavior. You can't eliminate goto, that would just be stupid. This is technically the "accepted" way to make cases fall through in C#, and the fact that you are using goto to do it is supposed to make you stop and go "Hmm, maybe I shouldn't be doing this."
|
# ? Jun 29, 2010 20:46 |
|
Only empty cases do.
|
# ? Jun 29, 2010 20:46 |
|
Tikki posted:The table only contains the numbers, it's (apparently) the fastest way of checking if an issue number is already taken. Maybe I'm really tired or something, so forgive me for asking what might be blatantly obvious but... why couldn't you just use an honest-to-God SQL SEQUENCE here? Set its starting value to whatever the current maximum value of the existing issue numbers (or 0 or 1 or whatever if you're starting from scratch) and from that point on pull the next value from the SEQUENCE. I mean, that's why they have SEQUENCEs in the SQL standard these days to begin with -- to provide a method of generating values in a safe manner, concurrent access and all. Of course, if you're on MySQL you'd have to resort to hacks to make up for the lack of SEQUENCEs but still, it's often better knowing ahead of time that a value will be guaranteed to be unique than it is to have to check for uniqueness after the fact...
|
# ? Jun 30, 2010 06:26 |
|
dark_panda posted:Maybe I'm really tired or something, so forgive me for asking what might be blatantly obvious but... why couldn't you just use an honest-to-God SQL SEQUENCE here? Set its starting value to whatever the current maximum value of the existing issue numbers (or 0 or 1 or whatever if you're starting from scratch) and from that point on pull the next value from the SEQUENCE. I mean, that's why they have SEQUENCEs in the SQL standard these days to begin with -- to provide a method of generating values in a safe manner, concurrent access and all. MySQL still doesn't support sequencing on either of its engines? I'm doing
|
# ? Jun 30, 2010 15:26 |
|
HFX posted:MySQL still doesn't support sequencing on either of its engines? I'm doing Yea well they are trying their hardest to eliminate it as a viable database now that oracle bought it they dont do anything useful with it now.
|
# ? Jun 30, 2010 18:21 |
|
Sprawl posted:Yea well they are trying their hardest to eliminate it as a viable database now that oracle bought it they dont do anything useful with it now. Oracle owns MySQL now? When did that happen and why didn't I notice?
|
# ? Jun 30, 2010 20:58 |
|
Tikki posted:Oracle owns MySQL now? MySQL was already becoming marginalized from being owned by Sun, then Oracle acquired Sun last year without calling a lot of attention to the MySQL situation.
|
# ? Jun 30, 2010 21:01 |
|
Lysandus posted:A guy I work with will take code like this: My profs and TAs would had us a bunch of code to work with that was written in this style, back asswards, which is how I quickly learned to just re-write it all myself because I'd just be sitting there editing the old code for hours so I could read it and figure out what they were trying to do.
|
# ? Jun 30, 2010 23:23 |
|
Preparation H67 posted:My profs and TAs would had us a bunch of code to work with that was written in this style, back asswards, which is how I quickly learned to just re-write it all myself because I'd just be sitting there editing the old code for hours so I could read it and figure out what they were trying to do.
|
# ? Jun 30, 2010 23:57 |
|
A A 2 3 5 8 K posted:MySQL was already becoming marginalized from being owned by Sun, then Oracle acquired Sun last year without calling a lot of attention to the MySQL situation. Except that the homo who wrote MySql decided to try and get the EU to stop the deal because his database is a special snowflake that deserves to live. We should loving nuke sweden.
|
# ? Jul 1, 2010 00:04 |
|
Preparation H67 posted:My profs and TAs would had us a bunch of code to work with that was written in this style, back asswards, which is how I quickly learned to just re-write it all myself because I'd just be sitting there editing the old code for hours so I could read it and figure out what they were trying to do. I think this style originally shows up programming books just to save paper and shorten long code examples. I've never seen a closing brace like that but I've seen a lot of books that use an opening brace on the same line. Unfortunately some idiots actually take it as good form and use it where it has no business being.
|
# ? Jul 1, 2010 00:05 |
|
I think OpenSolaris deserves to live, probably.
|
# ? Jul 1, 2010 00:05 |
|
Section 1.4.4.6: Wherein we learn why referential integrity is actually badquote:There are so many problems with foreign key constraints that we don't know where to start:
|
# ? Jul 1, 2010 03:31 |
|
Ryouga Inverse posted:You can't eliminate goto, that would just be stupid. This is technically the "accepted" way to make cases fall through in C#, and the fact that you are using goto to do it is supposed to make you stop and go "Hmm, maybe I shouldn't be doing this." Janin posted:http://www.gnu.org/software/indent/ Shumagorath fucked around with this message at 05:08 on Jul 1, 2010 |
# ? Jul 1, 2010 05:05 |
|
A A 2 3 5 8 K posted:MySQL was already becoming marginalized from being owned by Sun, then Oracle acquired Sun last year without calling a lot of attention to the MySQL situation. I'm beginning to suspect that, in thirty years, the only software companies left will be Microsoft and Oracle. 1337JiveTurkey posted:Section 1.4.4.6: Wherein we learn why referential integrity is actually bad Precautions against data orphaning aside, anyone who advocates against foreign keys has never had to programmatically traverse their data model. Bunch of morons. To contribute: Too often, in older scripts at where I work, I'll see this in scripts called by headless backend scripts: code:
|
# ? Jul 1, 2010 05:19 |
|
We got a new guy who's interning here until he finishes his degree. When he was sent to my department I asked him what his java experience was and he replied "Pretty extensive. I've have had 4 classes now on Java." After the usual training B.S. I let him start fixing some bugs and gave him an easy one to start with. I even told him how to fix it by extending ClassA and override MethodA, etc. Six hours later he commits the changes which included copy and pasting ClassA to a new file calling it ClassB and changing some code in MethodA because he couldn't figure out he needed to remove "final" from ClassA. Apparently they save the final keyword for the 5th java class.
|
# ? Jul 1, 2010 16:01 |
|
|
# ? May 14, 2024 10:24 |
|
The way you describe it, your way of "fixing" things sounds like a coding horror in itself. Class A has a bug, so fix it by quietly removing 'final' and extending with a class that has the bug fixed?
|
# ? Jul 1, 2010 16:12 |