|
Part of the codebase at work was all last changed by someone who worked here before me, and every single if statement looks like this:code:
|
# ? Aug 15, 2016 11:25 |
|
|
# ? Jun 5, 2024 04:56 |
|
Student or developer with 4+ years of experience? You decide.code:
|
# ? Aug 15, 2016 15:01 |
|
I'm guessing a very weird assembly programmer? Like he's trying to do mov eax, dword ptr [ptr + ecx * 4]. I do stupid type stuff like that sometimes after working in assembly a lot, but not quite to that degree. Also parenthesis ...
|
# ? Aug 15, 2016 16:08 |
|
Well ok it's Monday, let me take a look at that other project boss man wants me to clean up.code:
|
# ? Aug 15, 2016 16:18 |
leper khan posted:Well ok it's Monday, let me take a look at that other project boss man wants me to clean up. Yikes, piping to wc -l instead of using grep's -c option definitely qualifies as a horror.
|
|
# ? Aug 15, 2016 17:19 |
|
VikingofRock posted:Yikes, piping to wc -l instead of using grep's -c option definitely qualifies as a horror. More or less of a horror than going through the effort to memorize every flag for every marginally useful Unix utility?
|
# ? Aug 15, 2016 18:41 |
|
leper khan posted:More or less of a horror than going through the effort to memorize every flag for every marginally useful Unix utility? Really, the only flag you need to know is --help. The rest takes care of itself from there.
|
# ? Aug 15, 2016 18:46 |
|
VikingofRock posted:Yikes, piping to wc -l instead of using grep's -c option definitely qualifies as a horror. cat -v considered harmful
|
# ? Aug 15, 2016 19:09 |
|
Edward_Tohr posted:Really, the only flag you need to know is --help. The rest takes care of itself from there. code:
|
# ? Aug 15, 2016 19:28 |
|
Which brings us to the second "flag" you need to know: "man echo" . For more detailed information, you can always check the info pages as well.
|
# ? Aug 15, 2016 19:41 |
leper khan posted:More or less of a horror than going through the effort to memorize every flag for every marginally useful Unix utility? Touché, although I was just being snarky there. Lack of encapsulation is obviously a much bigger horror (in what I'm assuming is a Java or C++ context).
|
|
# ? Aug 15, 2016 19:53 |
|
Suspicious Dish posted:cat -v considered harmful cat-v.org considered tiresome.
|
# ? Aug 15, 2016 20:06 |
|
Volguus posted:Which brings us to the second "flag" you need to know: "man echo" . For more detailed information, you can always check the info pages as well. Except echo is also a built-in, so you need "help echo".
|
# ? Aug 15, 2016 20:13 |
|
leper khan posted:More or less of a horror than going through the effort to memorize every flag for every marginally useful Unix utility? Plus, piping together a "text finder" utility and a "word count" utility seems more in line with ~~~~~THE UNIX PHILOSOPHY~~~~~ than using a flag which tells the text finder to do a word count.
|
# ? Aug 15, 2016 20:35 |
|
code:
easiest optimisation opportunity ever, but gently caress the guy who made me have to find it
|
# ? Aug 15, 2016 21:00 |
|
The expense is mentioned right in the function name, it's your own drat fault.
|
# ? Aug 15, 2016 23:34 |
|
fritz posted:cat-v.org considered tiresome. I always felt like the Peoples Front of Cat-V seemed like it was a spin-off of SA. I could be entirely wrong though.
|
# ? Aug 15, 2016 23:50 |
|
VikingofRock posted:Yikes, piping to wc -l instead of using grep's -c option definitely qualifies as a horror. No, -Rc is useless garbage. I don't care how many frickin' object files have :0 and polluting my output with every single one of them obscures the .cpp's which might actually have :1 or :2. -Rc also doesn't sum across the files and give you the total across all of them, which piping to wc -l does. Basically, I don't think you thought his offhand joke all the way through.
|
# ? Aug 15, 2016 23:50 |
|
leper khan posted:Well ok it's Monday, let me take a look at that other project boss man wants me to clean up. What language is this? C++ class members are private by default so there could be lots of private stuff without actually using the keyword?
|
# ? Aug 16, 2016 00:58 |
|
vOv posted:It's perfectly legal to overload operator== in C++ to return whatever type you want, though I don't know why you'd want to. JawnV6 posted:No, -Rc is useless garbage. I don't care how many frickin' object files have :0 and polluting my output with every single one of them obscures the .cpp's which might actually have :1 or :2. -Rc also doesn't sum across the files and give you the total across all of them, which piping to wc -l does.
|
# ? Aug 16, 2016 01:00 |
|
Maw posted:Part of the codebase at work was all last changed by someone who worked here before me, and every single if statement looks like this: The first one is unorthodox but not completely insane, but (condition) ? true : false is completely inexcusable.
|
# ? Aug 16, 2016 01:01 |
|
HappyHippo posted:What language is this? C++ class members are private by default so there could be lots of private stuff without actually using the keyword? Hopefully something like java.
|
# ? Aug 16, 2016 01:11 |
|
HappyHippo posted:What language is this? C++ class members are private by default so there could be lots of private stuff without actually using the keyword? Now you have me imagining a Java programmer trying to code in C++ without bothering to understand the differences, just slapping down java code and changing it until it compiles. code:
|
# ? Aug 16, 2016 06:30 |
JawnV6 posted:No, -Rc is useless garbage. I don't care how many frickin' object files have :0 and polluting my output with every single one of them obscures the .cpp's which might actually have :1 or :2. -Rc also doesn't sum across the files and give you the total across all of them, which piping to wc -l does. Wow, I never thought about that stuff--I thought they were totally equivalent. Interesting. ...I knew my offhand joke should have been about using ag instead.
|
|
# ? Aug 16, 2016 07:16 |
|
HappyHippo posted:The first one is unorthodox but not completely insane, but (condition) ? true : false is completely inexcusable. Well now... which one is the first one there?
|
# ? Aug 16, 2016 08:04 |
|
dougdrums posted:I'm guessing a very weird assembly programmer? Like he's trying to do mov eax, dword ptr [ptr + ecx * 4]. I do stupid type stuff like that sometimes after working in assembly a lot, but not quite to that degree. Also parenthesis ... The guy's real problem is that he's always in a big hurry to get nowhere. He sacrifices quality in horrible ways to save a couple of hours writing the code, even though the negative effect of those shortcuts compounds into days or weeks of extra work later down the line.
|
# ? Aug 16, 2016 11:32 |
|
HappyHippo posted:What language is this? C++ class members are private by default so there could be lots of private stuff without actually using the keyword? Java, which defaults to package visibility. Also it's Java, which is not generally pleasant for myriad reasons. This project is a special kind of bad though.
|
# ? Aug 16, 2016 12:58 |
|
Klades posted:Now you have me imagining a Java programmer trying to code in C++ without bothering to understand the differences, just slapping down java code and changing it until it compiles. This programmer is not imaginary
|
# ? Aug 16, 2016 14:56 |
|
csammis posted:This programmer is not imaginary Or one of a kind.
|
# ? Aug 16, 2016 15:17 |
leper khan posted:Also it's Java, which is not generally pleasant for myriad reasons. This project is a special kind of bad though. I hear this a lot, but I've never heard why.
|
|
# ? Aug 16, 2016 15:53 |
|
ChickenWing posted:I hear this a lot, but I've never heard why. Java's big problem is with verbosity. Everything is a class, which means that any time you want to have custom behaviors, you have to define a new class to attach the behaviors to. Thus for example (prior to Java 8) if you wanted to declare some logic to execute when a button is clicked on, you would do something like this: code:
code:
|
# ? Aug 16, 2016 16:05 |
|
ChickenWing posted:I hear this a lot, but I've never heard why. Hey man, I like C++, and Java is missing a bunch of niceties I have there. Also a nonzero number of our Java projects must be checked out in the root of a drive on windows due to path length limitations. I am thankfully not on any of them.
|
# ? Aug 16, 2016 16:05 |
TooMuchAbstraction posted:Java's big problem is with verbosity. I find Java code very hard to read for this reason. Everything is such a mess of classes, qualifiers and methods that is difficult to separate the boilerplate from the 'meat' of the code. You then have to extensively comment it, which makes the code even more verbose... In my opinion, Java is: - difficult to write and read - easy to screw up - slow But I have only worked with Java at a very basic level and am not really qualified to criticize it on more than a surface level.
|
|
# ? Aug 16, 2016 16:41 |
|
Java isn't really notably slow (depends on what/how you're comparing, of course), but even though I spent at least a year doing Java exclusively on top of here and there over time...I still find it hard to visually parse quickly. However I tend to think this is some path-dependence issue wherein my brain got used to looking at python code in my formative years and is now stuck with looking at code in one way.
|
# ? Aug 16, 2016 16:51 |
|
Thermopyle posted:Java isn't really notably slow (depends on what/how you're comparing, of course), but even though I spent at least a year doing Java exclusively on top of here and there over time...I still find it hard to visually parse quickly. Eh, I started with Python and Java at the same time and currently the language I like to write and read the most is C++ , followed by Python, C# and Java can gently caress right off.
|
# ? Aug 16, 2016 17:02 |
|
There are, yes, numerous verbosity complaints about Java, but the IDEs have largely fixed all/most of them. Any half-decent IDE would automatically generate the ActionListener boilerplate, or the setters/getters or toString/hashCode/equals methods. Java 8's lambdas are, in my opinion, even more dependent on the IDE, since it is not clear from the code what type of argument the lambda gets. As for reading it, that comes down only to practice. I find reading Python code quite the workout, for example. Is this line belonging to this block or the one above it? Is that a space or a tab or are my settings messed up? Did you mean to put that space in there or was it a mistake? What does this module do? Just like in Java 8: "lambda event: do something", what is that event? What members does it have and what can it do for me? Without an IDE I am completely lost.
|
# ? Aug 16, 2016 17:05 |
|
Java's no inherently worse than any other language, but it does seem to be the lingua franca of "coders" who see programming less as a creative expression of sound engineering principles, and more as glorified paperwork---the software counterpart to pencil-pushing-bureaucrat-types whose definition of "good idea" is "follows the established procedure". It's hard to find beauty in a joyless world. Scala must be what Java programmers see when they dream at night...
|
# ? Aug 16, 2016 18:01 |
|
Volguus posted:There are, yes, numerous verbosity complaints about Java, but the IDEs have largely fixed all/most of them. Any half-decent IDE would automatically generate the ActionListener boilerplate, or the setters/getters or toString/hashCode/equals methods. Doesn't help with the complaint about reading the code though. Plus, to my mind a language that requires an IDE to generate massive chunks of code for you to be usable is not a very good language.
|
# ? Aug 16, 2016 18:21 |
|
I'm trying to comb straight a pile of spaghetti so bad it's got looms making fabric out of it. The "holy poo poo" of the day: code:
globals everywhere, iterating over the same thing n^2 times (right?)
|
# ? Aug 16, 2016 18:28 |
|
|
# ? Jun 5, 2024 04:56 |
|
"Easy to read" is pretty meaningless, since even something as simple as the reason for reading the code changes how easy it is to read. You've got some Java code that's covered in annotations and aspect-oriented programming techniques; is it easy to read? When you're checking out the structure of a database model class, it's easy to read. When you're running into mysterious performance problems and need to figure out where the issue is, but you can't even figure out why a particular method is executing before another method, then it's hard to read. The reverse is true when you're mired in boring, strictly non-magical boilerplate.
|
# ? Aug 16, 2016 18:44 |