Learning multiple languages [closed]
Once you learn one language does it become easier to learn a second and are there pairs of languages that go together? Also is it even a good idea to learn more then one language?
Learning more than one language is an excellent idea -- not only does that give you that much more flexibility in job hunting &c, but it simply broadens your mind, your vision of what programming is all about.
The second language is often the hardest one -- because your first language has done so much to shape your thinking and operating when programming. The very hardest case is when the two languages are superficially similar but have deep, subtle differences: it's truly hard to perceive, understand and learn the subtle differences, as the surface similarity blinds you.
If you master two languages that are far apart from each other, the third one will be easier... and it only gets easier and easier after that. A great pair of languages to start from is one very high level language (such as Ruby or Python) and one pretty low level one (especially C); however, a functional language such as Haskell, and one that's the very antithesis of functional such as Java, should also work, almost as well.
Repeating all of the above sentiment, I strongly support the notion of learning multiple languages, and gaining high proficiency in at least two very different languages. I do in fact think that knowing five languages superficially is beneficial, if it piques your curiosity to learn more, but you should still master more than one language "to the bone."
Here are some (non-exclusive) categories of languages that you may want to consider.
- Compiled (C, C++, ...) / Interpreted (Perl, Ruby, Python, PHP,...) / JIT (Java)
- High level / Low level
- Object-Oriented / Procedural / Declarative / Functional
- Established / Experimental
- General / Special purpose / Domain specific
- Strongly typed / Loosely typed
Understanding the trade-offs and philosophies behind these languages and their implementation will necessarily make you a better programmer. Sure, it may take time to experiment with all of them, and become proficient in some of them. But the experience is rewarding starting even at the first step, with immediate gratification and benefits, so you shouldn't despair by the plethora of choices.
I think it is more important to learn concepts rather than language syntax. That being said, to truly master a language you often have to have painful run-ins with its gotchas. Additionally, some languages may provide library-support which lends itself better to solving specific problems. Learning multiple languages is desirable; you don't golf with just one club, do you?
It's very useful to know more than one language. In fact, this very good book recommends learning one every year. It does become easier to learn new languages as there are always overlapping concepts in them.
- Yes, once you know one language very well it's easier to learn other languages because you can map techniques you know to different syntaxes in the other language. This assumes both languages are comparable- C++ won't compare cleanly to Ruby, for example.
- It is definitely a good idea to learn multiple languages. The more languages you learn, the broader your experience becomes. Eventually you begin to understand the differences in base architecture and design between languages and why some have advantages over others for particular programming tasks.
Yes, yes, and yes.
In learning a language, you learn many of the basic principles of programming, as expressed by that language. Many languages use similar concepts, or even the same frameworks and basic structure. This can make learning a second "similar" language very easy. For example, if you learn C#, VB.NET is very easy, since it uses the same framework, and same basic concepts.
Learning different languages, however, can also force you to learn different ways to "think" about a problem. This is especially true if you go from a static typed language to an interpreted language, or a functional programming language. They will force you to rethink how you program, which can make you a better programmer overall.
As you learn more languages, you tend to think of things in terms of concepts or images instead of specific features of your favorite language. It's definitely easier to learn a third or fourth language than your first or second, because you already understand many of the concepts (and possibly syntax) being showcased in the new language. It's a great idea to learn more languages.
Yes, once you understand how to break a problem apart so you can code the solution and what the common code pieceparts are, then learning another language is easier. Some are harder than others.
Learning more programming languages is good in the same ways that learning multiple real languages is. You learn things across the languages, making you better in both. You also have another skill to sell. Some languages are more applicable to certain kinds of problems...knowing more languages makes you better able to tackle those problems.
Most of the time yes. Once you understand the general idea of programming you start picking up similar patterns in different languages. Especially if the languages are from the same family or are of the same type (for instance once you learn C or C++ it is very easy to learn Java, Javascript, C#, PHP and so on). Of course it is probably equally difficult to master them, but you will pick up 90% of things quickly.
For learning, however, it is much better to learn 2 languages from different families and with different foundations, like C and Haskell. It will widen your perspective and allow you to come up with solutions that are outside of the normal frame of mind for these languages.
Learning different languages teach you to think in different ways. These thought patterns can generally be utilized in any language so yes, it is good to learn more than one language.
That being said, knowing 5 languages superficially, will never amount to be as good as knowing one language to the bone. Again though if you already know one to the bone, knowing 5 more will let you sap the marrow.
Programming languages generally have very few words, and most words can be translated litterally to and from different languages. When you learn the first language however, along with learning the language you must learn to think in terms of programming. The second language is a lot easier, the third equally so, the fourth a stroll in the park, the fith a piece of cake, and the sixth a piece of cake at a nice little cafe, and so on, you get the picture :)
/B2S
Lots of good advice here. I'd second most if not all of it.
Given my experience, I'd actually suggest selecting three languages. I'd pick the one that seems most accessible and useful to learn first, and getting to know the syntax well enough to be able to spot problems with existing code, but don't feel like you have to have it mastered to the point where you write expert, bug-free code from memory. Use your documentation and reference as a floatation device while you work and learn. Spend more time mastering the concepts...especially debugging! And jump in and try things, even if what you wind up building at first is pretty bad or may not work at all. (I feel like the concepts that are most solid in my head are the ones I almost killed myself trying to fix, rather than learn by reading thoroughly about ideas before ever trying to code.)
Once you've got the first language down pretty well, move on to the second one, perhaps the one where the syntax is as different as possible from the first. This approach made me extra-aware of concepts, and confirmed that I didn't need to be a syntax expert to get work done. After all, there's normally tons of documentation, tutorials and discussions available to anyone and everyone.
Then take the third language and dive in. You'll be surprised how much easier that third one is. You'll see the middle ground, syntax-wise, between the two extremes you've already learned, and how very similar programming concepts are.
If you want to be extremely competitive and marketable, you might pick your languages based on diversity: for example, one that's good for web on the client-side, one that's good for server-side, and one that's good for platform/device development. Or, pick the languages based on what you know you'll enjoy building. I've found that to be most fulfilling and what keeps me interested; i.e, if you know you are a gaming fanatic, just learn languages that will enable you to build and port robust games to different platforms, and keep your focus.
Finally, don't put pressure on yourself by comparing yourself to other developers and making yourself feel like you have to be like them, or learn what they did, the way they did, as fast as they did. Experiment and discover what works for you and stick with it.
Just my two cents. Good luck!
精彩评论