Looks cool, except:
> Versions of GRASP for Java, Windows, Linux, and various Unix Systems are available
Do they think Java's an OS?
Looks cool, except:
> Versions of GRASP for Java, Windows, Linux, and various Unix Systems are available
Do they think Java's an OS?
-Govtcheez
[email protected]
Java is an OS, isn't it?Originally posted by Govtcheez
Looks cool, except:
> Versions of GRASP for Java, Windows, Linux, and various Unix Systems are available
Do they think Java's an OS?
PLEASE tell me you are kidding... PLEASE!!?!?!?Originally posted by Brian
Java is an OS, isn't it?
JavaOS
no crap....
http://www.sun.com/smi/Press/sunflas...529.11819.html
Never heard of it before..
See the post called Operating Systems.
[CODE]
int main () {
//whatever
return 0;
}
CODE]
The problem there is if you have many loops inside each other, if you have four opening brackets before the first closing bracket then things can get quite confusing.
for(loop)
{
for(loop)
{
//Do this
if(I die)
{
//do I goto heaven or hell?
{
//I goto heaven
}
else
{
cout<<"Sucked in pal!"
}
}
//Am I wounded?
{
//Scream out for mummy (Australian spelling so get nicked guv )
}
}
else
{
//Start running
}
}
James
My site to register for all my other websites!
'Clifton Bazaar'
In C++ I do this
#include <iostream.h>
int main(int argc, char* argv[])
{
return 0;
}
+++
++
+ Sekti
++
+++
I have rarely seen this and could anyone explain what and why there is int argc and char* argv[] ?Code:int main(int argc, char* argv[])
My site to register for all my other websites!
'Clifton Bazaar'
argc is the number of command line arguments and *argv[] is a character array containing the programs name and command line arguments.
argv[0] = the program's path
argv[1] = the first argument
and so on
Well, nowadays, there are four most popular techniques of coding that are acceptable, encouraged and used in developing softwares:
the first technique is the K&R that looks like this:
if (cond) {
stmt1;
stmt2;
...
}
the second technique is called the Allman technique that goes like this:
if (cond)
{
stmt1;
stmt2;
...
}
the third would look like this:
if (cond)
{
stmt1;
stmt2;
...
}
and is called Whitesmith.
Finally, the fourth most popular technique is the following and is known as Alternative:
if (cond) {
stmt1;
stm2;
...
}
The kernighan and Ritchie style(#1) is the most widely used style since it uses slightly less vertical space than other methods. On the other hand many, like Brian, feel that it is more burdensome to match up braces with this technique.
#2 and #3, the Allman and the Whitesmith styles are often preferred by programmers specially those who have done programming in pascal. The brace matchin is easy but extra vertical space is used.
finally #4 is a very popular alternative to standard D&R formatting.
What is important, Brian, is consistency. You pick any one of the acceptable styles and make sure you are consistent.
Remember, a good programer is the one who "Writes programs for people first, computers second". So make sure your code is readable.
tnx,
ben
p.s. if my codes dont look the way they should, then please let me know how to use the special editor. I will post the 4 techniques again in that case. thanks
yes, unfortunately they didnt, so please let me know where to get the editor that you guys have been using.
thanks again.
ben
To have code displayed as it should be, use code/endcode markers. I suspect if I draw them, they will be interpreted so I will describe them!!! An opening code marker consists of the word code placed inside square brackets, the end code marker is /code in square brackets.
Generally:
A number of people have asked me to dig up the studies I referred too above. This I will try to do. I recall at least two of them were conducted at US universities. I had all this stuff in a file, which it would seem, I have "misplaced" or possibly has been "borrowed" by one of my colleagues. I would have thought a google search would find it though - that is what I'll be doing if I can't find the reports!
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
i code
if(cond)
{
cout<<"LINE1";
cout<<"LINE2";
}
else
{
cout<<"LINE3";
cout<<"LINE4";
}
except in switch-case statements where i do
switch(var)
{
case 1:
cout<<"HIT TAB AND START SECT 2";
break
case 1:
cout<<"HIT TAB AND START SECT 2";
break
}
sometimes in multiple if-else i do
if(cond1)
{
if(cond2)
{
if(cond3)
{
}
}
}
bracket matching can give serious headaches...
-
Thanks to adrian, I am able to show you the four techniques once again, (I hope it works i mean...)
#1) K&R
Code:if (cond) { stmt1; stmt2; ... }
#2) Allman
Code:if (cond) { stmt1; stmt2; ... }
#3) Whitesmith
Code:if (cond) { stmt1; stmt2; .... }
#4) Alternative
I hope it works this time!Code:if (cond) { stmt1; stmt2; ... }
tnx,
ben