|
Flobbster posted:Not to mention the use of NSArray to store integers makes me want to scratch my eyes out, since it means you have to wrap them in NSNumbers and make everything even more verbose by boxing/unboxing them. I can't really tell exactly what the reason for the NSNumbers but it's likely due to using a NSMutable array which was named and made for something completely different.
|
# ? May 11, 2009 19:52 |
|
|
# ? May 14, 2024 12:38 |
|
Avenging Dentist posted:Given that people make functions called doit or run in Java, yes.
|
# ? May 11, 2009 20:32 |
|
Avenging Dentist posted:Given that people make functions called doit or run in Java, yes. code:
|
# ? May 11, 2009 22:15 |
|
thesaddestpirate posted:
Um, thank you for agreeing with me that Java is horrible?
|
# ? May 11, 2009 22:19 |
|
code:
|
# ? May 11, 2009 22:31 |
|
Mustach posted:
|
# ? May 12, 2009 09:47 |
|
Zombywuf posted:
This is actually what you get if you just keep hitting Ctrl+Space in Eclipse.
|
# ? May 12, 2009 18:18 |
|
thesaddestpirate posted:
|
# ? May 12, 2009 20:15 |
|
zootm posted:This is not a good example of bad naming in Java, and there are lots of good examples. May I please get some? Been using it for so long, I've never had a problem with Runnable->run, Thread->start, Cloneable->clone (even tho clone is part of Object). And I don't remember ever seeing a bad naming example in Java. Anyhow, back to the topic, here is my code that I found in an application I was tasked to maintain (fix bugs): code:
Anyhow, the rest of the code was just as bad. I want those 2 wasted months in my life back.
|
# ? May 13, 2009 18:31 |
|
Some "developers" don't know of platform agnostic interfaces to system commands...
|
# ? May 13, 2009 18:54 |
|
rhag posted:May I please get some? Been using it for so long, I've never had a problem with Runnable->run, Thread->start, Cloneable->clone (even tho clone is part of Object). The fact that there are multiple, differently-named methods in Java that amount to "doit()" is pretty bad. For as much poo poo as operator overloading gets, at least with using the call operator, you aren't forced to come up with vague method names that vary depending on the specific usage. As for bad naming in general, let's just go through the Javadoc alphabetically, shall we? code:
|
# ? May 13, 2009 19:03 |
|
Triple Tech posted:Some "developers" don't know of platform agnostic interfaces to system commands... Are you suggesting that some dude is trying to avoid hardcoding a WinAPI call in order to stay portable? It is not like del is. Edit: It appears you are, in fact, not. Carry on. Vanadium fucked around with this message at 19:14 on May 13, 2009 |
# ? May 13, 2009 19:04 |
|
Vanadium posted:Are you suggesting that some dude is trying to avoid hardcoding a WinAPI call in order to stay portable? It is not like del is. My guess is the dude who wrote the code doesn't know about the standard calls for deleting a file at all.
|
# ? May 13, 2009 22:27 |
|
It's C++. I do not know any, either.
|
# ? May 13, 2009 22:37 |
|
Avenging Dentist posted:As for bad naming in general, let's just go through the Javadoc alphabetically, shall we? It could be worse. The classes could be abbreviated to AAVV and AQLSync. EDIT: I, of course, mean AAVV6. Don't want to confuse it with the previous five Abstract Annotation Value Visitor classes.
|
# ? May 13, 2009 22:37 |
|
Vanadium posted:It's C++. I do not know any, either. remove()?
|
# ? May 13, 2009 22:53 |
|
I could have sworn that was only POSIX. Hooray for standards.
|
# ? May 13, 2009 23:08 |
|
Seth Turtle posted:It could be worse. The classes could be abbreviated to AAVV and AQLSync. Or you could use something called "namespaces" and allow people to apply using declarations to minimize verbosity. A radical idea, I know.
|
# ? May 13, 2009 23:53 |
|
Avenging Dentist posted:Or you could use something called "namespaces" and allow people to apply using declarations to minimize verbosity. A radical idea, I know. Am I weird for not finding those names...bad? I don't see the problem with a 20 character long class name. I mean, I would have had such a problem back in Borland C++ 3.1 days, but today, with today's IDE's, its all a CTRL+space away.
|
# ? May 14, 2009 00:57 |
|
rhag posted:Am I weird for not finding those names...bad? I don't see the problem with a 20 character long class name. I mean, I would have had such a problem back in Borland C++ 3.1 days, but today, with today's IDE's, its all a CTRL+space away. Yes. You are weird. It's not even about typing them, it's about reading them. Anything nontrivial with any of those functions (and given Java's propensity for verbosity, that's 99% of things) is going to be spread out on multiple lines or will just scroll horizontally off the screen. A good sign that your code is poo poo is when a majority of the individual statements have to wrapped to fit on the screen.
|
# ? May 14, 2009 01:13 |
|
Avenging Dentist posted:Yes. You are weird. It's not even about typing them, it's about reading them. Anything nontrivial with any of those functions (and given Java's propensity for verbosity, that's 99% of things) is going to be spread out on multiple lines or will just scroll horizontally off the screen. A good sign that your code is poo poo is when a majority of the individual statements have to wrapped to fit on the screen. Aha , I see it now. So at the end of the day its just a matter of taste. I hate it when I see cryptic code, even if it has comments. I love it when I can "read" the code, even without comments. And no, don't give me the 80 columns crap. Nobody nowadays has an 80 col limitation, upgrade your drat monitor if you do, so no, there is no need to wrap on multiple lines most of the statements. If you can't upgrade your monitor and are forced to use an 80x25 screen...don't do Java. Plain and simple. Most likely the stuff you're doing (with those limitations) is not appropriate for Java. It is just a matter of taste. Even though I program in C just as much as I do in Java, I like the Java style more. I like to comment the algorithm used, not the fact that I just wrote in one line the most complicated code ever. So , sorry sir, those class names are fine.
|
# ? May 14, 2009 01:43 |
|
rhag posted:And no, don't give me the 80 columns crap. Nobody nowadays has an 80 col limitation, upgrade your drat monitor if you do, so no, there is no need to wrap on multiple lines most of the statements. You're one of those retarded people who maximizes all their windows, aren't you.
|
# ? May 14, 2009 01:44 |
|
If you don't program with (at least) 2 columns of code side-by-side, you are not a real programmer.rhag posted:don't do Java The only true statement in that entire post.
|
# ? May 14, 2009 01:51 |
|
shrughes posted:You're one of those retarded people who maximizes all their windows, aren't you. Hell I do and I still have an 80-column limitation.
|
# ? May 14, 2009 01:53 |
|
No Safe Word posted:Hell I do and I still have an 80-column limitation. Newspaper/magazine articles have short columns for a reason: it's easier to read.
|
# ? May 14, 2009 01:57 |
|
Get bent, use a REAL editor with indented wrapping...
|
# ? May 14, 2009 01:58 |
|
Oh christ, if there is any language that does not need a secret cabal of elitist programmers, it is Java. Anyway, Java is prolix. Three root causes of this: 1. Java culture encourages it. Package names are ridiculously prolix, but at least those are usually hidden at the top of the file. Whole-word naming conventions just inevitably pile up appositional modifiers; if it's worse in Java, it's only because the language makes it so easy to over-abstract every problem. 2. The import system lacks shortened qualified import, which turns name collisions into minor catastrophes (because everyone uses prolix package names), which means you see some really silly workarounds like Swing's J prefix on every single class in the library. 3. There are several missing language features that force/encourage you to name things that don't really need names, like all the silly interfaces required by the lack of first-class functions, and the AbstractFoo variants to provide default implementations for interface functions.
|
# ? May 14, 2009 02:37 |
|
rjmccall posted:2. The import system lacks shortened qualified import, which turns name collisions into minor catastrophes (because everyone uses prolix package names), which means you see some really silly workarounds like Swing's J prefix on every single class in the library. This was my favorite part of reading through the Javadoc. C++ has an awful "package" management system, and even it can avoid the old-school C way of applying prefixes to identifiers to avoid name collisions. Any language made after C just has no excuse for that.
|
# ? May 14, 2009 02:52 |
|
The really terrifying thing is the people who take this horrible name-resolution hack and apply it in their own projects as if there were some deeply legitimate design principle behind it.
|
# ? May 14, 2009 02:57 |
|
rjmccall posted:really silly workarounds like Swing's J prefix on every single class in the library.
|
# ? May 14, 2009 03:06 |
|
rjmccall posted:2. The import system lacks shortened qualified import, which turns name collisions into minor catastrophes (because everyone uses prolix package names), which means you see some really silly workarounds like Swing's J prefix on every single class in the library. We like to complain about the long typenames in Java, but it's sad that Sun gets it wrong even when they try to use short names too: java.util.List java.awt.List The only saving grace is that no method in java.awt.List seems to manipulate a java.util.List. But still, if you wanted to use both in the same compilation unit (something that could be quite likely), you're stuck fully qualifying at least one of them everywhere. Was this moronic naming (instead of something like ListBox or ListView for the UI component) just Java puffing up their chest and saying "look, packages are cool "? Fake edit: Oh god! Since it subclasses java.awt.Component, it has a list() method that does the incredibly useless task of printing a debugging description of the component to a stream! code:
|
# ? May 14, 2009 04:04 |
|
shrughes posted:You're one of those retarded people who maximizes all their windows, aren't you.
|
# ? May 14, 2009 14:03 |
|
Rottbott posted:Who doesn't make use of all the available screen space? Unless you're working on a single monitor, which is daft. This is the proper layout of a programmer's two screens. - SA Forums takes up 50% of the right screen. - The other half of the right screen is two folder windows. One for your workspace, the other for your backup space, or if you've got SVN, your external harddrive. - Half of the left side is YouTube, Hulu, or whatever. - A quarter of the left side is a DOS window or some other command line prompt. - The remaining quarter of the left screen is your IDE or text editor for coding.
|
# ? May 14, 2009 15:00 |
|
Seth Turtle posted:This is the proper layout of a programmer's two screens... Not quite. 1. Your development machine has its screen saver up. (Who cares what windows are up on that thing?) 2. Your personal machine to your left has SA forums up with youtube hidden underneath that window in case your boss walks in.
|
# ? May 14, 2009 15:58 |
|
rjmccall posted:2. The import system lacks shortened qualified import, which turns name collisions into minor catastrophes (because everyone uses prolix package names), which means you see some really silly workarounds like Swing's J prefix on every single class in the library.
|
# ? May 14, 2009 19:08 |
|
Rottbott posted:Who doesn't make use of all the available screen space? Unless you're working on a single monitor, which is daft. If you have an 80 character column limit you'll have less screen area devoted to large swaths of empty space. Because you can have more files open side by side.
|
# ? May 15, 2009 00:02 |
|
Avenging Dentist posted:The fact that there are multiple, differently-named methods in Java that amount to "doit()" is pretty bad. For as much poo poo as operator overloading gets, at least with using the call operator, you aren't forced to come up with vague method names that vary depending on the specific usage. Thread is a thread, Runnable is a functor that you put in threads. Would you like ThreadFunctorActionier instead?
|
# ? May 15, 2009 06:56 |
|
Brain Candy posted:Thread is a thread, Runnable is a functor that you put in threads. Would you like ThreadFunctorActionier instead? Thanks for not reading what I wrote?
|
# ? May 15, 2009 06:59 |
|
Avenging Dentist posted:Thanks for not reading what I wrote? Thanks for responding with a thoughtful and/or informative post!
|
# ? May 15, 2009 13:07 |
|
|
# ? May 14, 2024 12:38 |
|
shrughes posted:If you have an 80 character column limit you'll have less screen area devoted to large swaths of empty space. Because you can have more files open side by side. Then again, without any rule people do go over the top. I just found an single line 360 columns wide: code:
|
# ? May 15, 2009 13:34 |