Jump to content
IGNORED

C programming


bplus
 Share

Recommended Posts

This isn't really related to games more programming in general.

I work in web developement, completely c#, did java (and JEE) at university.

I really feel like i ve missed out on some fundamental stuff from never doing C. With java and c# are really lovely in that they do everything for you, but I get the feeling to really understand how things work (and therefore become a better coder) I should really get to know C. I think I missed out proper data structures and algorithms stuff (i didnt do computer science, just some piss poor watered down IT degree followed up by an Msc in ecommerce technology)

Basically I m really asking is there any point going back and looking C, and if so what stuff in particular would be useful to look at? Or should I just forget about and concentrate on c# and web technolgies...

Link to comment
Share on other sites

There's way more jobs doing .Net stuff but for your own benefit I think it would be worth going back and at least taking a look at C.

What you'll find is that all those libraries you're used to and even things like strings aren't nicely wrapped up for you in C, plus you'll get some knowledge of pointers and manual memory management as C doesn't have garbage collection like C# and Java. Having to deal with memory yourself in a production application is a lot of additional hours of debugging.

You'll quickly find that it's much easier to bang out useful applications using managed code but you'll have at least some knowledge of C is you ever need it. I can't think of where you could start. I suppose with simple command line applications and then maybe move on to a GUI library of some kind?

If you want to learn to be a better coder then I would also recommend a book like Code Complete or The Pragmatic Programmer. Helped me out a lot.

Link to comment
Share on other sites

Honestly, I don't know.

C programmers are relatively rare (juniors, anyway) since everyone coming out of universities are now certified Java "Experts". Anything you learn about C (memory management, efficient implementation, serious consideration about what you're passing onto what, where) won't do you any harm in a higher level language.

On the other hand, I'd avoid C GUI stuff like the plague. God invented C++ for a reason (indeed, C used without serious consideration of how you're going to implement object like behaviour isn't a great idea either).

Having to deal with memory yourself in a production application is a lot of additional hours of debugging.

Or you design the problem out.

Link to comment
Share on other sites

If I have to fix someone else's code, or work with legacy code to do a job I can't really design the problem out can I? There's a fine line between doing things right and doing things on time.

Sometimes doing things on time is doing them right. :lol:

And, yes, of course I agree that if you're fixing a legacy application then you can't redesign the problem away - but given the amount of time it saves in the long run [i'm still bitter about 6 months of black-box debugging of a library supplied by a subcontractor which "didn't have any significant bugs and it must be your code" but still crashed at random intervals after ~ 20 hours of use on some machines... the problem was obviously related to their memory usage once we finally tracked it down :)]

Link to comment
Share on other sites

C is interesting, but I would recommend learning C++ instead. You can still go as low level as you can in C, but it supports lots of higher level concepts as well. Obviously the big thing is you have to do your own memory allocation, but I honestly think you need to at least understand how memory is allocated as a programmer. Note, I don't think its always essential, and there's nothing wrong with Java, C#, python or the million other languages without it, but I think you're really missing something if you don't understand what's involved.

In my job its actually too high level to work in C++ using the default memory allocators, and we have a variety of different ones for different scenarios, our own heaps, pools etc. In fact a tool I wrote last year spent 90% of its time in allocation routines until I rewrote it with specifically tailored memory management. Just changing the memory allocation behaviour caused a 10x speedup, not insignificant...

I really love C++, and could ramble on about it for hours :D Give it a go and see what you think.

Link to comment
Share on other sites

C is interesting, but I would recommend learning C++ instead. You can still go as low level as you can in C, but it supports lots of higher level concepts as well. Obviously the big thing is you have to do your own memory allocation, but I honestly think you need to at least understand how memory is allocated as a programmer. Note, I don't think its always essential, and there's nothing wrong with Java, C#, python or the million other languages without it, but I think you're really missing something if you don't understand what's involved.

In my job its actually too high level to work in C++ using the default memory allocators, and we have a variety of different ones for different scenarios, our own heaps, pools etc. In fact a tool I wrote last year spent 90% of its time in allocation routines until I rewrote it with specifically tailored memory management. Just changing the memory allocation behaviour caused a 10x speedup, not insignificant...

I really love C++, and could ramble on about it for hours :D Give it a go and see what you think.

I disagree completely with this. Learn C - it will teach you the low-level stuff that Java and C# hide from you, and it can be learnt in a small fraction of the time it takes to learn C++. Then, learn python or ruby if you don't know them already - both for practical reasons (they're languages that you'll use for one-off programs or scripts even if you're not using them full-time) and for educational reasons - they'll give you another perspective on object-oriented design and programming that's different from the Java/C# model. Finally if you're really keen, learn a functional language - I'd recommend ocaml or haskell - you'll pick up a really clean idea of design, and pick up techniques (or at least an appreciation of techniques) that can be but aren't usually applied to programming in other languages.

Most programmers have a particular language that they favour, and see only its advantages. The more languages you learn the more you can appreciate the strengths and weaknesses of each.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Use of this website is subject to our Privacy Policy, Terms of Use, and Guidelines.