views:

1243

answers:

16

I have just recently started learning C and the reason I did that was because frankly, I consider myself to be of a "less-developer" than the people who know and work with C. Thus I planned to start learning ASM, C, C++ and bought the K&R book and started pushing myself to learn the C Programming Language and up till now I'm doing great...learning about arrays the low level way (ie the pointer + offset thing), pointers and all that and obviously asking questions on stackoverflow for guidance.

My problem is that sometimes I get thinking if instead of learning this low level stuff, maybe I should maybe spend more time learning newer, more widely used technologies...basically, more web stuff. Now I am well versed with both C# and ASP.Net and currently that's what I do for a living, but still there exists Microsoft technologies that I haven't quite touched upon...such as ASP.Net MVC, The Entity Framework etc...

And those are only Microsoft Technologies...obviously there are other stuff that I would like to touch upon...stuff like Ruby, which would lead me to Ruby on Rails, or Python for Django or even Java and J2EE, or maybe even PHP; ie, basically mainly Web Stuff.


Mind you, I did touch upon some of the stuff I mentioned earlier on, such as PHP and Java but I am still not quite versed in them as I am in C# and ASP.Net...but still, I think that by learning other languages that are used in the web environment will broaden my horizons...both as a developer who loves learning, and also Career wise.

My point is, am I really using up my time correctly by learning older, lower level stuff? Stuff that for my current line of work, will most probably never use, but still is interesting to know ?


To be frankly honest, I am also learning C so that I could, maybe someday, get into Electronics and Micro-controller programming but that is a whole new world for me and, if I choose to go there, will take some time to get adjusted to. And even then, I don't know if I can get a career in working in that line of work.

...but I still wonder about this question over and over...
Am I doing the right thing by learning C instead of something (Web-stuff) that will most probably be more useful for me career-wise?


I'm sorry for such asking such a long and most probably a boring question, but I feel as if this is the only place where I can ask such a question and get an honest answer from experts in the field.
Thank you for your time.

+24  A: 

I think it is absolutely worth it to learn C! Once you learn C, you can see how other programs work internally and get a better "feel" for what is really happening.

Many times, this "feel" has helped me make my programs work better (faster, smaller, etc.) than they would if I did not know C.

Microcontrollers are really really really fun! do it!

+1 for MCU
Johan
+7  A: 

Say you stop learning C and start learning CSS (for example). In a couple of days, won't you start wondering if you should really be learning database stuff? Or maybe functional programming, that's hot just now?

My advice learn one thing at once. And as I've pointed out before, you can learn most of C quite easily inside a month, so spend about that much time, and then consider moving on.

anon
You would be able to learn how to write a small program in C, but wouldn't have spent enough time to create anything useful or interesting inside a month. You need at least 6 months to master something.
Tom Leys
And by master, I mean "have a useful and productive understanding of the language" - even then it takes longer and several large scale projects to fully master a language.
Tom Leys
anon
Meredith L. Patterson
I don't think you really need to master the whole language, just the things that make it different/interesting. For C, that mostly means pointers and manual memory management. A few toy programs that emphasize these aspects should, IMHO, be plenty. Mastering the art of programming in a language as low-level as C is an order of magnitude more time consuming and less useful.
dsimcha
+10  A: 

The only exposure I've had to Assembly, C++ and C was while working on my computer science degree, and a little in my off hours when working on some hobby projects. Otherwise I focused most of my self-training on C#.

Having some knowledge of the low level stuff is great, because you can get a good understanding of why more modern languages are designed the way they are. There are also things that are easily done in C++ that aren't so easy in C#. Having experience working with pointers I think helps as well. I don't think I'd have such a good understanding of how memory management works in C# if I had never used something like C++.

I think having at least a bit of a clue about what's going on under the hood will help you be a better programmer, even when you are not using a language that makes it your responsibility to use those things.

AaronLS
A: 

You might find it interesting to learn C and C++ by working on an open source C++ project that is related to the web.

The Varnish web accelerator is one example.

Tom Leys
+2  A: 

It can depend of what you want to do !
Of course, if you want to do real time and low level programming, it's a good idea to learn C++ and ASM of course !
But even if you don't want to do such devleopment, learning how softwares work in low levels will be useful in a lot of case, like tricky debugging and optimizations for example...or learning more higher languages ! Finally, C++ can be used doing great high level programming... have a look at the Qt side...

Matthieu
+3  A: 

You should definitely learn C, for the simple reason that virtually every other 'modern' language is based or is an extension of C. It's a relatively small language, and so you can learn it pretty quickly; and once you have it will make learning C# / Java / C++ much easier, and hopefully you will better understand why those languages do things in certain ways.

Dave Rigby
+3  A: 

I spent the first 6 year of my career as an embedded C engineer, and I've got to say I love having that grounding. C wasn't my first language, and all through university I was OO and really focussed on the user experience, but then a router/switch company hired my entire honours class so we all moved into that area.

Working in C, especially embedded C, really gives you an appreciation of the machine and the underlying mechanics of what you do. Do you need to learn C to be a better programmer? No. But it will help you.

If you are already well versed with C# and ASP.NET, then learning something outside your current comfort zone will extend you more than learning another familiar technology. If not C, then learning a functional language is a good choice.

I'm now working in C#/ASP.NET myself and I recently wrote myself a blog using ruby on rails as I wanted to play with ruby and learn the rails framework. Now I'm putting some effort into learning F#. It doesn't really matter what you do as long as you're doing it.

Career wise, if you can program C, there are endless embedded C jobs round where I live (London, England). There are so few people who can program anyway, you take that to C and there is a real need for good C programmers.

Andrew Barrett
+1  A: 

My belief is that if you truly want to master a tool, you've got to know how it came to be. You've got to, to a certain extent, know what its beginnings were and how it evolved into its current form. Perhaps you got to get into the minds of its creators(s) and try to think like them.

Learning about the processor, the assembler and C will do just that in the context of modern languages. It'll take you through the path of the creation and evolution of C# and Java and, without doubt, render you a master of them.

So there's no reason to despair. You're on a worthwhile quest.

Frederick
A: 

If you want to be a real programmer, as opposed a "flavor of the month", you really need to know C. Some form of Assembler would also be very helpful. When you're using all these high-level constructs in an advanced language (I like Python), you'll understand them much better if you have some idea how they're translated into action on a CPU.

A. L. Flanagan
C# and ASP.NET are flavour of the month? It's not like he referenced Ruby or Haskell. =)
Kieveli
@Kieveli: To be fair, he never said that.
Stefano Borini
By "flavor of the month", I mean one of these one-trick-pony programmers that seem to keep coming out. It doesn't matter what your one trick is, if that's all you've got.
A. L. Flanagan
@Kieveli: I also don't think Haskell is really a "flavor of the month"
Andreas Grech
+2  A: 

Depends what type of job you are after.

If you want a job where the focus is on the technology, solving a technical problem, then C is one of the options.

If you want a job that focuses on solving a business problem, then a higher level language like C# or web programming may be better.

Working on business problems generally has a higher chance of a job with customer contact, if that is what you are after.

Shiraz Bhaiji
+1  A: 

In some ways learning C is analogous to learning the Latin roots of English words. You might not use Latin, but understanding the roots of words will help you understand English, and other languages, better.

Parts of the standard libraries of many higher level languages are often built on parts of the C standard library for portability; so understanding the C standard library can help you more quickly understand aspects of multiple higher level languages. For example the lua standard library wraps many C standard library functions. Also, parts of the python standard library also wrap parts of the C standard library.

Karl Voigtland
+11  A: 

I will link you 3 articles from Joel that will justify your learning of C or other 'non-popular' technologies:

Michaël Larouche
Joel's 'The Perils of Java Schools' column is brilliant, and I'm very grateful that my university teaches C as a first language, without my C experience I would not appreciate the complexities of what is going on when I blindly call the hundreds of 'convenience' functions provided in most scripting languages.
David Claridge
Ah yes, read all of them...excellent articles. Infact, to be honest, my interest in starting to learn C was after reading 'The Perils of Java Schools'
Andreas Grech
Same here, I'm glad that my college and university use C as first language. In my university, we've got some people coming from a Java college and they struggle a lot with C++.
Michaël Larouche
I keep parsing it as "The Penis of Java Schools"
just somebody
+5  A: 

I certainly don't think this is a waste of time.

Think about it as a holistic view. Understand a bit about each of these:

  • machine architecture (with special attention to the CPU and memory)
  • operating system (if you even have one, embedded developers may not as such)
  • build system (GNU Make, Ant, Visual Studio, Jam, etc)
  • compiler
  • language
  • libraries
  • test tools / frameworks
  • computer science (e.g. data structures and algorithms, models of computation, information theory)
  • software engineering (e.g. best practices, planning, estimating, etc)

...and you'll be doing yourself several favors:

  • learning why things are done certain ways will give you examples of problem solving in different domains, and may give you a larger set of patterns you can draw from, even when you're not working on that level. For example: "What motivated the creators of the programming language or library I'm using?", or "Why does my CPU's instruction set have instruction X but not Y?"
  • you'll be ahead of the game, because you'll have insight into where the hardware and software is going next. Maybe you won't get to use that for a few years, but it can inform your development choices today.
  • you'll have enough footing to diagnose issues and profile and optimize where others start out lost

Most importantly, you'll know how to ask intelligent questions; you'll be actively learning how to learn. If you restrict yourself to any one of these levels alone, you're doing yourself a disservice. (The Pragmatic Programmer recommends learning at least one new language or tech a year, and it's generally accepted that learning a language of a type you're less familiar with -- e.g. functional vs procedural -- is a good choice.)

This isn't to say you can be an expert at everything. Sometimes you have to go deep as opposed to wide to gain enough skill in something to do a job well. But generally speaking, if you're unsure, you'll learn more that is useful in the long term by diversifying.

(This may come down to a "overspecialization leads to weakness" vs. "specialization is necessary for society to function" argument, but based on my experience, having a healthy interest in many different things has helped me tremendously, and does not prevent me from specializing to the depth I need.)

leander
+1 Thanks for the great answer!
Andreas Grech
A: 

only understanding C you will write good C# code

Arabcoder
A: 

I learned assembly in high school on my free time, then in CS at college I mastered C, and on my free time I learned a bit of C++. I can say for a fact that C has tought me nothing more than what I've already knew from learning assembly.

Unless you are going into a job coding C/C++, I don't see a reason to learn them. Assembly teaches you the concepts of how processors actually work. Learning C, you learn quite a bit about this, but even then there are some confusing abstractions.

I used to do tons of programming in assembly for low level projects, but now I try to stick to safe high level languages as much as possible, and maybe write a few bits in assembly or C, as I hope C/C++ and such things will be obsolete in the future.

Anyways, my point is that learning assembly will teach you way more than C will ever teach you.

Longpoke
A: 

C is to higher level languages, as Latin is to Romance languages and English

George Jempty