Jump to content
Sign in to follow this  
Xen

Learning multiple languages

Recommended Posts

This is pretty much just a re-post from my blog but given how quiet the programming section has been lately i thought i'd throw it up here to see peoples opinions on the matter(s).

 

While lurking on many forums I’ve notice a trend of people asking questions along the lines of “Can i learn more than one language at once?”,

but there never seems to be a definitive answer as to how (or why for that matter).

 

I’ve decided to do just that, over time I’ve decided to select and learn several languages which has been something I’ve intended to continue for some time now,

this will also give me some more content to put on here which will in turn help in keeping me going on this mammoth task.

 

I’ve had a small amount of experience with some languages in particular Python but not a huge amount.

 

The languages i ended up choosing are:

 

* C

* Python

* Perl

* Shell scripting (Bash/Csh)

* PHP

 

Now some of you probably noticed some of these languages are not like the others so I’d better explain my choices and reference the books i intend on initially learning from.

 

* Do note that the books mentioned are not the only resources i will be using, simply the first of many.

 

C

 

C is one of the most powerful languages around bar assembly, given its use in the development of Unix and Linux along with various user-space applications it was the first on my list.

 

C is reputed as being a quite hard language to learn and even more so to learn well.

 

Books

 

The C Programming language

The Practice of programming

 

Python

 

Python is simply fantastic, in terms of application speed it is nowhere near as fast as C but this is made up for in application development time.

 

Creating anything in python is fast and also very enjoyable, this coupled with the fact that python is a very powerful language on it’s own.

 

Books

 

Programming in Python 3

 

Perl

 

Perl is a very powerful language and one that i have always intended on learning, initially i looked at some source for some Perl programs and was turned off by the apparent complexity.

 

For some people it may seem redundant learning Python at the same time as Perl, but I’ve been told that when it comes to some sysadmin tasks you really can’t go past it.

 

Books

 

Modern Perl

 

Shell scripting

 

The de-facto standard when creating small (or even large) programs for Unix based systems.

 

For any form of sysadmin work on either Unix or Linux you will eventually get to the point that you will need to write or change a shell script,

My only experience with creating shell scripts so far has been to throw a couple of shell commands into a file and set it as executable.

 

Books

 

Unix power tools

UNIX Shell Programming

 

PHP

 

PHP was the most contested choice on here, the one language that caused the most “No, choose language XXX instead!”.

 

So for this one ill give the specific reasons why i chose it:

 

* It’s free which is a big thing in my opinion, so that rules out Cold fusion and other languages that are not free or require specific non-free servers to run on.

 

* It’s not locked to any specific operating system just like all the other languages I’ve chosen (Bar shell scripting).

 

* It’s a mature language, PHP has been around a good while now so the language is solid and support is (apparently) very easy to find around.

 

* It’s fast, this seems to be one of the biggest selling points of PHP.

 

Simply there was nothing else that met my needs for web development.

 

* Also note that working with PHP will also involve HTML and CSS but they have been left out of the list.

 

Books

 

PHP in action

 

“But why isn’t language XXX here? it’s the better!!!”

 

Well I’ve found better is fairly subjective, and most languages people recommend to me don’t have any real world use in my case.

 

All of my coding takes place on Linux/Unix machines so i have no use for VB.Net .Net nor any of that ilk, one language that has come up in conversations regarding this is Java and or C++ instead of C.

 

I have all intentions of learning Java, just not right now as i currently have no uses for it.

 

As for C++ i have no use for it and most likely won’t in the future, as most of my intentions for the future extend towards Linux/Unix administration and development using C very specifically preferable to C++ by the communities of both.

Share this post


Link to post
Share on other sites

C is actually really easy to learn. The difficulty is getting your head around pointers and memory management. It can also get a bit tedious to work with, but that's what happens when you use a low level language.

 

I suggest that you try a functional language like Haskell or Scala. Scala compiles to Java bytecode and uses Java libraries, so you could essentially use it in place of Java.

 

Don't bother with C++. It's simply a shit language. Don't let old codgers trick you into 'learning' it. There's no learning C++, only 'tolerating'.

Share this post


Link to post
Share on other sites

C is actually really easy to learn. The difficulty is getting your head around pointers and memory management. It can also get a bit tedious to work with, but that's what happens when you use a low level language.

 

I suggest that you try a functional language like Haskell or Scala. Scala compiles to Java bytecode and uses Java libraries, so you could essentially use it in place of Java.

 

Don't bother with C++. It's simply a shit language. Don't let old codgers trick you into 'learning' it. There's no learning C++, only 'tolerating'.

Yeah, the first language i decided to learn was C++, i think it may have caused permanent damage :)

 

After I’ve started to get comfortable with the current language set I'm going to have a look at Erlang as well.

 

ATM pointers are my bane, I've been told that I'm currently at the *"I understand what they are, but why the hell would i use it" stage of learning C.

 

* Actual words of a C programmer that apparently will make sense to me later on.

Share this post


Link to post
Share on other sites

Wait, so you haven't had much experience programming at all? I suggest that you stick with learning a single language initially, get used to solving problems and applying common algorithms (e.g. sorting algorithms), and generally getting in the mindset of a developer.

 

Learning languages is one thing, learning how to apply them is a whole different ballgame.

Share this post


Link to post
Share on other sites

C and Assembly are powerful like Atoms are powerful. That is, not very powerful at all. Yep I said it Assembly (for whatever processor) isn't very powerful.

 

What is powerful? Why, higher level languages like Java & the .NET languages, with all their high level abstractions and their libraries and their addons.

 

C and Assembly allow you to do very weak, small things, like move around a few bits here and a few bits there. C# allows you to build motherfucking mountains quickly. Let's build an enterprise app that serves a corporation of 100's of 1,000's of people. I'll use the .NET languages and you can use Assembly. Go!

 

Let the shirt storm begin :p

 

WTF common sorting algorithms. You know, I did Data Structures, as it's own subject in 2nd year and you know, I know how to build a linked linked from nothing. I know sorting algorithms , and how dictionaries work, and graph traversals out the wahzoo. But for the life of me I can't remember the last time I implemented bubble-sort, or did redblack tree pruning. Fark that :)

 

Learn how to write readable code. Learn how to name your fucking variables sensibly and how to create small methods. Learn OO (if you know a language that supports it) and then go and study the shit out of the Gang Of Four patterns - then go read Fowler. Then rest, cause you've just aged 10 years :p

 

I reckon, decide what sort of things you want to develop and start with a language that is commonly used for developing those things. Then let it take you where it does. There's no "Start with C" or "Start with XYZ" bullshit. It's crap. Programming is a journey man :p

 

Learn a bunch of languages at once if it takes your fancy. I've got a few languages I'm currently learning.

 

/Peace

Share this post


Link to post
Share on other sites

I said to implement 'sorting algorithms' for learning purposes. It's nice that most of it is done for you with C# libraries and such but that's no reason not to learn how to implement them. The key here is the act of translating a concept (in the case, a search algorithm) into to code, rather than the product at the end.

 

C# and Java are 'powerful', but there's still a need to understand core lower level concepts.

Share this post


Link to post
Share on other sites

I said to implement 'sorting algorithms' for learning purposes. It's nice that most of it is done for you with C# libraries and such but that's no reason not to learn how to implement them. The key here is the act of translating a concept (in the case, a search algorithm) into to code, rather than the product at the end.

Perhaps I'm missing the piont, because translating a search algorithm to code is so trivial it's not worth doing. That said, it can be done in C# or Java or any other higher level language.

 

C# and Java are 'powerful', but there's still a need to understand core lower level concepts.

Like what? pointers? references? The difference between the two? How the various registers work in particular cpu? the stack? the heap? You say it like you can't learn 'core lower level concepts' on C# or Java. Don't need to learn C or Assembler to learn that. It's hard one to pick tho. I know all that stuff, including data sctructures, in the 25 years I've been coding I've never had implement a sorting algorithm from scatch and I don't think I can remember the algorithms for the various sorts either. I know the names, so if I need to I can go google the algo.

 

It's helpful to know the 'core lower level concepts' whatever that means. but it's not needed.

Share this post


Link to post
Share on other sites

I'm really struggling to see any practical advantage of making a point to learn several languages at once just for its own sake. You're going to knee-cap your productivity by needlessly tripping up on differing nuances as you switch back and forth.

 

IMO the best way to learn is to pick a small project (in any language) and then go about making it happen. Just about any fully fledged language can teach you how to program, which is the most important thing. Don't confuse "knowing a programming language" with "knowing how to program", because they're different things. Once you know really feel comfortable with knowing how to program generally - and I second kikz' suggestions on OO and good coding standards, learning a new language will be trivial.

 

As for how "powerful" a language is, that's all bullshit. A language is just a tool and as with any other tool, it's as powerful as whatever you personally use it for. It's a subjective word, subjective concept.

 

A high level language/framework is "powerful" in a productivity sense, but you usually sacrifice several degrees of control under the hood (which often doesn't matter in the slightest). A low level language is "powerful" in a control sense - you get full access to make every aspect at every layer exactly to your design - which is very time consuming, but a possible enhancement to performance. Also note that low-level control is something you can only effectively harness at a fairly expert level of programming.

 

It's then a question of what you want to do. If you're making an enterprise business applications, you'd be batshit crazy not to you use a robust, high level framework where productivity is king. On the other hand if you're making a game for a hand-held game console, it's likely you'll need access right down to lowest level so that you can use every last byte of memory effectively - you won't want a garbage collector, you won't want to allocate off the heap during gameplay, etc. Some high level languages make it difficult/impossible to control some of the things you may want.

 

And everything else falls somewhere in the middle - but usually I would always recommend sticking with the higher levels wherever they give adequate results. Making an indie PC game? use C# or similar ffs and get it done in a fraction of the time.

Share this post


Link to post
Share on other sites

Heh, no i have been working with python for a while now along with bits and pieces in bash and C.

 

It is more of an experiment to see what issues come up and to see if i can address them or not, its more to answer the question that was initially presented.

Share this post


Link to post
Share on other sites

I said to implement 'sorting algorithms' for learning purposes. It's nice that most of it is done for you with C# libraries and such but that's no reason not to learn how to implement them. The key here is the act of translating a concept (in the case, a search algorithm) into to code, rather than the product at the end.

Perhaps I'm missing the piont, because translating a search algorithm to code is so trivial it's not worth doing. That said, it can be done in C# or Java or any other higher level language.
No, it's trivial for you, because you've already gone through all the motions. Going from spec (or even pseudocode) to production code isn't easy for most beginners.

 

Sure you can do it in Java or C#, but that's not a compelling reason to switch from C.

 

C# and Java are 'powerful', but there's still a need to understand core lower level concepts.

Like what? pointers? references? The difference between the two? How the various registers work in particular cpu? the stack? the heap? You say it like you can't learn 'core lower level concepts' on C# or Java. Don't need to learn C or Assembler to learn that. It's hard one to pick tho. I know all that stuff, including data sctructures, in the 25 years I've been coding I've never had implement a sorting algorithm from scatch and I don't think I can remember the algorithms for the various sorts either. I know the names, so if I need to I can go google the algo.

 

It's helpful to know the 'core lower level concepts' whatever that means. but it's not needed.

 

Sure, pointers and references are important. Registers not so much. Knowing what the stack and heap are is also handy (and no, I don't mean going as low as defining stack frames in assembly). I consider 'core' concepts to be things like pass by reference/value, understanding how common data structures work, use of recursion, pointers/references, learning how to maintain clean code, understanding how to delegate tasks to separate functions, interpreting specifications, etc.

 

I understand that much of that is possible in C#, but perhaps you've forgotten how abstract OO languages are to beginners. C is the very essence if simplicity. It may not be the best platform for producing large scale apps, but it's a great mix of simple syntax and low-level control, and allows for a gradual learning curve.

 

Xen is clearly not learning a language to design X piece of software. I believe that a low level language is the best option for getting an insight into how programs work.

Share this post


Link to post
Share on other sites

I understand that much of that is possible in C#, but perhaps you've forgotten how abstract OO languages are to beginners. C is the very essence if simplicity. It may not be the best platform for producing large scale apps, but it's a great mix of simple syntax and low-level control, and allows for a gradual learning curve.

I get the feeling it might have been a while since most people in this thread were beginners, so I'd like to weigh in with my newbieness.

 

OO was very intuitive for me to learn. It wasn't abstract at all, it made perfect sense. I went back to trying to program in some procedural language a few months ago, can't remember which language it was, and it was devilishly hard. As a new programmer, the last thing I want is low level control. I see low level optimization as the domain of people with considerably more experience.

 

C# and java garbage collect for me, in C I have to write my own destructors, just more room for shit to go wrong.

Share this post


Link to post
Share on other sites

IMO, if one can't program in something basic as VBA/VB, might as well give up do something else.

Edited by Jeruselem

Share this post


Link to post
Share on other sites

C was chosen for the reasons that CyberGlitch has given and also that my intention is to do sys dev work on linux and *NIX variants.

 

I am looking at coding fairly close to the hardware level and my thoughts on C++ have been made previously.

 

IMO, if one can't program in something basic as VBA/VB, might as well give up do something else.

If i ever have to write anything in VBA/VB again i will probably shoot myself (same goes for coldfusion).

 

Kikz is right in regards to coding in High/low level languages, I've finished a project for work in python within a day.

 

I'm having to re-implement it in C for an annoying reason and i can already see its going to take a long time.

 

Just to let people know, i not really starting completely from scratch here.

Share this post


Link to post
Share on other sites

Perhaps choice of language comes down to whether you prefer writing code or delivering solutions.

 

What I mean is that some langauges, such as VBA/VB (nothing wrong with VB.NET ya know!) are shit aweful to write code in, for us as engineers and people who take pride in their work. But they're damned effective at producing a solution (quickly).

 

I've got one foot in both camps. I take pride in the code elegance of solutions. I enjoy writing code that's well thought out, has low coupling, high re-use, follows good OO principles (S.O.L.I.D.) and so on. but I also enjoy delivering solutions. I like being productive and giving something to customers that makes them happy. And they don't give a damn about what language it was written in or how elegant the source code is.

Edited by kikz

Share this post


Link to post
Share on other sites

Perhaps choice of language comes down to whether you prefer writing code or delivering solutions.

 

What I mean is that some langauges, such as VBA/VB (nothing wrong with VB.NET ya know!) are shit aweful to write code in, for us as engineers and people who take pride in their work. But they're damned effective at producing a solution (quickly).

 

I've got one foot in both camps. I take pride in the code elegance of solutions. I enjoy writing code that's well thought out, has low coupling, high re-use, follows good OO principles (S.O.L.I.D.) and so on. but I also enjoy delivering solutions. I like being productive and giving something to customers that makes them happy. And they don't give a damn about what language it was written in or how elegant the source code is.

The original question was about learning not about delivering solutions. From the learning point of view getting down and dirty with internals is a great way to understand what is going on. Too often I deal with developers who do not understand what is happening inside a library or framework which makes it hard for them to diagnose problems. With any large solution there are always going to be problems the framework cannot solve or an edge case where you need to modify how something works.

 

Case in point, I have interviewed a lot of candidates for jobs developing web applications. They all "know" ASP.Net but many don't understand HTTP, this is fundamental for a web developer.

 

If you want to be a well rounded developer learn more than just a framework otherwise you are nothing but a code monkey.

 

For the OP it's good to see you want to understand fundamentals, it is true that 90% of those fundamentals you will not use in a commercial setting but. My advice is to focus on fewer languages initially. C is great for learning low level concepts, python (my personal favourite so I am biased) great for a dynamic language, I would suggest as kikz mentioned a higher level compiled language like Java or C# (they are similar although C# is more modern and a bit nicer to use). If you understand those three other languages will make more sense and don't really take to much learning.

Share this post


Link to post
Share on other sites

Yes, its more about learning the concepts in this regard, as i mentioned before when i have to deliver something it will be in python as that's the one i know the most of an can actually deliver something that works.

 

Whilst at the same time I’m looking to move from my current work to somewhere with more of a focus on programming and sysadmin so I'm also looking at learning practical languages, because ill be the first to admit i have a long way to go before i could reasonably look at programming for a living.

 

Unfortunately from what I’ve seen it looks to be rather hard to start / step sideways into a programming position, particularly in that I’m looking at Linux / UNIX positions exclusively.

 

But either way this is foremost a learning experience :)

Share this post


Link to post
Share on other sites

why do people hate C++ so much?

My guess is they actually hate MFC or similar framework rather than C++ itself or have a poor understanding of OO coming from a C (procedural style) development background.

Share this post


Link to post
Share on other sites

I guess C is the most powerful language I've ever experienced - and by 23 I could program in 37 languages and was studying compiler and language design - focused on parallel language and algorithm design.

 

C is moderately difficult to learn and challenging to master; but a master of C can do things mere mortals can't. C is versatile - you could write a comipler for almost any language in C, thee reverse couldn't be said. Languages are like tools or platforms. Tools in the sense different ones suit different purposes. Platforms in that you need infrastructure - a framework or code base developed over time to encapulate what you want to achieve.

 

I've met one master of C - in 2 days he developed a complete inference engine for an expert system from scratch, he wrote the optimiser for C compiler at Bell Labs, he wrote the first symbolic debugger for C on UNIX in under 48 hours from scratch (ruining a PhD students thesis - poor chap was in his fourth year of PhD and this was what he was attempting. Brucee went on to write Plan 9 and host of other software; with C I'd say there was no programming task whatsoever he couldn't do.

 

Learning multiple languages is a rewarding thing to do, here's to you!

Share this post


Link to post
Share on other sites

why do people hate C++ so much?

C++ lacks many of the big conveniences that newer languages have, such as automatic garbage collection. C++ also lacks the in depth documentation of many newer languages. There is nothing quite like the Java API for C++.

 

This combination is rapidly moving C++ into the realm of heavy wizardry for new programmers. The current game in software is to know as many languages as you can possibly get your hands on, especially if you want career options. You could learn C#, java and python to an acceptable level in the amount of time it takes to get well antiquated with C++. Its just not a time efficiency language to learn, or to program in for that matter.

 

Since a lot of new software development is taking place in python, C++ is becoming somewhat like FORTRAN. Its very existence is almost entirely justified by the fact that so much crap uses it that not having someone who knows it could cause you maintenance headaches.

 

Essentially, it needs to die in the context of most software development, but wont, and god damn I wish it would.

Share this post


Link to post
Share on other sites

I wish more people started learning Scala, it's so much better than Java. It's like people are scared of functional programming.

Edited by .:Cyb3rGlitch:.

Share this post


Link to post
Share on other sites

I wish more people started learning Scala, it's so much better than Java. It's like people are scared of functional programming.

It's probably a useful think. Functional languages aren't as useful as the procedural languages and their derivitives (esp OO). Particularly in the applications world where the top languages rule.

Share this post


Link to post
Share on other sites

I wish more people started learning Scala, it's so much better than Java. It's like people are scared of functional programming.

It's probably a useful think. Functional languages aren't as useful as the procedural languages and their derivitives (esp OO). Particularly in the applications world where the top languages rule.

 

Scala is functional and object orientated. It also supports Java libraries without any special considerations or boilerplate code. It's quite elegant.

 

EDIT: Here's a quick overview (it's by no means thorough though).

Edited by .:Cyb3rGlitch:.

Share this post


Link to post
Share on other sites

I wish more people started learning Scala, it's so much better than Java. It's like people are scared of functional programming.

It probably has to do with the fact it's a very niche market. Scala is to Java what Ruby is to PHP.

 

PHP is popular because it's installed on a lot of cheap servers, it's relatively similar to C in terms of syntax, and despite being horribly verbose, only recently introducing namespacing, having very little open sourced libraries, and having a horrible package system it's the predominant web language.

 

Java is similarly popular because it's relatively similar to C style syntax, has some niceties that you don't get in various C languages (maybe C# has them?) that make it harder to kill your application, and because people like to code literally everything to do in Java (so you see Java desktop apps, Java web services, Java web applications, Java games etc).

 

Scala is a lot nicer than Java, it's not as verbose (although it's not nearly as terse as Ruby which is a shame), and it's the sort of language that helps you do your work, rather than make you do more (see: PHP, Java, and any other language where you have 50 lines of code that could be condensed into 10). If I was going to be developing the backend for a web app that had a heap of users, I'd be using Scala (that's what Twitter do, and it seems to be working pretty well since they moved from Rails).

 

Sidenote: Python seems to be quite nice. I'd prefer Ruby over it, just because it's got a bigger/more active community, but I've been using CoffeeScript heavily as of late, and the idea of your code's formatting being important is nice (and it enforces the other developers who work on my code to keep it looking nice!)

 

 

Depends where you're looking :)

https://github.com/languages

Most of the projects and developers I'm interested have work on github, so find that to be a more authoratative source - for me - than Tiobe's results.

 

 

 

Finally: to the OP: if you're interested in cutting edge sort of stuff, getting to grips with JavaScript and CoffeeScript is a great idea, understanding a-synchronous UI's, and then checking out Node.js would be a pretty good idea.

Edited by superfireydave

Share this post


Link to post
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
Sign in to follow this  

×