Results 1 to 11 of 11
Thread: Naming conventions
- 07-17-2008, 12:48 AM #1
Naming conventions
Hello everyone.
When I was in school and also at varsity I have seen weird and wonderful variable names. Some are cryptic and others are ridiculous. Then there's Microsoft's way. Look at DirectX API and then you will see what I mean.
Cryptic
RidiculousJava Code:int[] a = new int[10]; for (int b = 0; b < 10; b++){ a[b] = b; }
Microsoft DirectX's APIJava Code:int[] chicken = new int[10]; for (int egg = 0; egg < 10; egg++){ chicken[egg] = egg; }
I feel that there must be some universal standard out there. Like java beans for example. They are nice. I found this article on naming conventions. Any opinions on this matter?Java Code:int[] another_array_of_integers = new int[10]; for (int a_specific_index = 0; a_specific_index < 10; a_specific_index++){ another_array_of_integers[a_specific_index] = a_specific_index; }
Happy coding everyone. :DEyes dwelling into the past are blind to what lies in the future. Step carefully.
- 07-17-2008, 01:07 AM #2
names are not code
I hate any and all naming conventions of any kind, they bring in people who do not respect the Krell Empire for it's true place. Whenever starting a few pages of code I go to hotbits to get variable names. A pair of round braces, followed by some semicolons, is the only naming needed. What the code does is what the code does, the label to identifiy the method call is just an excuse for people to talk about something because they do not code on 200 character lines.
I don't mind the hammer I got in intro, but please let me have this one. You asked a question, I strongly feel this way.
I get boxes hung all the time because of poor code that is Fabulously Styled - Google Search
If needed, I yield when and where the code actually works and method naming is done for maintainablility.Introduction to Programming Using Java.
Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor
- 07-17-2008, 01:34 AM #3
Thank you Nicholas Jordan. This is the first time I heard someone say that about naming conventions.
I feel that these names personalize the machine. At my university lecturers are considering graphical programming. So much for old fashion text. :pEyes dwelling into the past are blind to what lies in the future. Step carefully.
- 07-17-2008, 04:01 AM #4
No, there are no "universal" naming conventions, and there never can be. There are some styles that Sun uses in their API and example code. These are generally accepted and widely used.
There might be a 'universal' convention as soon as there is a universal programming language. Hint: Java isn't it.
The purpose of naming conventions it human communications. Noting more. If you write and use your own code, you can invent what you want.
If you want to be able to have someone else help you, you should use the naming (and all other conventions) of the language. This helps information transfer between humans. If you do it properly, someone can look at your code and know that you use a Connector object and call a send() function.
The more people you have working on a piece of code, the more important conventions are. This includes naming conventions, commenting conventions, testing conventions, etc.
Doing this well is actually hard.
- 07-17-2008, 06:01 PM #5
krell reported to be ficticious
Nick
Most of those people work in projects where such things as relying on an interface, using simplfied naming that conveys what the data collection does is the only thing that will work.
My approach is better suited to a technician with a test meter and some thirty pounds of bench manual close by.
I knew that, I meant no harm. You asked a question, my answer would be better suited to an E.E. at a two year technical institution than front line university environment.
<neutral>Obviously, or you would not have asked the question. </neutral>
<hope>Maybe you can get me going on xml</hope>
Well, you have me here. Brain ( as in human brain - normal definition ) is known to work better in abstractions and visual /graphic. I position myself such that I am oblidged to take your offer of investigation seriously.
Define old fashioned.
Java Code:while(true)System.out.print(" :p ");//Introduction to Programming Using Java.
Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor
- 07-17-2008, 10:36 PM #6
Empty Comments
Hello Nicholas Jordan
I've noticed that you add empty comments in your code. Why do you do this?
I like the program output though. ;)
Originally Posted by Nicholas Jordan Eyes dwelling into the past are blind to what lies in the future. Step carefully.
- 07-21-2008, 03:11 AM #7
spare me oh green guy!
Really, no bull? Because you actually want to hear the answer?
You have to promise me immunity under the General Ratified Ratraps Ratification Rating Redundancy Rattle becuse ~ I can promise you this ~ you will not believe me.Introduction to Programming Using Java.
Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor
- 07-24-2008, 12:54 PM #8
I thought you did it for some technical reason. For example, an extra star distinguishes comments from JavaDoc.
Originally Posted by tim
That hurts Nicholas. :( Goodbye.
Originally Posted by Nicholas Jordan Eyes dwelling into the past are blind to what lies in the future. Step carefully.
- 07-24-2008, 02:55 PM #9
I use them because they are the fastest buffer / editor combination I could find, when I am running at my natural data rate I have to make room for the system command stack. It is extremely common for me to have to slow down as I move across the page because I drop things out of the buffer. Once I saw [[[[ in the browser momentarily, it remains for me to find where that came from.
Does it bother you to be Green?Introduction to Programming Using Java.
Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor
- 07-29-2008, 03:10 AM #10
- 11-16-2008, 09:27 PM #11
Member
- Join Date
- Nov 2008
- Posts
- 23
- Rep Power
- 0
Similar Threads
-
Naming a Class
By Java Tip in forum Java TipReplies: 0Last Post: 12-22-2007, 11:21 AM -
RMI naming problem
By Robbinz in forum New To JavaReplies: 1Last Post: 12-06-2007, 11:32 PM -
Naming conventions
By Java Tip in forum Java TipReplies: 0Last Post: 12-03-2007, 09:53 AM -
namespace conventions from sun....
By money123 in forum New To JavaReplies: 3Last Post: 07-31-2007, 05:44 AM -
error in JNDI naming
By jitendra.ibs in forum Java ServletReplies: 0Last Post: 06-08-2007, 05:23 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks