valentin
Unregistered
|
|
I would like to support your words. Implementation inheritance and compisition are workhorses of CODE REUSE in OOP, I'd say copy&paste is evil. Furthermore, underscore_naming_convention results in longer identifiers, more code .
|
SimonR
Unregistered
|
|
I've found this discussion interesting. For me, brand new to java development i find myself asking the following question: For new java code, should iUseUnderscores which would be_different_to_all_existing code in my companies system which has been developed over 10 years in MS Access, Oracle PL/SQL, Coldfusion, PHP and VB? Then for instance empNo would refer to emp_no in the database. Its interesting to note that Oracle in thier JDeveloper IDE, convert database field_names to fieldNames in the generated classes. I guess i should follow the convention of the whole system as languages and trends come and go but companies may be last a bit longer. On the other hand, one thing I liked about mixedCase when using VB.Net was that when you typed a variablename it would validate the name and convert it to variableName giving you instant feedBack that you typed it good. cheers, Simon.
|
Anonymous
Unregistered
|
|
You didn't get mozart complaining about the way specific notes appeared on a score...you guys who complain about variable names are just a bunch of f@cking, useless losers and its people like you who need to get a life...if any is a moron its the knob who complains and winges all day but does little else...get a f@cking life!!!
|
Anonymous
Unregistered
|
|
Quote:
I know many languages, and I follow the conventions of each, instead of my own, as you do. There's no way you will win this argument. Long-held conventional usage in C does not represent long-held conventional usage in Java.
The Java naming standards have been around since the first release, making it a good eight years or so that they've been in force. You are certainly a horrible speller, and I can understand your desire to pass your names through a spell checker. Still, you could always filter the code for release, or filter it before passing it through a checker, even better.
Who the flying [censored] cares!? Seriously, you guys here dissing his article just because of his particular naming convention are feckin idiots. You can't seem to find anything substantive to argue about regarding his article, so you [censored] nitpick? WTF is that? YOU people are such the problem in the IT industry - [censored] know-it-alls. Get off your [censored] high horse and maybe you'll learn something new (instead of losing your job to someone in India).
Get a life,
-- Jerome Brown
|
Unregistered
|
|
Just like the meaning of life, it's not the actuall meaning of life that interesting, but the reason why we want to know, this discussion is also interesting because people for some odd reason really want's to follow some standard.
As it has already been said loads of times, any naming convetion you prefer will do. Ofcourse if a package has mixed conventions it's properbly not a good thing (you have mixed convetions in the same code, and using it requires you to look up the interfaces all the time...). One project should have one convetion. Other than that any convetion that is legal, should be fine.
PERSONALLY, i use underscored names. I find it easier to read and sine code should be easier to read than to write (you should only have to write good code once, but it may be read by many people many times). C++ was actually designed with this in mind: simplify the language; make the compiler more complex -- never the other way around (ofcourse any simplication versus any complexity is not a good thing). This is also why OO even works: the complex bits are hidden, and you only need to know what you need to use: I don't know a hell of a lot of the java classes, but I know the syntax and where I can look them up and I can quickly figure out how to use them.
I strongly disagree on the article's point in that extends are evil. Interfaces can be simulated (well, in C++ they can, which is what I usually write my code in -- I still haven't had the need for anything like this in java), by simply having every method being virtual. This works pretty well and an interface keyword is really redundant because of this. Ofcourse, having an interface keyword make's it more clear just is going on.
|
Che Re
Unregistered
|
|
May I present my own naming convention: this---is---a---constant (it's easy to read...) and THIS---IS---A---VARIABLE (also easy to read).
You don't like it? You prefer if I make constants in capital letters and variables in lower-case? You don't like the use of hyphens instead of underscores? Why? They are equally clear, three hyphens aren't used for anything else, and three hyphens instead of one underscore makes the separation between the words even greater and makes it even more easy to read.
thisIsAVariable and THIS_IS_A_CONSTANT both follow Java's naming conventions, are shorter, and don't cause unnecessary confusion.
Understanding other perople's code is hard enough without people with overblown egos and their own agendas having to make code-reading even more difficult.
The author of the article is to be commended for an interesting article. However, implementations of his own peculiar ideas about naming conventions have no place in Java examples in a public forum when the article has nothing to do with naming conventions. It should be obvious to him and everyone else that it just causes questions and irritation that removes focus from an interesting article.
I have worked with computers for 24 years. Old ways of doing things, or conventions used in other languages that predates Java may be of historical interest, but disregarding well-established conventions just isn't conducive to the production of well-understood code. The fact that some companies (clients) have their own ideas on how things should be done is no reason to ignore conventions also when one isn't specifically instructed to do so.
|
alphachapmtl
stranger
Reged: 01/20/08
Posts: 1
|
|
I don't like Java naming conventions. "I_find_underscores to be more readable than SquashedTogetherText." I agree with you on that. Specially that a method is supposed to start with a lowercase, which conflict with using an uppercase if the same word is in the middle. So I may have methods with cube or Cube: cube, redCube, cubeOver, cubeDone, redoCube, setCube, turnCube, cubeEmpty. Or methods with consecutive uppercase: doXCircle, doYCircle, circleDone, circleI, circleJ, ICircle, JCircle. In all those cases, using underscores would help.
|
|