4 ms·
I would suggest to learn C. It might sound a little bit strange, but when you consider it, it's probably one of the best things you could do. Most of the modern
by blackmac 17y ago
I would suggest to learn C. It might sound a little bit strange, but when you consider it, it's probably one of the best things you could do. Most of the modern languages you will need are somewhat based on C. That is especially true for compiled languages, but most script languages take their fair share of C too.
You will learn about pointers, which is important in ANY language, binary trees and stacks are good to know about too.
- dkersten 17y agoI disagree. While I think C is a valuable language to learn and I agree with your reasons for learning it, I do not think it should be someones FIRST language. It would make a great second, though. Why? Because C (and C++) has a lot of confusing cruft that a beginner just doesn't need to know about. The noise in the language is too high and too much work is involved in achieving relatively simple things. A higher level language also has quicker returns, which definitely helps keep someone whos just starting out motivated. Most high level languages have better tools to learn with too, like an interactive read-eval-print-loop. I would recommend Python. Not Python 3, but Python 2.6 - better library support. I recommend Python because it takes very little to get working and it comes with everything a beginner would need bundled. When you're learning, you don;t need direct hardware access, you don't need direct OS interfacing, you don't need high performance (and probably wouldn't get it anyway until you learn how to write good, fast C). You DO need to get things done quickly (its hard to learn, otherwise) and you DO need an environment that doesn't require much background knowledge to work in. In Python, a simple program is simple. Theres no need to learn about "main" (and therefore functions), about includes, printf format specifiers and so on - just to write a hello world. As your skill increases, you can gradually add more language features: conditional statements, loops, I/O, functions, data structures, classes, functional programming tools, libraries, metaprogramming. You dont have to deal with manual memory management and you'll get more meaningful error messages than "segfault". You learn a lot about PRGOGRAMMING (rather than having to deal with the low level complexities of C) which can then be applied to almost any language. If you outgrow Python (and I don't think you ever would, I know people who write some amazing stuff in Python, including HIGH PERFORMANCE CODE) you can learn C. I'd recommend it as a second language. Everything you've learned from Python will be applicable in C too. At this stage you should be well versed and pointers should come a lot more easily. You can also use Python and C together - its not even that hard. You could easily replace Python with Ruby in the above, if you prefer. Python and Ruby are pretty much equal players. If you don't mind going a less mainstream, I'd suggest learning Factor: a fast, powerful, very dynamic, native compiled concatenative language. It has pretty much all of lisps powerful features, with some ideas taken from Forth, Smalltalk and others, has an active community and very clean codebase. (The library code is some of the highest quality code ive seen) being stack based, it may take some effort to get into the mindset though.
- timwiseman 17y agoAll excellent points. But remember the original questioner already knew some python and some VB. C is probably an excellent choice for him, though personally I use Python for the vast majority of my code. Of course, my work has morphed to be more system and database administration than programming lately so I may be biased by that.
- Goladus 17y agoThe poster's first language is technically VB6. If you can make the effort, you can learn programming with C. You need good learning materials (which are available), you need to work hard, and you need to focus on learning C rather than trying to cram C into an otherwise generic introduction to programming.
- intellectronica 17y agoI can't imagine how learning C as a first language will be of much value, other than it will be so hard and confusing and slow it will make other options later on seem light and easy. C is a fine language for when you need to do very low-level work, but it lacks most of the abstractions that make modern programming languages so easy to learn and work with. I must say (not for the sake of picking a fight, but because this is the answer to a real person's question) that I think this is not good advice. If you get into programming, sooner or later you might want to learn C, but for now it will only make the experience frustrating for you.
- bluetech 17y agoI learned C as my first language, and there was nothing "confusing" about it. I find C to be quite direct - here's a variable, there's a loop, a function, a struct. Even pointers are straightforward one you know about memory and addresses, and you will need to understand them (conceptually) sooner or later anyway. In fact, the abstractions you mention are what might be confusing for the beginner: Classes, objects, inheritance, polymorphism, iterators, high-order functions, closures, monads, generators, etc. all require as much book- and code-staring as either void or function pointers do for the first time. I do however agree with you that C is harder and much less useful to learn than a "batteries-included", modern language like Python or Ruby as a first language.
- dkersten 17y agoA lot of people learned C as a first language and a lot of these people suggest others to do the same. "It worked for me" syndrome. However, that does NOT make it a _good_ first language. Sure, it can be good enough, but I'd argue that you'd get MORE out of learning a language like Python. Python is, IMHO, a great beginner language because it has all the abstractions, but (unlike Java) does not FORCE you to use them until you're ready to do so. It eases you into the complex concepts. It also shields you from buffer overruns and manual memory management. It gives much more useful errors when things crash and finally, an interactive shell is the best thing ever when learning. You already know that though, since you agreed ;-)
- nico 17y agoThe introductory programming course's language of choice at my university was C. I have mixed feelings about learning C as a first language. I remember the people who go it right from the start benefited the most and got a good base for the rest of their programming learning/experience. But the people who had trouble grasping some concepts of C, got stuck with that and later ended up hating either C or programming altogether. (Disclaimer: this was a class full of all kinds of engineering students, not just CS). Anyway, I think C could be an excellent second language to learn. Starting with something having a similar syntaxis like Javascript could be a good choice and pretty helpful in the future too. Plus, you won't need an IDE, a compiler, setting up a server or a database, only a browser.