Ferrous Moon
http://www.ferrousmoon.com:80/forums/

Programming Challenges uplink mod makeing
http://www.ferrousmoon.com:80/forums/viewtopic.php?f=45&t=2062
Page 2 of 2

Author:  Anonymous__ [Sat Aug 21, 2010 11:56 am ]
Post subject:  Re: Programming Challenges uplink mod makeing

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.

Author:  FinalWarrior [Sat Aug 21, 2010 3:32 pm ]
Post subject:  Re: Programming Challenges uplink mod makeing

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

Author:  Anonymous__ [Sat Aug 21, 2010 7:36 pm ]
Post subject:  Re: Programming Challenges uplink mod makeing

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.

Author:  ChaosR [Sun Aug 22, 2010 3:01 am ]
Post subject:  Re: Programming Challenges uplink mod makeing

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.

Author:  FinalWarrior [Sun Aug 22, 2010 8:05 pm ]
Post subject:  Re: Programming Challenges uplink mod makeing

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

Author:  skyblownet [Mon Aug 23, 2010 2:25 am ]
Post subject:  Re: Programming Challenges uplink mod makeing

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)

Author:  FinalWarrior [Mon Aug 23, 2010 4:12 am ]
Post subject:  Re: Programming Challenges uplink mod makeing

Unless you're actually doing something to the STD, I don't see a reason for "using namespace std;".

-- Griffinhart

Author:  Tycho [Mon Aug 23, 2010 1:36 pm ]
Post subject:  Re: Programming Challenges uplink mod makeing

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.

Page 2 of 2 All times are UTC-05:00
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/