|
MrBishop posted:I'd punch someone in the face if I had to maintain that. It's the code equivalent of, "Everything's ok...... NOT!!". If everything is ok on opposite day, do this:
|
# ? Oct 2, 2009 15:21 |
|
|
# ? May 13, 2024 21:41 |
|
Flobbster posted:I don't know how good VB (compile) --> MSIL (decompile) --> C# would look It still looks pretty good except for a few small problems like certain features of VB causing implicit declarations that got (maybe still get?) turned into stuff like $12AB = something; that doesn't compile if you just paste it into a code file because of the $. I was in charge of obfuscating the build at the place I used to work and most obfuscaters I tried did a passable job of mangling the logic, but would usually gently caress up namespace resolution to produce code that crashed all over the place unless you excluded huge chunks of your project from obfuscation
|
# ? Oct 2, 2009 19:22 |
|
Munkeymon posted:I was in charge of obfuscating the build at the place I used to work
|
# ? Oct 2, 2009 19:57 |
|
Nigglypuff posted:this is an irl job that people have This would be the best job in the world.
|
# ? Oct 2, 2009 20:06 |
|
code:
|
# ? Oct 2, 2009 20:13 |
|
Nigglypuff posted:this is an irl job that people have I was in charge of making an obfuscated build because I was in charge of the build because I was in charge of continuous integration. Obfuscation wasn't supposed to be a big deal because you're just supposed to be able to point the product we were using at the assemblies and tell it to go nuts, but it took days of tweaking settings in the obfuscater to get the obfuscated assemblies to not crash on startup. I never did get a fully functional, obfuscated build made while I was there. No, it was not fun. I think the product was Object Blender or something? The SmartAssembly demo worked on the first try, but he had already bought the other piece of poo poo as a bundle with some pre-made Vista-like UI controls from the same company.
|
# ? Oct 2, 2009 21:00 |
|
Fenderbender posted:
That's adorable
|
# ? Oct 2, 2009 21:09 |
|
rt4 posted:What's this thing supposed to do? It's supposed to report on grad school application and acceptance statistics based on nearly every field of data imaginable. The previous programmer created them based on each departments needs, and I have decided it best to create a "general solution" that can be tailored through the UI by the departments, instead of requiring me to figure out what the hell this code is doing(wrong). The copy/paste sequence that got it posted here may well have screwed up/pasted over itself at some point...my computer noticeably slowed down when I sent the whole query through jabber on Meebo... And no, I don't like the database any better, but at least I understand it.
|
# ? Oct 2, 2009 21:21 |
|
MrBishop posted:I'd punch someone in the face if I had to maintain that. It's the code equivalent of, "Everything's ok...... NOT!!". Wait. Is it? It's stupid and unclear, but it looks like it would work like it's supposed to. It should definitely be written 'status != OK,' but it's not throwing the error if the status is OK unless there's something I'm missing. If the status is not OK then it returns a false on the check, inverts it to a true, and posts the "not OK." error. If the status is OK then it returns a true on the check, inverts it to a false, and skips the error message. ErIog fucked around with this message at 23:17 on Oct 2, 2009 |
# ? Oct 2, 2009 23:14 |
|
ErIog posted:Wait. Is it? He's not saying it's wrong, programatically. He's saying that it reads like what he said; It's the coding equivalent of "Everything's ok... NOT!" It's rear end backwards for no reason, and quickly looking over the code is confusing. code:
|
# ? Oct 2, 2009 23:22 |
|
Munkeymon posted:I was in charge of obfuscating the build Well I hope this thread has taught you that it's far cheaper and far more effective to simply hire worse programmers.
|
# ? Oct 2, 2009 23:36 |
|
Fenderbender posted:
|
# ? Oct 3, 2009 15:42 |
|
Inverse Icarus posted:He's not saying it's wrong, programatically. He's saying that it reads like what he said; It's the coding equivalent of "Everything's ok... NOT!" MrBishop fucked around with this message at 18:14 on Oct 3, 2009 |
# ? Oct 3, 2009 18:11 |
|
MrBishop posted:This is exactly it. Most of the horrors I run across aren't bugs, they're just things that leave me asking wtf. Yesterday's, for example: My coworker wanted to return the number of items that had been processed in a method (in a C# project). Instead of just keeping a count as he iterated through the list of items (or, you know, just call list.Count), he decided to query the database to count the inserted records. Sound like a race bug in waiting to me.
|
# ? Oct 3, 2009 20:27 |
|
As a former horror coder, I think I can explain the faulty reasoning of not keeping a count during the loop. Novice coders can find the logic of iterations confusing, and can be paranoid of off by one errors. Instead of thinking through the iterating code properly, they look to some outside way of keeping track because they don't trust their own code. I can't really blame them, but they tend not to do even that part properly. I had a hell of a time wrapping my head around the proper for loop in the case of iterating over a sequence in C. Thankfully, I program mostly in Python now where I don't have to think about it. I can do it in C, but it takes me a few extra seconds to think about what I'm doing. ErIog fucked around with this message at 21:39 on Oct 3, 2009 |
# ? Oct 3, 2009 21:36 |
|
ErIog posted:As a former horror coder, I think I can explain the faulty reasoning of not keeping a count during the loop. Novice coders can find the logic of iterations confusing, and can be paranoid of off by one errors. Instead of thinking through the iterating code properly, they look to some outside way of keeping track because they don't trust their own code. The best way to fix off-by-one errors is to just randomly change loop conditions until it stops crashing. P.S. anyone hiring?
|
# ? Oct 4, 2009 16:01 |
|
ColdPie posted:The best way to fix off-by-one errors is to just randomly change loop conditions until it stops crashing. No, the correct way is to just never use arrays. Instead of declaring an array like a[10], declare separate variables a0, a1, ..., a9 and unroll the loop. Then, if you ever mess up your bounds and do something like a10, it gets flagged at compile time as an error.
|
# ? Oct 4, 2009 16:13 |
|
The correct way to fix crashes caused off-by-one errors in loops involving arrays is to make every array one element larger than it needs to be This advice was in Code Complete, so you know it's good
|
# ? Oct 4, 2009 20:05 |
|
Who the hell still has problems with off by one errors in loops and still work in the industry?
|
# ? Oct 4, 2009 21:30 |
|
Can't you just do a foreach or use the array length as a variable when iterating?
|
# ? Oct 4, 2009 21:57 |
|
Ensign Expendable posted:Can't you just do a foreach or use the array length as a variable when iterating? Not every language has foreach and using the array length doesn't prevent you from doing something like for(int i = 1; i <= arraylength; i++) in C++ because you're retarded and don't know/think about the fact that C/C++ arrays are indexed from 0 to n-1. edit: vvvvv sorry, I got lost in the comment above about being a "former horror coder" and "being able to do it in C but it takes a second to think" vvvv TheSleeper fucked around with this message at 08:25 on Oct 5, 2009 |
# ? Oct 4, 2009 22:16 |
|
The context for this was originally C#
|
# ? Oct 4, 2009 22:20 |
|
RussianManiac posted:Who the hell still has problems with off by one errors in loops and still work in the industry? In my last job the 'big boss' checked in a piece of code that was k<=30 instead of k<30 and caused some 3rd-level damage. That one was fun to track down.
|
# ? Oct 4, 2009 22:25 |
|
UraniumAnchor posted:In my last job the 'big boss' checked in a piece of code that was k<=30 instead of k<30 and caused some 3rd-level damage. That one was fun to track down. Does the 'big boss' not like to have other engineers review his changes before committing?
|
# ? Oct 4, 2009 23:03 |
|
UraniumAnchor posted:In my last job the 'big boss' checked in a piece of code that was k<=30 instead of k<30 and caused some 3rd-level damage. That one was fun to track down. What exactly does '3rd-level damage' mean?
|
# ? Oct 4, 2009 23:04 |
|
yaoi prophet posted:What exactly does '3rd-level damage' mean? When the epidermis is lost with damage to the subcutaneous tissue?
|
# ? Oct 4, 2009 23:12 |
|
yaoi prophet posted:What exactly does '3rd-level damage' mean? Sounds to me like it had effects which showed up several modules away from the original cause of the problem. Like a classpath error in one module being traced back to a Kodo error which was caused by yet another module failing to deploy because of what ultimately amounts to the clustering configuration referring to a host that doesn't resolve.
|
# ? Oct 4, 2009 23:13 |
|
Mikey-San posted:Does the 'big boss' not like to have other engineers review his changes before committing? He was one of those 'I know the best way and will not be persuaded otherwise' people. Also one of those 'reinvent the wheel because the standard wheels are all terrible' people. In general he was a pretty good coder, but he was annoying as hell to work under. yaoi prophet posted:What exactly does '3rd-level damage' mean? In this context, it means that a bad pointer causes another pointer to get scribbled on (instead of crashing right away), and when that second pointer later gets dereferenced, it causes a crash because it's bad. But the crash originates in code that didn't cause the actual damage. 2nd-level damage. In this case that second pointer didn't cause a crash, but overwrote ANOTHER pointer, which finally caused a crash in some utterly unrelated module from the k<=30 piece, hence 3rd-level. Continue as many times as you like. nth-level damage. UraniumAnchor fucked around with this message at 23:25 on Oct 4, 2009 |
# ? Oct 4, 2009 23:19 |
|
Hey as long as we're making up terminology I'd like to suggest that we call it 'flobertyfloo' instead. To be used as in "Man, Bob checked in a bad change and due to our widespread lack of error checking across our entire codebase I spent all week tracking down flobertyfloo." Or "Wow it's really terrible that no input validation was taking place, or else the flobertyfloo that cost us a million dollars in downtime might have been avoided."
|
# ? Oct 5, 2009 00:27 |
|
Yeah, most people just call that a memory stomper or something, 'cause that's the only important part. This "n-level damage" thing sounds like how Ulillillia would describe a bug.
|
# ? Oct 5, 2009 00:32 |
|
Mikey-San posted:Yeah, most people just call that a memory stomper or something, 'cause that's the only important part. This "n-level damage" thing sounds like how Ulillillia would describe a bug. UraniumAnchor's name also starts with U, trap sprung But yeah, once you've accessed the first invalid pointer, everything else that happens after that enters undefined behavior no-man's-land, so trying to denote the depth of accesses that it takes for something to actually break with a visible effect is a pointless exercise. Sounds like your boss needs to use the cool diagnostic checked pointer library that I developed for our students to use when we teach them C++.
|
# ? Oct 5, 2009 00:54 |
|
Flobbster posted:But yeah, once you've accessed the first invalid pointer, everything else that happens after that enters undefined behavior no-man's-land, so trying to denote the depth of accesses that it takes for something to actually break with a visible effect is a pointless exercise. At what level do demons fly out your nose?
|
# ? Oct 5, 2009 01:02 |
|
Avenging Dentist posted:At what level do demons fly out your nose? 9th? Anyway, on the topic of loops.... Was looking into why one of our web pages was running so slowly, ran across this gem. code:
|
# ? Oct 5, 2009 02:21 |
|
biznatchio posted:Hey as long as we're making up terminology I'd like to suggest that we call it 'flobertyfloo' instead. http://catb.org/jargon/html/S/secondary-damage.html I mean I guess you could say that the jargon file isn't a dictionary but I didn't pull this out of thin air.
|
# ? Oct 5, 2009 02:25 |
|
UraniumAnchor posted:http://catb.org/jargon/html/S/secondary-damage.html As yes, Secondary Damage is caused by a Fandango on core. Duh.
|
# ? Oct 5, 2009 04:37 |
|
Trabisnikof posted:As yes, Secondary Damage is caused by a Fandango on core. Duh. Haha, yes. I wouldn't take terminology advice from ESR, personally.
|
# ? Oct 5, 2009 04:45 |
|
It doesn't even exist in the real Jargon File, just the bizarro ESR version.
|
# ? Oct 5, 2009 05:07 |
|
pokeyman posted:What does what you said have anything to with what you quoted? Just that many languages such as C / Java are utterly terrible about making you constantly declare a rather low level when it would be better off to give you something high level and then have a low level if you need it.
|
# ? Oct 5, 2009 07:53 |
|
HFX posted:Just that many languages such as C / Java are utterly terrible about making you constantly declare a rather low level when it would be better off to give you something high level and then have a low level if you need it. I'm glad you're not a coworker.
|
# ? Oct 5, 2009 07:56 |
|
|
# ? May 13, 2024 21:41 |
|
Avenging Dentist posted:I'm glad you're not a coworker. Awesome. I write for my needs. Often times, this does mean using C, C++, Java. However, I've also realized how much time I waste coding for them. This is especially true when you realize that static type inferring functional languages are often more then fast enough without making you think about the small details when they aren't necessary. HFX fucked around with this message at 08:25 on Oct 5, 2009 |
# ? Oct 5, 2009 08:07 |