Recommended Posts

I've been learning C# for about month now, and everyone has been right about how easy it is to get going with it. However, I do want to understand lower-level ideas at some point and was wondering how low I should go with my next language. Is C still worth learning or will C++ be sufficient at this point? I know that it will probably be awhile before I jump into something new but I like to have an idea about where I'm going.
To add some background, I am an Accounting and Finance double major and program for fun on the side. However, programming well is really important to me and even though I'm a hobby programmer technically, I want to take it more seriously than that. This community has gotten me off to a good start by suggesting C# and I hope you all can give me some ideas about what's next.

0

Share this post

Link to post

Share on other sites

I think that really understanding the "lower-level ideas" won't be dramatically helped just by learning a language like C or C++. The real low-level ideas that can't be used by a language like C# are things like cache misses, aligning instructions to run in modern processors' multiple pipelines, SIMD optimizations, etc. To take advantage of those, you'll probably end up going through your code after it's already been compiled to assembler.

If you want to be a better programmer (develop solutions faster, produce stabler code, etc), you might be better off learning a language outside of the C family. Python is recommended pretty widely around here, though I can't speak for it myself. I've learned a lot from building a complicated browser application in javascript, which is actually pretty Lisp-like once you get past the inconsistent browser functionality bindings. You might also build something that requires a database, and get proficient in SQL.

Does knowing javascript and SQL really make me a better game developer? Absolutely! It's startling how differently I approach common problems now that I understand other ways to consider solutions to those problems.

Alternatively, if you want to just get close to the metal (I can certainly understand that), you should probably run with C++. There are more fantastic libraries and literature available for C++ than probably any other language. My first real run-in with that stuff was writing a SIMD-optimized additive blit function for use in SDL. It was a very educational experience on many levels.

0

Share this post

Link to post

Share on other sites

Original post by BeanDogI think that really understanding the "lower-level ideas" won't be dramatically helped just by learning a language like C or C++. The real low-level ideas that can't be used by a language like C# are things like cache misses, aligning instructions to run in modern processors' multiple pipelines, SIMD optimizations, etc. To take advantage of those, you'll probably end up going through your code after it's already been compiled to assembler.

Even then you won't really know what you're doing without years of experience and a very intimate knowledge of how the target platform works. Something which tends to be damn hard to tell on most PCs due to the sheer number of variations of hardware out there. None the less, it is a good exercise once you've got a sufficiently well developed set or programming skills (meaning a few YEARS of experience generally).

Quote:

If you want to be a better programmer (develop solutions faster, produce stabler code, etc), you might be better off learning a language outside of the C family. Python is recommended pretty widely around here, though I can't speak for it myself. I've learned a lot from building a complicated browser application in javascript, which is actually pretty Lisp-like once you get past the inconsistent browser functionality bindings. You might also build something that requires a database, and get proficient in SQL.

Yes, the more programming paradigms you have under your belt, the better. There is no one golden paradigm, and for any problem domain, there tends to be multiple different paradigms that can be applied to create a sufficiently fast and easy to maintain solution.

Quote:

Alternatively, if you want to just get close to the metal (I can certainly understand that), you should probably run with C++. There are more fantastic libraries and literature available for C++ than probably any other language. My first real run-in with that stuff was writing a SIMD-optimized additive blit function for use in SDL. It was a very educational experience on many levels.

C++, even assembler, is not "close to the metal" anymore. Hasn't been for years now. With the prevalence of psuedo instructions, virtual memory, multiple cores, virtualized states, etc, you simply cannot tell if you are up in the sky or down in the earth. Assembly can certainly bring a rather unique perspective to programming, and if you want to learn how to write very tight inner loops you can't get much better than some very well optimized hand written assembly.

However, that being said: Without extensive knowledge of the target platform, its processor architecture, how it does things (such as memory fetches, cache fetches, even things like the size of the cache lines and how big they are) you're not likely to write assembly code that is anywhere near as fast as what say the MSVC optimizing compiler can do...let alone what the Intel optimizing compiler does.

It should also be mentioned that most tricks that deal in assembly fall under the umbrella of micro-optimizations. They should be avoided until both profiling and higher level optimizations, such as algorithmic ones, have been done and show such areas to be a problem still.

0

Share this post

Link to post

Share on other sites

Original post by BeanDogIf you want to be a better programmer (develop solutions faster, produce stabler code, etc), you might be better off learning a language outside of the C family. Python is recommended pretty widely around here

Python is most definitely a C family language.

If you want to learn a new style of programming look into one of the following: Haskell, Prolog or Scheme. They will each teach you something that the C style languages won't.

Share this post

Link to post

Share on other sites

Original post by Anexa85So I'm gathering that I should just spend a lot of time programming and keep progressing. It seems like languages are less important than experience...

QFT. Now you've got it! Learning a specific language and learning how to program are two completely different things. In other words, you've figured out the best thing you can do - just keep on programming.