|
If any of you have ever used infragistics this is all too common:
|
# ? Aug 20, 2008 17:02 |
|
|
# ? May 19, 2024 15:28 |
|
void RaceCollision(_Bool Collide) { if (Collide) { CleanRace = FALSE; CleanLap = FALSE; } } Called from exactly one place in the entire game, with the parameter set to TRUE. It even had a completely useless timer on it to stop it being called repeatedly during an ongoing collision.
|
# ? Aug 21, 2008 16:57 |
|
I don't have code snippets but I have recently been given the privilege of taking over development of a local intranet system in my work. The previous developer has apparent never heard of :hover, which means the navigation (table rows, naturally) is filled with javascript changing the style from a class called A to a class called AHover onmouseover, and of course back to A onmouseout. I was speechless upon perusing the code. Am I being naive here and there was a time where Javascript had developed faster than CSS and therefore :hover didn't exist and this was the only way to do it? Even if such a time existed this was developed only 2 years ago so it's inexcusable. Finally, when opening the site instead of just opening an HTML file you open an HTA file, which is apparently an HTML Application. Is this ever excusable? Thankfully I am close to getting the goahead to start from scratch. Unfortunately they are not very willing to give me a (L)AMP setup
|
# ? Aug 22, 2008 02:06 |
|
G-Dub posted:Finally, when opening the site instead of just opening an HTML file you open an HTA file, which is apparently an HTML Application. Is this ever excusable? Maybe it's doing some really cool fuckery that you can't do with non-application HTML. I don't have a clue what such fuckery would look like, but who am I to say it doesn't exist.
|
# ? Aug 22, 2008 02:20 |
|
pokeyman posted:Maybe it's doing some really cool fuckery that you can't do with non-application HTML. I don't have a clue what such fuckery would look like, but who am I to say it doesn't exist. I've used more than a couple HTAs. Javascript running in an HTA has pretty much full system access -- if you can do it with a standalone .js file running through the Windows Scripting Host, you can do it in an HTA. Local files, printers, system administration, and Office automation (well, any COM automation) are all examples of reasons you'd want an HTA; and since an HTA can include an IFRAME and optionally pass full application-level permission to it, it allows you to grant those extended privileges to any arbitrary URL of your choice, so you can host your actual application logic on a web server somewhere for easy maintenance.
|
# ? Aug 22, 2008 03:07 |
|
G-Dub posted:I don't have code snippets but I have recently been given the privilege of taking over development of a local intranet system in my work. The previous developer has apparent never heard of :hover, which means the navigation (table rows, naturally) is filled with javascript changing the style from a class called A to a class called AHover onmouseover, and of course back to A onmouseout. Rottbott posted:
Anonymous Name fucked around with this message at 03:55 on Aug 22, 2008 |
# ? Aug 22, 2008 03:49 |
|
Anonymous Name posted:My websites use javascript instead of hover. IE does or did not support hover, and/or it does not for all elements. IE7 does, and for IE5/6, the solution is csshover.htc. code:
|
# ? Aug 22, 2008 04:09 |
|
This isn't so much a coding horror as it is a process horror. We're out of development and feature integration testing (where developers have pretty free reign over what gets checked in and put into the weekly build), and started a large test cycle two weeks ago. In test, all changes have to be associated with a bug and approved by a change control board. I'm the build monkey, so I look at all the changes made and make sure they're associated with a bug and a note has been put into the release notes we generate each week. One of our developers checked in a file with the comment "Prettier code". I've been burned by little changes made by this particular person in the past, when he went on vacation just before the build was done, and a small logging change broke some major functionality in our product. I had to dig in and fix it, and it wasn't a huge deal, but I now diff a lot of his smaller check-ins to make sure I understand what's going in each week and that its not busted. (I don't have time or patience to code-review the bigger stuff) The prettier code: code:
code:
The guy's a great developer and has lots of experience and all, but getting the guy to abide by a little bit of process is like herding cats.
|
# ? Aug 22, 2008 04:52 |
|
Edit: Disregard what was here. I've compiled a nice list during this development cycle I'll post.
|
# ? Aug 22, 2008 15:58 |
|
Since enum's always increment by 1 unless you specify a value, maybe somebody can explain why the Windows Media Player sdk headers are full of stuff like this?code:
|
# ? Aug 23, 2008 15:09 |
|
Either the headers date back to some ancient and barely-standard-conforming VC, were tool-generated, or were jerk-generated.
|
# ? Aug 25, 2008 19:06 |
|
$condition and $other_condition are always true or false.php:<? if($condition ? true : $other_condition) { do_something(); } ?>
|
# ? Aug 25, 2008 19:42 |
|
mynameisntneo posted:Why isn't || good enough?
|
# ? Aug 25, 2008 20:15 |
|
Mustach posted:Either the headers date back to some ancient and barely-standard-conforming VC, were tool-generated, or were jerk-generated. Ever actually watch someone write C++ by VC6 wizard? Using the mouse more than the keyboard? It is one of the most surreal and depressing experiences I've ever had.
|
# ? Aug 26, 2008 07:51 |
|
code:
edit: For some reason my indentation isn't showing up. edit: Awesome...[code] tags are cool. You can tell I don't use tags very often/at all Arconom fucked around with this message at 04:56 on Aug 27, 2008 |
# ? Aug 27, 2008 04:13 |
|
Arconom posted:edit: For some reason my indentation isn't showing up. I get the feeling even posting the best-written COBOL you could find would still be valid for this thread.
|
# ? Aug 27, 2008 04:46 |
|
Sivart13 posted:I get the feeling even posting the best-written COBOL you could find would still be valid for this thread. Actually, if this: code:
|
# ? Aug 27, 2008 14:49 |
|
COBOL has its neat features, but its archaic structure and design more than make up for it. I haven't used OOCOBOL yet. Maybe it will be pretty cool.
|
# ? Aug 27, 2008 15:16 |
|
Munkeymon posted:Actually, if this: I've been beaten down by code for so long I've almost forgotten how wonderful those early days were.
|
# ? Aug 27, 2008 15:40 |
|
Zaasakokwaan posted:When I was a Junior Programmer, this was always my biggest pet peeve. The former is so natural I could never understand why it wasn't supported more. Wouldn't that kill the English readability of something like: code:
code:
|
# ? Aug 27, 2008 15:52 |
|
That's what the "in" operator's for. "if ws_opt in ['p', 'l']"
|
# ? Aug 27, 2008 16:24 |
|
Sivart13 posted:I get the feeling even posting the best-written COBOL you could find would still be valid for this thread. I only work with three COBOL applications, but they're made by different companies and all of them have between sixty and two hundred uncommented batch files that are absolutely necessary for regular operation that are labeled between 1.bat and 200.bat.
|
# ? Aug 27, 2008 16:34 |
|
ashgromnies posted:Wouldn't that kill the English readability of something like: I was thinking a shorthand just for this case: code:
|
# ? Aug 27, 2008 16:55 |
|
Munkeymon posted:I was thinking a shorthand just for this case: code:
|
# ? Aug 27, 2008 16:59 |
|
Volte posted:Well some languages like Python have an 'in' operator. Like I know, but I was specifically thinking of C-style languages where ==[] might look more at home in a conditional. Also, JavaScript and C# already use in for other things.
|
# ? Aug 27, 2008 17:15 |
|
Munkeymon posted:I know, but I was specifically thinking of C-style languages where ==[] might look more at home in a conditional. Also, JavaScript and C# already use in for other things. It's actually pretty easy to hack up an extension method on Object for in if you really want it. I think this should work: code:
code:
code:
|
# ? Aug 27, 2008 17:26 |
|
enki42 posted:It's actually pretty easy to hack up an extension method on Object for in if you really want it. I think this should work: Assuming this is C# and not Java (I still can't tell the difference, heh) then you don't need the overloads. You can do: code:
|
# ? Aug 27, 2008 17:34 |
|
Ugg boots posted:Assuming this is C# and not Java (I still can't tell the difference, heh) then you don't need the overloads. You can do:
|
# ? Aug 27, 2008 17:42 |
|
code:
|
# ? Aug 27, 2008 17:45 |
|
No Safe Word posted:Monkeypatching FTL.
|
# ? Aug 27, 2008 17:46 |
|
Scaevolus posted:How is this monkeypatching? The this <typename> construct in C# is basically their way of instituting monkeypatching. They call it "extension methods" but it's the same thing, anything that includes that method's namespace gets those methods tacked on to whatever object it applies to. The only good thing that C# does instead is it doesn't allow you to override stuff, but that only makes the idea of monkeypatching slightly less crappy.
|
# ? Aug 27, 2008 17:52 |
|
No Safe Word posted:The this <typename> construct in C# is basically their way of instituting monkeypatching. They call it "extension methods" but it's the same thing, anything that includes that method's namespace gets those methods tacked on to whatever object it applies to. The only good thing that C# does instead is it doesn't allow you to override stuff, but that only makes the idea of monkeypatching slightly less crappy. Thta's not what monkeypatching is, and don't say 'FT[WL]', this isn't slashdot
|
# ? Aug 27, 2008 17:55 |
|
Damnit, guys. Quit bringing practical solutions to my fantasy land.No Safe Word posted:Monkeypatching FTL. I don't know that it counts as monkeypatching but I still like it less than adding some shorthand to the language. And where the hell is your avatar from?
|
# ? Aug 27, 2008 17:55 |
|
KaeseEs posted:Thta's not what monkeypatching is, and don't say 'FT[WL]', this isn't slashdot Thanks for the geography lesson. And for the complete lack of clarification on what you think monkeypatching actually is. And for being the post police in a light-hearted thread. Hacking methods into a class that you didn't create is, in my mind, monkeypatching. Whether it's tacking on a method or redefining an existing one. code:
Munkeymon posted:And where the hell is your avatar from? I forgot I had it because I browse with avatars off at work No Safe Word fucked around with this message at 18:04 on Aug 27, 2008 |
# ? Aug 27, 2008 18:01 |
|
For the clinically dumb, monkeypatching involves replacing poo poo. And yes, your hilarious reference to hollywood squares was both timely and enjoyable
|
# ? Aug 27, 2008 18:04 |
|
No Safe Word posted:Hacking into a class that you didn't create is, in my mind, monkeypatching. Whether it's tacking on a method or redefining an existing one. The super official Wikipedia definition says it has to happen at run time which may or may not be the case depending on how they do the magic in the IL. At any rate, wouldn't that method show up in CodeSense and be type cheched at compile time, making it signifigantly safer and more visible than the traditional monkeypatch? quote:edit: Thanks, now I'll ahve to go check it out.
|
# ? Aug 27, 2008 18:11 |
|
Done making GBS threads on the thread, here's a classic from php land, quoted from elsewhere:http://use.perl.org/~Aristotle/journal/33448 posted:This is a tale of an integer overflow vulnerability (paraphrased for the purposes of the tale, as are all following snippets): and an encore: php:<? magic_quotes_*() addslashes() mysql_escape_string() mysql_real_escape_string()?>
|
# ? Aug 27, 2008 18:21 |
|
I don't consider it monkeypatching because the extension method does not have any access to internal members of the class or indeed any special privileges that do not exist when the method is implemented normally. The extension method has to be in scope (i.e. imported) in order to use it, and I believe it is translated into a traditional function call in the IL. Obviously, it should be used sparingly and be documented well when it is, but it's how things like LINQ are implemented, and it's a real blessing.
|
# ? Aug 27, 2008 18:38 |
|
Munkeymon posted:Actually, if this: You want Prolog: code:
|
# ? Aug 27, 2008 18:50 |
|
|
# ? May 19, 2024 15:28 |
|
Re Monkeypatching: That's nice dearie, can we take this argument and beat it to death in a new thread please?
|
# ? Aug 27, 2008 18:56 |