views:

936

answers:

13

I have been learning PHP for a few months now and I'd also like to learn JavaScript as I think they would make a good set of languages together for the type of projects that I like to do.

But is it wise to learn two languages at the same time? What are your experiences with this, do you get the syntax of each language mixed up with each other.

To add onto the question, how many languages do you know?

+4  A: 

I figure that I "know" 1.5 languages at any given time. Right now it's Java and "DHTML" (HTML/CSS/JS). A few years ago it was Java and SQL, and a few years before that it was C and SQL. Twenty years ago it was 8086 and C.

I find that I learn languages on an as-needed basis, and the level to which I know the language is how much I use it. Reading a book is not sufficient to truly learn a language.

As far as "danger": unless you're working on a life-critical system, there's no real danger. And if you are working on a life-critical system as a junior programmer ... well, that's a really bad idea.

kdgregory
Working on life critical systems in PHP is also a bad idea :)
Kibbee
-1 for "if you are working on a life-critical system as a junior programmer... well, that's a really bad idea."
Robert S.
really? why? are you discounting the benefit of experience?
kdgregory
Your statement is myopic. Junior programmers can work on life-critical systems and never touch code that is integral to the criticality of that system.
Robert S.
The life-critical systems that I've seen tend to require the same standards from input, through processing, to control. Your experience may be different. You are speaking from experience, right?
kdgregory
+8  A: 

Go for it.

You'll occasionally get the syntax mixed up but it won't matter.

It'll broaden your linguistic horizons. Give you better ways to solve problems.

Arnshea
+1  A: 

I've never seen a person gets syntax mixed up between languages before. I don't think it will be a problem. Sure little things slip sometimes but it's a very minor thing...

Not counting markup languages (XML, CSS and the like), I knew and can program in about 9 languages (dialects included).

chakrit
If you haven't, look at me. I've had to learn and use both Python and Ruby over the last six months and switching back and forth is driving me crazy. Is it nil? None? False? false? Argh. I'm pretty good at learning languages but I still mix things up occasionally.
Bryan Oakley
+2  A: 

I am in the same boat as you are. At least for me as long as i have a firm grasp on the basics of the language, i am alright to work on learing something else like sql, or javascript.

But if you are still learning basic things like syntax or the basic functions i would suggest spending a little more time to get more comfortable before you start on another language.

Eric
+5  A: 

What possiblemente a pu aller wrong with dieses Situationen?

simon
Nice answer! Very Spinradesque!
mwigdahl
+7  A: 

It's not like martial arts, where learning two very different styles at the same time can confuse your muscle memory and prevent progress.

Maybe the only down-side is that by dividing your attention, you divide your progress. But that's not necessarily a big deal.

I would say that JavaScript is a decent one to learn not only for the obvious functionality and ubiquity, but also because it has C-style syntax. In fact, if you do enough PHP and web work, eventually you will probably need JavaScript.

JavaScript is not among my favorite languages and can be frustrating to deal with especially depending on your IDE, but it's a fact of life right now, and C-style syntax is widely used and good to understand. With that you get some hooks upon which you might hang, say, C# or Java. And so many others.

As for how many languages I know...

I'm sure I've "known" at least a dozen things that could qualify as languages. Right now I feel pretty strong in VB.net, Html, Sql/TSql, Xml, and probably a few others - and some of those are barely languages, but what do you think those L's stand for? :)

I will tell you this: learn as many languages as you can. Not necessarily all at once and not necessarily deeply, but indulge and cultivate that curiosity (it's a core developer attribute!), because more languages == more perspective.

One last thought: JQuery is a fantastic tool that makes JavaScript more bearable. It's very powerful and you get instant eye candy. Once you've got your head around the syntax of JS, I would recommend looking at it.

Brian MacKay
+2  A: 

If your brain can handle it, why not.

In some occasion (like yours, web development), you need to use more languages together.

friol
+1  A: 

30 years ago, when fortran and basic were very much alike, it was a bad idea to learn both at the same time (guess how I know this?)

There really isn't any reason why you can't be learning multiples at the same time, just be sure that they aren't syntactically so similar that you confuse the two (because, believe me, when your assignments won't compile and the computer lab is closing in 10 minutes and your visual review of the code shows NO problems, you WILL wish that you hadn't taken fortran and basic the same semester)

KevinDTimm
+1  A: 

You will be better off learning languages that have similar syntax, PHP, Javascript, C#, Java should be fine.

CodeToGlory
+2  A: 

I had a tongue in cheek answer earlier, but there really is a potential issue with this in general. There is a big difference between writing working code that is syntactically valid, and writing working code that is also idiomatic.

If the language idioms are very similar, you won't have too much much trouble, but if they're really different you may find that this makes it take much longer to really "get it".

I find that when learning a new language it helps me to immerse myself in it for a little while, until the quirks (both of the language and the language community) make sense to me. How long that takes will vary with person and language, unsurprisingly.

simon
That's a really good point; writing idiomatic code can be overlooked when you focus on writing code that compiles and executes correctly.
Jeff Barger
+1  A: 

Learning two languages isn't always bad. PHP and Javascript compliment each other very well. Most people on here are right when they say that any programmer can only really "know" two languages at the same time, mostly because you only really use two languages at the same time (except for the extreme basics like HTML/CSS where you've probably done so much and they're relatively simple enough to use on a day-to-day basis).

There are actually some languages that compliment each other very well, like PHP and Perl, or C# and Java.

Brian
+1  A: 

I remember many years ago taking FORTRAN and Basic at the same time. No real problems, until I wrote a (I think) DO...NEXT loop and had a hard time tracking down what was wrong. FORTRAN, if memory serves, used DO...CONTINUE, and Basic used FOR...NEXT.

Carl Manaster
+1  A: 

In your specific situation, I don't see any potential problems. If you were learning two very similar languages, I could see how you might occasionally confuse syntax or other things.

I remember one semester in college where I was doing work in SQL, Java, C++, C, and a (very small) subset of x86 assembly, plus using ASP.NET with C# at work, and being in college, I was pretty new to almost all of the languages. There were times that I had to stop for a second and remind myself what language I was working in, but I don't think it slowed my progress with any of the languages I was working in.

Jeff Barger