8

I'm learning C, but after that or in the meanwhile, what should I learn first and subsequently before getting into C++ ? Compilers, Data Structures, UML or Design Patterns ?(also when start to learn Win32 API ?) I'm not in a hurry at all, so I can grasp the requirements from the deepest beginning. I just don't want to get lost for being cursory and negligent.

In addition to this, which subjects on mathematics has most impact on coding very well ? Linear Algebra, Discrete Mathematics, Calculus ?

I'll be thankful if someone guides me through this journey. There are many questions I would like to know the answers. Thanks.

Daniel
  • 189
  • 1
  • 7
  • 14
    As absurdly as it might sound, but learning what's nowadays considered good C++ is usually hindered by experience in C. If you want to learn C++ then skip C. If you want to learn both, be prepared to having to unlearn a lot of C in order to write good C++. – sbi Dec 04 '10 at 10:51

3 Answers3

16

First you should learn that C++ is not a superior language. C has its uses as more than a stepping stone into C++. C, and "C-style" C++ are used because they:

  • Generate smaller binaries
  • Use less memory
  • Compile faster
  • Do not require OS-support
  • Are simpler, and easier to implement

Data structures are by far the most useful of the listed to learn, followed by algorithms. If you intend to go into C++, it's also useful (mandatory?) to have good design skills.

You should not necessarily learn Win32 at all. Consider learning the POSIX APIs, GTK+ and Boost, as they're more portable, and work on platforms other than Windows.

The best decision you can make is to learn C thoroughly as a separate skill on a Unix platform, before crutching yourself by not being able to see the difference between C and C++.

Of the listed Mathematics disciplines, I've only used discrete mathematics. Linear algebra is also useful, but by far and away the best discipline for programming is set and number theory.

Enjoy your time in C, don't become dependent on Windows/Visual Studio, and don't rush into C++.

Update0

Almost forgot! You absolutely must use a decent C compiler. A central reason to C++'s wide use in enterprise, and the bad reputation C has among Windows developers is Visual Studio. Visual Studio is easily the best C++ IDE, however it's also the worst C compiler I know of. Be sure to use a C compiler with C99 support, such as GCC, mingw or Clang. My first experience with C was using LCC, which was very easy to use on Windows, but I haven't used it since moving to Linux, so I can't comment on its C99 status.

Matt Joiner
  • 112,946
  • 110
  • 377
  • 526
  • Could you elaborate on `Do not require OS-support`, `Are simpler, and easier to implement` and why C is a good stepping stone to C++ when good C code is completely different from good C++ code? – Sebastian Mach Feb 05 '13 at 09:14
  • Also, I think `First you should learn that C++ is not a superior language` is pure POV. I would generalise that to `Whether a language is superiour always and at any time totally depends on what you like and want to achieve`. E.g., Haskell is totally superiour to C because you can write many complex algorithms within 2 or 3 lines of code. At the same C is superiour to C++ because it is available for more platforms and it is easier to hire C programmers. C++ is superior to Haskell because on average it leads to faster code. – Sebastian Mach Feb 05 '13 at 09:17
3

Compilers, Data Structures, UML or Design Patterns ?

Data Structures and Algorithms.

In addition to this, which subjects on mathematics has most impact on coding very well ? Linear Algebra, Discrete Mathematics, Calculus ?

Discrete Mathematics and Number Theory.

Prasoon Saurav
  • 91,295
  • 49
  • 239
  • 345
1

You should learn to program in a well structured language first: Ocaml is recommended, Haskell is also good but a bit harder to get a working compiler and harder to learn because it is purely functional.

Mathematics is of little use in programming (the math that is useful is too hard, namely category theory). However some basic type theory is useful.

You can't learn good programming in languages like C, the important stuff is too deeply buried in housekeeping tasks and historical stupidities.

Yttrill
  • 4,725
  • 1
  • 20
  • 29
  • You certainly learn stuff about the computer, and your operating system however. I would argue this is equally as important. Programmers stuck in user space with a spoon fed platform are not particularly useful. – Matt Joiner Dec 05 '10 at 02:32