Last visit was: It is currently Sun Dec 09, 2018 11:22 pm


All times are UTC-05:00




Post new topic  Reply to topic  [ 23 posts ] 
Author Message
 Post subject: Re: Programming Challenges uplink mod makeing
PostPosted: Sat Aug 21, 2010 11:56 am 
 

Joined: Tue Jun 29, 2010 12:00 pm
Posts: 23
Quote:
Learn C, then C++.

Moving this to Programming General, since it seems better suited for that forum.

And because Tycho does not care.

-- Griffinhart
I think it is not good for begginer to start with C and later move to C++. If he wants to learn C++, then I recommend START WITH C++, not with C. Else he will have habits from C and he will produce C merged with C++ code and the code will be shitty. I can recommend this book for someone, who WANTS to program in C++: http://www.amazon.com/Primer-Plus-5th-S ... 0672326973 It is really good book translated into many languages.


Top
Offline   
 Post subject: Re: Programming Challenges uplink mod makeing
PostPosted: Sat Aug 21, 2010 3:32 pm 
User avatar
 

Joined: Sat Jun 03, 2006 3:51 am
Posts: 1186
Website: http://griffinhart.livejournal.com/
Yahoo Messenger: Squall591
AOL: FinalWarrior591
Location: Look at my horse, my horse is amazing!
Funny, because at my school (DigiPen, pretty well known in the gaming industry for producing really good coders; same school that the Portal team came from), we're taught C our first semester, and then taught C++ the following. We carry over a lot of C stuff because - surprise, surprise - a lot of the habits you develop programming C are good habits to carry over to C++. Maybe it has something to do with the fact that C is derived from C++.

(Mainly we use C to learn the basic tenets of programming, and then C++ to learn more complex pointers/data structures stuff.)

-- Griffinhart

_________________
"My word is my honor. My honor is my life."
-- Demonchild, Angelkin, the Blackest Seraph, the Final Warrior

Image


Top
Offline   
 Post subject: Re: Programming Challenges uplink mod makeing
PostPosted: Sat Aug 21, 2010 7:36 pm 
 

Joined: Tue Jun 29, 2010 12:00 pm
Posts: 23
Yes, of course C++ have a lot of habits of C, but it is simply waste of time to learn firstly C and then RE-learn some things (that are different in C++). It is better and simpler to basically start with the C++ (if you don't know anything about C nor C++ and if you WANT to learn C++, not C).

Many people ends with C with some things of C++ (which will work too, because C++ compiler have to compile C code also), not with clear C++ - but thats stupid and shitty to have code with things which are in C style, but should have to be in C++ style (but it also works, but it is not clean and it is shitty).

The example of all is cout VS printf. Many people, which come from C, still use "printf" function where should be/instead of cout function (which is C++ function and which is "clean" and right to use).

It is possible, that this is not your occurrence, but many people can't re-learn so good and still use C code in C++ code - maybe because it is comfortable - it works also and they already know C code, so why use and learn C++ - thats eye of many people, so thats why I do not recommend to start with C, if you want to learn C++.

I know my English is not brilliant, but I hope you know, what I want to say.


Top
Offline   
 Post subject: Re: Programming Challenges uplink mod makeing
PostPosted: Sun Aug 22, 2010 3:01 am 
External Project Staff
User avatar
 

Joined: Sun Oct 30, 2005 3:40 pm
Posts: 371
Website: http://idlesoft.net
Location: ~/
A good programmer should be able to code all (read: many) languages. Every language teaches you new tricks to handle stuff. Also, I tend to avoid the whole std library when using C++. If I use C++ it's usually because C doesn't allow me to do some tricks. In any case, the code works just as good, which is what matters. Though some complex string operations would do better with C++ strings.

Also, C code does not compile as C++, not unless you pass the compiler some special options.

Also, I should really start learning functional programming, it seems awesome to me.

_________________
-- ChaosR

Image


Top
Offline   
 Post subject: Re: Programming Challenges uplink mod makeing
PostPosted: Sun Aug 22, 2010 8:05 pm 
User avatar
 

Joined: Sat Jun 03, 2006 3:51 am
Posts: 1186
Website: http://griffinhart.livejournal.com/
Yahoo Messenger: Squall591
AOL: FinalWarrior591
Location: Look at my horse, my horse is amazing!
Quote:
Many people ends with C with some things of C++ (which will work too, because C++ compiler have to compile C code also),
As far as I know, according to standards, C++ compilers are not inherently required to compile C, but any good C++ compiler will be able to anyways.
Quote:
The example of all is cout VS printf. Many people, which come from C, still use "printf" function where should be/instead of cout function (which is C++ function and which is "clean" and right to use).
If you're using a proper C++ compiler, you will get a warning that printf is deprecated code. If you're a proper programmer, you should have your compiler treating all warnings as errors (most, if not all, DigiPen computer science professors require this; those that don't will still mark off points if your code compiles with warnings because they will compile your code and treat warning as errors - if you have a warning, you code doesn't compile, and you lose points).

Furthermore, you should not be using "cout"; you should be using "std::cout". ("cout" implies "using namespace std", which you really shouldn't be doing.)

-- Griffinhart

_________________
"My word is my honor. My honor is my life."
-- Demonchild, Angelkin, the Blackest Seraph, the Final Warrior

Image


Top
Offline   
 Post subject: Re: Programming Challenges uplink mod makeing
PostPosted: Mon Aug 23, 2010 2:25 am 
 

Joined: Thu Nov 15, 2007 2:00 pm
Posts: 68
Website: http://www.skyblownet.com
Quote:
... Furthermore, you should not be using "cout"; you should be using :roll: "std::cout". ("cout" implies "using namespace std", which you really shouldn't be doing.)...
Different problems require different solutions. There is no "you shouldn't do this always" solution when it comes to programming, there are some trade-off's for every solution (no perfect one exists)


Top
Offline   
 Post subject: Re: Programming Challenges uplink mod makeing
PostPosted: Mon Aug 23, 2010 4:12 am 
User avatar
 

Joined: Sat Jun 03, 2006 3:51 am
Posts: 1186
Website: http://griffinhart.livejournal.com/
Yahoo Messenger: Squall591
AOL: FinalWarrior591
Location: Look at my horse, my horse is amazing!
Unless you're actually doing something to the STD, I don't see a reason for "using namespace std;".

-- Griffinhart

_________________
"My word is my honor. My honor is my life."
-- Demonchild, Angelkin, the Blackest Seraph, the Final Warrior

Image


Top
Offline   
 Post subject: Re: Programming Challenges uplink mod makeing
PostPosted: Mon Aug 23, 2010 1:36 pm 
Just so you know, you brought this upon yourself. Dancefight.
User avatar
 

Joined: Sat Apr 02, 2005 3:31 pm
Posts: 1171
Location: The vicinity of an area adjacent to a location.
Quote:
Quote:
... Furthermore, you should not be using "cout"; you should be using :roll: "std::cout". ("cout" implies "using namespace std", which you really shouldn't be doing.)...
Different problems require different solutions. There is no "you shouldn't do this always" solution when it comes to programming, there are some trade-off's for every solution (no perfect one exists)
Except in this case, it's a matter of best practices, not a matter of tradeoffs.

_________________
- Tycho

Image


Top
Offline   
Display posts from previous:  Sort by  
Post new topic  Reply to topic

All times are UTC-05:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created by Miah with assistance from hyprnova