|
I'm not going to tell you how to live your life, but rewriting a 3KLOC Java file containing 7 classes is probably not going to result in you needing to be hospitalized. As return0 says, it sounds like it's a little toy that you shouldn't try to mutate from prototype to production. Just write 2KLOC of better code now that you have it to work from.
|
# ? Nov 7, 2014 02:23 |
|
|
# ? May 17, 2024 15:29 |
|
Bad coding page of the beast! http://www.frightbytes.com/computerdemons/error666.html
|
# ? Nov 7, 2014 02:46 |
|
Yay for weird/obsolete VCS! We use SVK, which is a clunky distributed VCS hacked on top of SVN via Perl scripts. It's been abandonware for several years. It's not absolutely horrible, but is missing a lot of features and has pretty sub-par documentation. Fortunately we're in the process of getting ready to switch to Git! As far as coding horrors, I encountered this the other day in a daily rollup job. Was asked to figure out why it was taking hours to complete. Changed all the variable names etc. php:<? public function rollUpSomStuf(){ foreach($this->rollup->getRollup() as $foo => $foo_rollup){ //aggregates a bunch of stuff from Mongo collection foreach($foo_rollup as $bar => $bar_rollup) { if($this->hasValid($bar)) { $baz = $this->getbazFrombar($bar); } else { //debug logging } foreach($bar_rollup as $frotz => $frotz_rollup) { foreach($frotz_rollup as $flim => $flim_rollup) { foreach($flim_rollup as $flam => $flam_rollup) { foreach($flam_rollup as $doink => $doink_rollup) { foreach($doink_rollup as $narf => $narf_rollup){ foreach($narf_rollup as $blargh => $blargh_rollup){ foreach($blargh_rollup as $spliff => $spliff_rollup){ foreach($spliff_rollup as $splorch => $splorch_total){ $this->mongoThingy->date = $this->date(); $this->mongoThingy->foo = $foo; $this->mongoThingy->bar = $bar; if($this->hasValidbar($bar)) { $this->mongoThingy->sprocket = $baz['sprocket']; $this->mongoThingy->frotz = $baz['frotz']; $this->mongoThingy->zergrush = $baz['zergrush']; $this->mongoThingy->bazoom = $baz['bazoom']; $this->mongoThingy->hyphy = $baz['hyphy']; } else { $this->mongoThingy->frotz = $frotz; } $this->mongoThingy->flim = $flim; $this->mongoThingy->flam = $flam; $this->mongoThingy->doink = $doink; $this->mongoThingy->narf = $narf; $this->mongoThingy->blargh = $blargh; $this->mongoThingy->spliff = $spliff; $this->mongoThingy->splorch = $splorch; $this->mongoThingy->crunk = $splorch_total; $this->mongoThingy->insert(); } } } } } } } } } } } ?>
|
# ? Nov 7, 2014 03:17 |
|
I really appreciate the attention to fakename detail.
|
# ? Nov 7, 2014 03:19 |
|
Subjunctive posted:I really appreciate the attention to fakename detail. Is 'garply' not a common fourth placeholder name outside Berkeley? I thought it was missing that one.
|
# ? Nov 7, 2014 03:23 |
|
I don't see "quux"- one of my old officemates got me in the habit of using it as a third metasyntactic variable after foo and bar.
|
# ? Nov 7, 2014 04:41 |
|
Internet Janitor posted:I don't see "quux"- one of my old officemates got me in the habit of using it as a third metasyntactic variable after foo and bar. Ugh it's foo, bar, baz, *then* quux I am surrounded by amateurs
|
# ? Nov 7, 2014 05:04 |
|
Baz is far too similar to bar which can lead to confusion as you can read about in my seminal paper (read: Wordpress post) "Baz Considered Harmful: Choosing the Right Metasyntactic Variables for your Web Framework or Whatever". Furthermore,
|
# ? Nov 7, 2014 05:27 |
|
I'll admit that I forgot what comes after baz. I have seen frotz used though. The other ones were just whatever popped into my head. Of course even if I'd remembered every metasyntactic variable ever created, it might not have been enough in this case.Internet Janitor posted:Baz is far too similar to bar which can lead to confusion as you can read about in my seminal paper (read: Wordpress post) "Baz Considered Harmful: Choosing the Right Metasyntactic Variables for your Web Framework or Whatever". Furthermore, "Is Baz an Anti-Pattern? Pseudovariable Best Practices for Agile Prototyping" DimpledChad fucked around with this message at 05:46 on Nov 7, 2014 |
# ? Nov 7, 2014 05:44 |
|
Subjunctive posted:I'm not going to tell you how to live your life, but rewriting a 3KLOC Java file containing 7 classes is probably not going to result in you needing to be hospitalized. As return0 says, it sounds like it's a little toy that you shouldn't try to mutate from prototype to production. Just write 2KLOC of better code now that you have it to work from. It's just annoying because at this point I've been waiting something on the order of two months for it to be delivered. (E: To clarify, it was supposed to be delivered two months ago after an original estimate of a couple of weeks. Now that it's 2 months behind schedule, discovering it's going to be a fairly major refactoring is somewhat annoying.) I finally get a 250MB ZIP file containing the code, a JAR containing a compiled version of that code and all its dependencies, and then all of its dependencies outside the JAR a second time for good measure. (Not even going to begin to guess why.) However it contains such gems as: Java code:
(To be fair, he's using Integer because they're keys in a hashmap. I have no clue whether or not this makes sense at this point in time.) Xenoveritas fucked around with this message at 06:26 on Nov 7, 2014 |
# ? Nov 7, 2014 06:17 |
|
Steve French posted:Ugh it's foo, bar, baz, *then* quux I am surrounded by amateurs HEATHENS! foo, bar, baz, zip, qux, quux, quuux, ...
|
# ? Nov 7, 2014 06:56 |
|
Xenoveritas posted:
Can the number of topics only be even? The floor makes it equivalent to: Java code:
|
# ? Nov 7, 2014 06:56 |
I had the misfortune of working for the company that is responsible for this http://www.astm.org/search/js/fullsite-search.js?v54a I'm a big fan of the block of code that nests ~12 levels located around line 1000. Fun fact: all product pages (thousands) were generated by bash & perl scripts as separate html pages rather than having a single, dynamic page. This broke routinely. Don Mega fucked around with this message at 07:07 on Nov 7, 2014 |
|
# ? Nov 7, 2014 07:01 |
|
The Laplace Demon posted:Can the number of topics only be even? The floor makes it equivalent to: The "min + (max - min)/2" looks like he heard about how to take an average without integer overflow messing things up, but didn't really believe it so cast everything to doubles just in case.
|
# ? Nov 7, 2014 09:38 |
|
I used to use doh and blah as metasyntactic variables. At some point I switched to morbo, turbo, furbo. Now that I'm older and lazier, it's just a, aa, aaa...
|
# ? Nov 7, 2014 09:59 |
|
Well i know of a true horror i have mentioned on here before Article.java 200+ lines of imports Cyclic complexity off the scale and somewhere in the region if i recall correctly between 12k-15k lines And only the system architects are allowed to make any changes.
|
# ? Nov 7, 2014 11:10 |
|
foo, bar, baaz, khan, quux, bah, blah, are mine. Sometimes I use aa, bb, cc, etc.
|
# ? Nov 7, 2014 13:44 |
|
I like arse and blep.
|
# ? Nov 7, 2014 15:29 |
|
If no one will ever see what I'm prototyping, I usually go with butts, lol, and what.
|
# ? Nov 7, 2014 15:51 |
|
just started working with a new dev who is supposed to be really good. i mentioned most of us use sublime text or vim or some text editor like that and he starts telling me about how he uses an IDE and that unironically netbeans is the best one and also that text editors are for newbs. welp. project is doomed.
|
# ? Nov 7, 2014 15:59 |
|
thathonkey posted:just started working with a new dev who is supposed to be really good. i mentioned most of us use sublime text or vim or something text editor like that and he starts telling me about how he uses an IDE and that unironically netbeans is the best one and also that text editors are for newbs. welp. project is doomed. I got tricked into using netbeans once. It was fun working out how entire files that I didn't even touch turned into conflicts. Line endings or something. I don't know. It was bad.
|
# ? Nov 7, 2014 16:04 |
|
The editor doesn't matter, but rather what you put into the editor that makes a true coding horror.
|
# ? Nov 7, 2014 16:05 |
|
Nah, Netbeans is pure poo poo. Last night, my professor was walking us through some code on the projector and when he saved one of his files, Netbeans crashed. When he opened Netbeans up again, every time he selected the file, it would crash. Then he decided to reboot the computer, and Deep Freeze took care of the rest.
|
# ? Nov 7, 2014 16:16 |
|
C# code:
|
# ? Nov 7, 2014 16:44 |
|
Jethro posted:If no one will ever see what I'm prototyping, I usually go with butts, lol, and what. Is it bad the first garbage variable name that always comes to me is fart?
|
# ? Nov 7, 2014 17:39 |
u should select metasyntactic variables based on the optimal hamming word distance from each other. Solving for n words left as an exercise for the reader
o.m. 94 fucked around with this message at 17:47 on Nov 7, 2014 |
|
# ? Nov 7, 2014 17:45 |
|
asdf, wefwef and fffff
|
# ? Nov 7, 2014 17:47 |
I just use every profanity I can think of. If I run out I start using the names of people I hate.dwazegek posted:
I just sat here saying "gently caress gently caress gently caress. gently caress. what the gently caress. why. gently caress.". Also, CusTom.
|
|
# ? Nov 7, 2014 17:52 |
|
asd, qwe zxc, lkj, poi are my go-tos in order of frequency. If I'm mad I'll effort-type abusive names directed at whatever language, framework or buggy shitpile of software is pissing me off at the moment. I find it surprisingly cathartic. thathonkey posted:just started working with a new dev who is supposed to be really good. i mentioned most of us use sublime text or vim or some text editor like that and he starts telling me about how he uses an IDE and that unironically netbeans is the best one and also that text editors are for newbs. welp. project is doomed. Their PHP editor was decent sometime around 2010. I can't remember if PHPStorm existed back then but it probably did and wasn't an option because the shithole I used to work in was allergic to spending money.
|
# ? Nov 7, 2014 18:25 |
|
Described by a friend of mine in a codebase she inherited. This is not the exact code, but a dramatic reenactment based on her description.Bash code:
|
# ? Nov 7, 2014 18:31 |
|
Munkeymon posted:asd, qwe zxc, lkj, poi are my go-tos in order of frequency. My commit examples code:
code:
and then sort of the opposite, when a coworker of mine pointed out a silly bug: code:
|
# ? Nov 7, 2014 18:40 |
|
Manslaughter posted:Also, CusTom. The guy who wrote this is absolutely terrible when it comes to that sort of stuff, there are at least 5 different misspellings of CustomPricing in the entire change. Even in that tiny snippet there's an inconsistency between CustomPricing and CustomPrice. Other stuff that we're (sometimes permanently) stuck with thanks to him: "GeneRatePassword", "PhoneNumberSerfvice", "PhonenUmberController", "DoProviosing", "ReferenceLonegerThen50". He's also the only person on the entire team that insists on using lower-case method names for private functions. No big deal, it's just annoying that everyone adheres to a certain standard, and he consistently breaks it. On the plus side, I can tell that the code is going to be terrible before I see it, because I know he wrote it. edit: I just realized I started the post with "The guy who wrote this is absolutely terrible when it comes to that sort of stuff...", implying that he's not-terrible at other stuff, which isn't true. He's equally terrible at everything. dwazegek fucked around with this message at 18:55 on Nov 7, 2014 |
# ? Nov 7, 2014 18:49 |
|
No Safe Word posted:I thought this was only the purview of commit messages, didn't realize it also extended to variable names for some. I was making a site for a friend and using GitHub pages for it since he didn't have the permanent webspace up yet, and that requires a commit if you want to upload changes to the web, so all the experimenting resulted in a bunch of commits in a row: code:
|
# ? Nov 7, 2014 19:06 |
|
No Safe Word posted:I thought this was only the purview of commit messages, didn't realize it also extended to variable names for some.
|
# ? Nov 7, 2014 19:06 |
|
I just wrote a small function yesterday that returns $rear end. I'm leaving it. The function argument was $arr so it seemed like a logical progression, sort of like iterators: i, j etc. Which now, has me thinking I could just use famous asses for nonsense vars - Iggy, Jlo, Kim...
|
# ? Nov 7, 2014 19:54 |
|
HardDisk posted:Nah, Netbeans is pure poo poo. Last night, my professor was walking us through some code on the projector and when he saved one of his files, Netbeans crashed. When he opened Netbeans up again, every time he selected the file, it would crash. Maybe I remembered it wrong, but I thought I preferred it to eclipse.
|
# ? Nov 7, 2014 20:11 |
|
One more.Java code:
Java code:
|
# ? Nov 7, 2014 20:26 |
|
substitute posted:I just wrote a small function yesterday that returns $rear end. I'm leaving it. https://github.com/numpy/numpy/blob/master/numpy/core/src/multiarray/iterators.c#L960
|
# ? Nov 7, 2014 20:37 |
|
Xenoveritas posted:One more. What does it return if S1.length() == S2.length()? On a somewhat similar note, I found this yesterday: C# code:
In case you're not familiar with .NET nullables, this gives the exact same results as the default equality comparer; I guess writing d1 == d2 was too easy.
|
# ? Nov 7, 2014 20:43 |
|
|
# ? May 17, 2024 15:29 |
|
dwazegek posted:What does it return if S1.length() == S2.length()? At that point it falls through and does what it says it does. Although it uses String.codePointAt(int) at each index instead of String.charAt(int) which I'm pretty sure is completely pointless because surrogate pairs are set up so that they'd sort lexicographically correctly even without being unpacked. But I'm willing to give that a pass as that involves knowing the difference between characters and code points.
|
# ? Nov 7, 2014 20:48 |