Results 1 to 3 of 3
Thread: Formatting inquiries
- 10-18-2012, 02:09 AM #1
Member
- Join Date
- Jan 2012
- Posts
- 49
- Rep Power
- 0
Formatting inquiries
Hello, I have been programming in a couple different languages for about 6 months now. I like to keep everything looking good, and make sure I follow the naming conventions and indenting conventions for each language. So naturally I went to the Oracle website and read through the guide about it all and I just have some questions about it. Specifically about where to put the opening parenthesis.
According to Oracle you should start your methods and statements and all these things like this:
I find this to be hard to follow when the code starts stacking up, and I really prefer to write it like this:Java Code:if(true){ stuff here }
Is it okay that I do this, or should I just bite my tongue and do it the way Oracle says to do it.Java Code:if(true) { stuff here }
Following the same train of thought, they also say to do if statements in a really confusing way, at least to my eyes.
I prefer to write it in the same way as before, with each statement on its own separate line and each parenthesis on its own separate line. Is that okay?Java Code:if(true){ do stuff }else{ do stuff }
One final question, tabs or spaces?Java Code:if(true) { stuff } else { stuff }
All feedback is appreciated. Thanks.Last edited by Reeling; 10-18-2012 at 02:11 AM.
- 10-18-2012, 02:20 AM #2
Member
- Join Date
- Oct 2012
- Location
- Georgia
- Posts
- 7
- Rep Power
- 0
Re: Formatting inquiries
I mean it honestly is just the coders preference I use tabs and spaces sometimes if it becomes misaligned. Also I prefer to write my code like this:
It just makes it look cleaner and organized in my opinion but doing it the other way probably saves more time.Java Code:if(true) { ffff }
- 10-18-2012, 02:42 AM #3
Similar Threads
-
Formatting Output
By Rahim2312 in forum New To JavaReplies: 18Last Post: 05-04-2012, 09:45 AM -
Help with formatting output
By John Lord in forum New To JavaReplies: 1Last Post: 10-31-2010, 12:10 PM -
Formatting jTexfields
By JavaTrouble in forum New To JavaReplies: 33Last Post: 05-28-2010, 12:46 PM -
Number formatting
By gandalf5166 in forum New To JavaReplies: 7Last Post: 03-26-2010, 02:54 AM -
formatting..
By sireesha in forum New To JavaReplies: 16Last Post: 06-26-2009, 07:11 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks