|
Lone_Strider posted:The dev who created this is one of those "stuck in his ways" people who's best fit is maintaining some Access 97 application. Ugh, I work with one of those. I think now is a great time for me to start poo poo again about the "guid" table. I talk so much poo poo about my coworkers. I really hope none of them are goons.
|
# ? Dec 5, 2008 01:57 |
|
|
# ? Apr 20, 2024 04:41 |
|
For those of you with SQL2005, NEWSEQUENTIALID() was created for you:MSDN posted:Creates a GUID that is greater than any GUID previously generated by this function on a specified computer.
|
# ? Dec 5, 2008 03:57 |
|
Years ago, I got hired to take over a few websites that were created by "this guy that's really good with computers" Watch him "resize" an uploaded image in PHP5: php:<? $filename = "whatever.jpg"; $image = imagecreatefromjpeg($filename); $image_width = imagesx($image); $image_height = imagesy($image); while ($image_width > $max_width) { $image_width = $image_width - 1; } while ($image_height > $max_height) { $image_height = $image_height - 1; } echo '<img src="'.$filename.'" width="'.$image_width.'" height="'.$image_height.'">'; ?> How can someone who has even the faintest idea of how to use math (or knows how the internet works) write this... drivel?? subreality fucked around with this message at 06:12 on Dec 5, 2008 |
# ? Dec 5, 2008 04:43 |
|
The same guy also wrote a login.php that went a little something like this:php:<? $logged_in = false; $users = mysql_query("SELECT * FROM users"); while ($row = mysql_fetch_assoc($users)) { if ($row['username'] == $_POST['username'] && $row['password'] == $_POST['password']) { $user_id = $row['id']; $logged_in = true; } } ?>
|
# ? Dec 5, 2008 04:48 |
|
Hmm..well if we're trying to strictify this perl code, then I can't use scalar refs...I've got it!code:
|
# ? Dec 5, 2008 04:50 |
|
subreality posted:The same guy also wrote a login.php that went a little something like this: Could have been worse, at least it's secure from sql injection.
|
# ? Dec 5, 2008 05:10 |
|
subreality posted:The same guy also wrote a login.php that went a little something like this:
|
# ? Dec 5, 2008 05:30 |
|
indigoe posted:Could have been worse, at least it's secure from sql injection. It amazes me how seemingly few people know how SQL injection works and how to use prepared statements.
|
# ? Dec 5, 2008 05:33 |
|
subreality posted:
|
# ? Dec 5, 2008 05:56 |
|
O(1) for very large values of 1.
|
# ? Dec 5, 2008 06:03 |
|
MrMoo posted:Really '<' not '>'? How long does that run for? Woops. That was a typo by me, recalling his code from memory. Thanks, corrected now.
|
# ? Dec 5, 2008 06:12 |
|
subreality posted:The same guy also wrote a login.php that went a little something like this: Who gives a gently caress about this disaster when you're storing passwords in plain text in the database?
|
# ? Dec 5, 2008 09:22 |
|
geetee posted:Ugh, I work with one of those. I think now is a great time for me to start poo poo again about the "guid" table. I talk so much poo poo about my coworkers. I really hope none of them are goons. Yeah, the SDET we hired is one of those. He seriously tried to defend the use of global variables.
|
# ? Dec 5, 2008 11:36 |
|
When I was 12 I was doing a Visual Basic class through a high school program and I didn't know what the gently caress I was doing. I made a little sprite game with Timer and Image controls- pressing arrow keys enabled various timers that moved the image control around (TimerMoveLeft, TimerMoveRight, etc). This is pretty bad, but not really worth posting. Here's the bad rear end part: it was multiplayer. Each instance of the game would constantly write the player's position to a text file. To connect to another player, you had to pop open a file dialog, navigate through Windows networking and select their player file. Bam. Multiplayer gaming via file I/O over Windows networking. I dare you to commit a worse atrocity. edit: we were using VB5 so I may have been younger than that
|
# ? Dec 5, 2008 15:26 |
|
not a dinosaur posted:Here's the bad rear end part: it was multiplayer. Each instance of the game would constantly write the player's position to a text file. To connect to another player, you had to pop open a file dialog, navigate through Windows networking and select their player file. Bam. Multiplayer gaming via file I/O over Windows networking. I dare you to commit a worse atrocity. Hahahaha that's so loving awesome for being 10 years old. You figured out a solution with the pieces you were given, that commendable.
|
# ? Dec 5, 2008 16:18 |
|
Mikey-San posted:Who gives a gently caress about this disaster when you're storing passwords in plain text in the database? Hey now ... he could have a javascript control on the page that hashes the password they enter before the POST fires!
|
# ? Dec 5, 2008 16:33 |
|
Ryouga Inverse posted:Yeah, the SDET we hired is one of those. Really? Global variables? How heinous! What's next, is he going to say that "goto" actually makes sense in certain situations?
|
# ? Dec 5, 2008 19:45 |
|
ehnus posted:Really? Global variables? How heinous! Okay, look, there's a difference between there possibly being edge cases in which it can be used and... code:
|
# ? Dec 5, 2008 20:15 |
|
Spent the last hour reading this thread and now I'm extraordinarily worried I'm going to end up in here some day. There were so many in here that I didn't understand without explanatory posts
|
# ? Dec 5, 2008 22:22 |
|
Ample worry (self awareness?) is step one on your journey to not being here. If at any time you thought "my code looks like this" or "that looks like a good idea", then you should be really worried. Why not quote a post you don't understand and ask for clarification? I'm sure at least one goon won't be able to restrain himself and will wow us with his knowledge of The Right Way.
|
# ? Dec 5, 2008 22:42 |
|
Triple Tech posted:Ample worry (self awareness?) is step one on your journey to not being here. If at any time you thought "my code looks like this" or "that looks like a good idea", then you should be really worried. (Just don't read any programming blogs and you'll be fine.)
|
# ? Dec 6, 2008 00:03 |
|
Mikey-San posted:Who gives a gently caress about this disaster when you're storing passwords in plain text in the database?
|
# ? Dec 6, 2008 00:05 |
|
Avenging Dentist posted:
I read The Daily WTF most work mornings, does that count?
|
# ? Dec 6, 2008 00:55 |
|
Ledneh posted:Spent the last hour reading this thread and now I'm extraordinarily worried I'm going to end up in here some day. There were so many in here that I didn't understand without explanatory posts * or hiiiilarious
|
# ? Dec 6, 2008 03:51 |
|
Victor posted:Anyone in here who claims to have never written code that could be submitted to this thread is a pretender*. The key is that you continue to learn and figure out ways to be less retarded. Hell, I'll go so far as to acknowledge that I still write bad code today. Sometimes short deadlines make for serious design compromises.
|
# ? Dec 6, 2008 04:13 |
|
biznatchio posted:Hell, I'll go so far as to acknowledge that I still write bad code today. These words are so true, and it hurts.
|
# ? Dec 7, 2008 08:04 |
|
Ryouga Inverse posted:Okay, look, there's a difference between there possibly being edge cases in which it can be used and... What exactly is wrong with that code? He has an INI file with three lines in the form of X=Y and he's taking the second field of the first three lines and using them to populate values. How is it ugly?
|
# ? Dec 8, 2008 00:11 |
|
chocojosh posted:What exactly is wrong with that code? He has an INI file with three lines in the form of X=Y and he's taking the second field of the first three lines and using them to populate values. How is it ugly? It's not the worst code I've ever seen but it does have a few problems. First, it looks like the _buffer and _inputFields variables should be local in scope (tough to say without seeing the rest of the class, but it's probably a WTF either way). Second, it makes some pretty big assumptions about the format of the file. Typically, properties files like this shouldn't really care about the ordering of the information. What if someone adds some whitespace, or comments, to the file? What happens when more properties need to be added? I'm not a .NET guy but I'm pretty sure there has to be a better way to read these config files.
|
# ? Dec 8, 2008 00:35 |
|
chocojosh posted:What exactly is wrong with that code? He has an INI file with three lines in the form of X=Y and he's taking the second field of the first three lines and using them to populate values. How is it ugly? Every variable there is global (well, technically it's private to the class but since the entire app is this one class... which is a big WTF all by itself) and the method doesn't return anything or take anything (because it uses global variables), for starters. The config file name is hardcoded, in more than one place. The code itself doesn't handle humans editing the file gracefully. Since he's using the INI format he intends humans to be able to edit it, and humans screw up a lot. Especially humans who aren't very good at using computers, which this app is targeted at. The biggest WTF is simply that it took him an entire week of working 12h a day (he worked on it from home) to turn out code of this quality, and he gets paid more than I do.
|
# ? Dec 8, 2008 06:06 |
|
Ryouga Inverse posted:Thanks, because of the comment you made about the goto I read it four times wondering where the goto was. Outlaw: When I wrote a small desktop app for my company last summer, I just followed the "standard convention" at our office and used app.config. I believe ConfigurationManager.AppSettings was what I used. I hope it didn't take him 60 hours to just come up with a 20 line function! If so.. are you looking to replace him?
|
# ? Dec 8, 2008 06:21 |
|
chocojosh posted:Thanks, because of the comment you made about the goto I read it four times wondering where the goto was. Well, I was responding to someone trying to troll me for possibly suggesting that something in coding could NEVER have a use. It's not just that function, it's his whole app. Basically what we want to do is a GUI wrapper for a CLI app. Doing it in VBS would have been faster, but not as flexible, while doing it in C# allows us to do some other things that VBS can't do. He has managed to take all the disadvantages of the VBS approach and apply them to the C# approach, and his code didn't work AT ALL until the end of the week. And it's still missing a few key features. His code review consisted of "Don't ever use global variables." "Well I wanted to get it working quickly..." "Don't use globals. It's terrible style. Also, catch the events you actually care about rather than events that are tangentially related. Further, your code doesn't even work." "Well this is just a review about the composition of the code..." "Okay. GLOBAL VARIABLES. VOID METHODS. CALLING TOSTRING() ON STRING VALUES." My boss knows that he can't do the work effectively AT ALL and is, I believe, looking to replace him, but it's harder to find a competent SDET than you'd think. The punchline is that this guy is on his contracting break from MS' Explorer team. I can't quite wrap my head around this situation at ALL.
|
# ? Dec 8, 2008 06:49 |
|
Here's one you all might enjoy. There was a guy here, that thankfully left a while ago, that did a lot of the coding around here. While this is just a little taste of his WTFery, I've encountered a laundry list of problems with his style. Sure perl will let you play pretty loose with the rules, but that's no reason to abuse it. Among such silliness as a LOVE of global variables (I don't think he ever scoped anything in his life), every single thing being in a function to the point the actual script was just a short list of two or three functions at the bottom, and an almost smug disregard for how to actually write working code, there's this: code:
|
# ? Dec 8, 2008 07:54 |
|
Ryouga Inverse posted:"...CALLING TOSTRING() ON STRING VALUES."
|
# ? Dec 8, 2008 18:13 |
|
Lone_Strider posted:I bet when he was called on it he said "well I'm just making sure" string = string.toString().toString().toString().toString(); /* Really loving string. */
|
# ? Dec 8, 2008 19:17 |
|
Lone_Strider posted:Holy poo poo, this is like a tell-tale mark for crappy devs. I bet when he was called on it he said "well I'm just making sure" Seriously. textBox.Text.ToString()? Really? I mean, really?
|
# ? Dec 8, 2008 19:21 |
|
Guys, I am sure the .toString() calls get inlined...
|
# ? Dec 8, 2008 19:34 |
|
Vanadium posted:Guys, I am sure the .toString() calls get inlined...
|
# ? Dec 8, 2008 19:40 |
|
That just makes the code more portable. In Ruby it is common practice to call .to_s on string-like objects
|
# ? Dec 8, 2008 19:51 |
|
You can't subclass java.lang.String.
|
# ? Dec 8, 2008 19:58 |
|
|
# ? Apr 20, 2024 04:41 |
|
Vanadium posted:That just makes the code more portable. In Ruby it is common practice to call .to_s on string-like objects This is a level, right?
|
# ? Dec 8, 2008 19:58 |