After having spent much time with Groovy/Java, and a bit with Ruby and a bit with C#, I have a newer perspective on learning new programming languages. Much of my thoughts are summed up by this post from Gustavo Duartes. I liked his choice of words at the top – “language dabbling” – which largely describes my C# and Ruby experience. I’ve done a little bit in them – some paid in C#, some not – but the bulk of my work is in PHP, with a small but growing bit in Grails.
It’s interesting to note his acceptance of “more than one”, but focusing on the “minimal required set”. We tend to think of languages as Java,C#, Python, etc., but competent web developers need to have a handle on SQL and JavaScript as well. Many also get into Flash/Flex/Silverlight too, and while CSS isn’t a *language* specifically, it’s something most web developers should be acquainted with. So, regardless of your serverside language of choice, there’s going to be 2-4 other technologies you need to be at least competent, if not proficient, with. This may be more the realm of small shop and independent developers – people working on larger teams or in companies with divided responsibilities may be able to get away without knowing any SQL or JavaScript, for example.
One of Gustavo’s points was that you lose momentum on your main language when you start dabbling with others. There may be a point there, but I suspect some people end up looking at other languages when they reach a plateau in one. That was certainly my point I reached with PHP. Having used it since early 1996, there’s only so much more I feel I can do with it. Yes, the language is evolving slowly, and I’m not keeping up with the ‘best practices’ of namespacing and such in 5.3, and I could probably architect my apps somewhat more strictly using some of the bigger frameworks out there. However, one of the things you end up learning when you look at other languages is where some of the defects are in your primary language. You may start to see the new ‘best practices’ as work-arounds in language deficiencies.
It’s easy to point at PHP and talk about how “it sucks” and all that, but I’ve had experiences with some friends who’ve moved from Java over to PHP. While this was a somewhat unwelcome move at first, given PHP’s reputation amongst the ‘enterprise crowd’, at least one of my friends is really enjoying being able to be much more productive – more functionality in fewer lines of code – and rethinking some of his approaches to web development. Moving from any statically typed language to a dynamic one is certainly a shift for people to make (and the reverse movement is true as well!), and rethinking those problems we’ve taken for granted can be a real eye-opener.
In the short term, yes, it’s a productivity loss, as Gustavo points out. In the longer term, it can really provide you with many more tools in your toolkit for attacking new problems.
One caveat I’ve noticed to this is the old saying “choose the right tool for the job.”. Great in spirit, but my experiences have borne out that rarely is the definition of “right” able to be agreed on. ”Right” for who? The DBA? The sysadmin? The developers? I had a project I’d recently prototyped in Grails (after an initial first pass prototype in PHP 6 months earlier). The Grails environment allowed for much more rapid prototyping and modeling of data, relationships, screens, and so forth. However, when it came time to accept it, I was told we could *only* build the app on a traditional LAMP stack (I was looking forward to using PostgreSQL on this project as well). Why? Because the limited system administration staff didn’t have the time to learn new skills to manage the new technology choices.
While initially I was bummed out, I can understand the decision making process. I was able to take the db tables from Grails and wrap another PHP ORM layer around them so I didn’t lose all my work, but it certainly put to rest the maxim “right tool for the job.” Who gets to decide?
So, even if you learn new languages and technology, you might not always be able to use the most appropriate tool from a pure technology/productivity standpoint. And sometimes knowing that there are better options out there that you *can’t* use for various reasons adds a level of frustration to the mix that you wouldn’t have. Perhaps we should all stick to just knowing one language and one language only, right? :)
I agree with Gustavo that learning new programming languages is a waste of time for most programmers. I worked with a few languages and learned a few more. The most code I have written so far in C++, Perl and PHP.
The problem is not so much the language, but all the libraries that come with them. For each library you have a new ORM, a templating language, collection objects, CGI wrappers, getopt wrapper, … and so on.
Of course every new language sounds exciting in the beginning and include one or two features which you think you need. But usually the switch to a new language is more expensive than the gain. Even if you are staying in one language and are switching between frameworks it might already not be worth the effort.
And as you said this all assumes that you are working alone, as soon as you have a few programmers working on a project you have to decide on a handful technologies, because all of this code will have to be maintained in the future. And if the one guy who thought that rendering the icons with Logo is a good idea has left, everyone else has to pay for it.
Someone once told me that you need ten years to be fully fluent in a language and there is only so much time you have in your life.
That being said, I still like to read about being new language and maybe one of these will be the next PHP, Java, C++ . But it won’t happen if everyone using these newcomers also uses 20 other languages.
Thanks for the great post Mike. I’d add Javascript-wise it seem that familiarity with a library like jQuery, MooTools, or YUI is also helpful. As looking over various websites it seems that fewer and fewer people are writing “straight” Javascript. And I’m seeing more and more job descriptions that are looking for competency in one or more JS libraries, particularly jQuery.
It seems that the right tool is what the company/client is already using and has some competency in instead of rewriting everything in Ruby, for example, just because you can.
Michael, I really enjoyed your post. I regularly use the phrase “the right tool for the job” and never thought much about it being a matter of perspective.
I am primarily a Java developer and used to think that was all I needed to know. Then I discovered Ruby (briefly) then Groovy, Python and briefly some functional languages. I truly enjoy learning new ways of approaching a problem. Becoming familiar with other languages has broadened my horizons. So I don’t see dabbling as a waste of time.
Finally, if you are a web developer, you must become a competent JavaScript developer. And yes, you should be able to work with divs and CSS. I see no other way around it.
I understand your Ruby experience perhaps more than most, and I’d probably agree with you in your situation. But I’d also argue it’s a bit contextual. If a consultant comes in and understands that company X developers on staff have limited time to get up to speed on new tech, then working with their old tech makes sense. If the reason company X devs are continuing with old tech is simply because they’ve never tried anything new, and are willing to learn new things, *and* the new tech provides demonstrable benefits (speed, time to market, etc), then it’s silly to *not* take advantage of new tech. You’re making the entire organization less competitive so satisfy the laziness of a few internal developers. I’m *not* saying this was your situation, but I’ve seen it at others (mostly several years ago, I’ve not seen that happen too much in recent memory). Also, larger orgs have a tendency to coalesce around a few ‘core’ technologies in the name of productivity, but will over deep-six efforts to modernize technology stacks more out of a fear of losing political power than anything else, which again can put the organization at a competitive disadvantage.
And you can become a competent JavaScript developer by reading JSMag
Use coupon code “kimsal2″ to grab a free issue!
But seriously, yeah, that ‘perspective’ thing is becoming a bigger issue for me over the last year. ‘Best tool’ for a client last year was a Microsoft stack, which isn’t my main competency, so I’ve had to lose some work there over that. Not that I *can’t* do the work – I did some – but they ultimately found someone who was a better fit overall. I didn’t fight it – after exploring some alternatives with them we agreed that the initial MS direction was the best choice for their organization.
Hey Mike – great post!
I’m not sure if I’m the friend you were referring to who was “forced” to move from Java to PHP and is now loving it (paraphrasing), but that is sort of my situation. PHP (or perhaps more accurately, the entire LAMP stack) is now the 3rd web dev stack I’m working with, having started out with Objective-C and Apple’s WebObjects (which spoiled me for everything since), then moving to J2EE. All of these environments have their pro’s and con’s. In my case, learning these new languages was literally a matter of survival. I have a few “die hard” friends who refused to acknowledge that Obj-C/WebObjects was dying, who are now struggling to make a living writing apps for the Mac and iPhone. I’m also starting to see the writing on the wall for J2EE. Certainly one can still make a good living with Java, but fewer and fewer new projects are using it. Eventually (and this has been said before I’m sure), Java will become the next COBOL.
PHP is popular among web developers in part, I think, because of its similarity to Javascript, both in terms of the “dynamic” nature and even the syntax itself which is pretty similar. Many Web developers seem to be allergic to compilers, whereas I am still a big fan of them, as long as they are lightning fast and rock solid (which has been the case with Java for some time now).
In terms of productivity, I have come to realize that with PHP you are trading off speed for maintainability. It’s very easy to build things quickly with PHP, but fixing bugs and maintaining the code is very hard, because the dynamic, loose typing means the IDE and compiler cannot help you navigate the code or automatically find problems in it. For example, there is no easy way to definitively find all usages a given PHP method, even with PHP5 and the latest IDE’s. The fact that you can define new variables on the fly means you can easily create bugs like the following:
$user->getEmployee($id);
If $id has not been defined, PHP will just go ahead & define it for you on the fly. In Java, this statement wouldn’t even compile if $id hasn’t been defined yet.
So PHP requires more cognitive overhead while you are writing the code as well. I find with Java I can write code more quickly and confidently, so even though I have to write more of it, I generally feel more confident as I’m writing that the code is going to work, whereas with PHP I often find myself having to think a lot harder. Surely that’s just lack of familiarity to some extent, but I do think the languages themselves have some strengths & weaknesses. Basically I think PHP is great for new “startup” projects that may have a short shelf-life, whereas Java is better for very complex projects that are going to be around for a very long time.
MPS, no you weren’t exactly the person I was thinking of, but yeah, I guess you’d fit that bill as well. I want to reply a bit more, but have to run right now. Will try to reply more later… mostly on the ‘cognitive overhead’ comment, which I think is about 110% wrong.
MPS, “cognitive overhead” is an odd charge to level at a language like PHP. I constantly find myself having to think about stuff *all the time* in Java. Whoops – I forgot to import these libraries. What are the args for that method again? Where are any working examples of anything written in the last 3 years?
public static void main() {
Integer.parseInt(“abc”);
}
My IDE doesn’t catch that, and I still get a runtime error.
To each his own. I guess if someone has spent years in a statically typed world like Java, moving to PHP or Ruby or Python (or Groovy) can be very confusing, and feel “unsafe”. To people who’ve lived in the dynamic world for a considerable time, the ceremony and boilerplate of a language like Java is confusing, and carries much more ongoing “cognitive overhead” than something like PHP.
The TDD crowd might be on to something – test-first development would catch 99% of these issues regardless of platform. But… if you can get an extra degree of confidence in the code *and* you can do that with far less ceremony, why stick with Java? I think that’s a prime motivation behind the exodus to the world of Ruby/JRuby/Jython/Groovy/etc. Java people moving to PHP are probably very pragmatic – that’s where there’s lots of work/money/security. Java people migrating to Ruby/Python are, from what I’ve seen so far, trying to find more elegance.
Hi, good point. I would agree that learning new languages is expensive.
Well but i cant throw the first stone
i have studied plenty of languages and i have ideas which language to learn as we speak! I think the key is to have balance. If you read a few books out of your scope a year that will help and broaden your horizon. If you are spending most of your time on learning new new new new languages … then you are loosing focus on your profession.
I think that frameworks and libraries are good thing to lear. You can see how do they do it in other technologies. Language is just another syntax, unless its something completly different like assembler or scala
To summarize, learn but with balance.