Are you trying to say that you're solely dependant on how your IDE indents your code in order to have it indented?Originally Posted by John_
Try writing C++ in notepad.
Are you trying to say that you're solely dependant on how your IDE indents your code in order to have it indented?Originally Posted by John_
Try writing C++ in notepad.
Sent from my iPadŽ
It's really depend on how you want your program to read like.
In my company, we've coding standards for Java, and C++.
For Java, we follow your first example, and for C++, we follow your second example.
There's actually a Sun Microsystem recommanded Java Convention that you can found online.
The site is Java Convention
-dc
That way you can debug see each line as your scroll down thousands of spaces XD.Code:int main() { cout << "Hi"; cout << "Bye"; }
Code:Error W8057 C:\\Life.cpp: Invalid number of arguments in function run(Brain *)
What I meant is that 7stud said they lack indentation, but I was wondering what he meant by it. Like for example if we were writing code in notepad, wouldn't all methods lack indentation unless we added it ourselves.Originally Posted by SlyMaelstrom
Or if he meant using certain methods the IDE wont indent code properly, in which case I was asking if this comes down to just the IDE.
Basically I was just asking him to clarify what he meant so I can learn from it
Style is generally added by "ourselves". (At least in the "old days".)Originally Posted by John_
This might be an example of what was meant.
vsCode:class myClass { public: void function(); };But I used a beatufier and some editing to force it to my preference(s).Code:class myClass { public: void function(); };
An IDE helps to put things how the programmer chooses (if it's a good one), rather than limiting the programmer to what it chooses. But again, it should be the programmer calling the shots.
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
See what happens when you mention these on a programming forum? I hope you learned your lesson.Originally Posted by swgh
Next topic. Square brackets.
I personally use this method:
*nyuck nyuck*Code:int arry[ 3 ];
Sent from my iPadŽ
Aw, heck, let's start 2 holy wars in one thread! Use vim! *dons flame-proof suit*Originally Posted by SlyMaelstrom
Unless it's a Python or Pascal forum of courseOriginally Posted by Rashakil Fol
But then in Python you get people arguing over using tab characters or spaces.Originally Posted by jwenting
Omg spaces > Tab. Its a proven fact. First off, a tab brings to many spaces, its like this: 1. But a space, is so nice! Its like this: 1. See? Its so much better, and in code:
But with tab...Code:int main() { cout << "Hi"; }
*pukes*Code:int main() { cout << "Hi"; }
So, I conclude Tab < space, because space not only provides more control, but I use it. . (The holy war begins again lol)
Code:Error W8057 C:\\Life.cpp: Invalid number of arguments in function run(Brain *)
I always use tabs, that is after setting my IDE so it will automatically convert a tab to 2 spaces .
real programmers use a mixOriginally Posted by Rashakil Fol