Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > coding style
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 32 Topic 9438 of 10094
Post > Topic >>

coding style

by -Rick- <rick.softly@[EMAIL PROTECTED] > Mar 30, 2008 at 09:41 AM

#include <iostream>
using namespace std;
int main(){
     cout<<"Hello world"<<endl;
     return 0;
}


OR

#include <iostream>
int main(){
    std::cout<<"Hello world"<<std::endl;
    return 0;
}

I've been told many times that the second option is better coding
practice, but I fail to understand why.  I mean, if one had to move to
another namespace in the program, then only then do you have to
change.  The first option, imo, makes the code more readable.
What is this forum's opinion?

--
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 32 Posts in Topic:
coding style
-Rick- <rick.softly@[E  2008-03-30 09:41:46 
Re: coding style
Mateusz Adamczyk <mate  2008-03-30 13:49:01 
Re: coding style
"Daniel T." <  2008-03-30 13:47:19 
Re: coding style
brangdon@[EMAIL PROTECTED  2008-04-01 05:13:16 
Re: coding style
Brian Tyler <brian.tyl  2008-04-01 14:56:42 
Re: coding style
Andre Kaufmann <akfmne  2008-04-03 09:13:05 
Re: coding style
Bart van Ingen Schenau &l  2008-04-03 15:07:46 
Re: coding style
Daphne <lanatha@[EMAIL  2008-04-03 19:34:40 
Re: coding style
dizzy <dizzy@[EMAIL PR  2008-04-04 07:35:43 
Re: coding style
Andre Kaufmann <akfmne  2008-04-04 07:30:24 
Re: coding style
Andre Kaufmann <akfmne  2008-04-04 07:30:38 
Re: coding style
dizzy <dizzy@[EMAIL PR  2008-04-04 07:36:23 
Re: coding style
pzehnder <philipp.zehn  2008-04-04 07:43:05 
Re: coding style
Francis Glassborow <fr  2008-04-04 13:24:35 
Re: coding style
Bart van Ingen Schenau &l  2008-04-04 13:33:47 
Re: coding style
Matthias Buelow <mkb@[  2008-04-05 13:27:22 
Re: coding style
Andre Kaufmann <akfmne  2008-04-05 13:31:38 
Re: coding style
Andre Kaufmann <akfmne  2008-04-05 13:31:44 
Re: coding style
Andre Kaufmann <akfmne  2008-04-05 13:32:27 
Re: coding style
Francis Glassborow <fr  2008-04-06 09:21:49 
Re: coding style
Francis Glassborow <fr  2008-04-06 09:21:29 
Re: coding style
Andre Kaufmann <akfmne  2008-04-06 17:59:09 
Re: coding style
Andre Kaufmann <akfmne  2008-04-06 19:13:07 
Re: coding style
Martin York <Martin.Yo  2008-04-07 10:13:09 
Re: coding style
Sean Hunt <rideau3@[EM  2008-04-07 10:13:10 
Re: coding style
Yongwei Wu <wuyongwei@  2008-04-07 10:43:10 
Re: coding style
Andre Kaufmann <akfmne  2008-04-07 16:36:58 
Re: coding style
Bart van Ingen Schenau &l  2008-04-08 13:43:09 
Re: coding style
"Bo Persson" &l  2008-04-08 13:43:08 
Re: coding style
Andre Kaufmann <akfmne  2008-04-09 13:15:08 
Re: coding style
"Bo Persson" &l  2008-04-09 17:56:14 
Re: coding style
Andre Kaufmann <akfmne  2008-04-10 15:18:52 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 7:56:58 CDT 2008.