views:

1584

answers:

18

I'm sat here tonight bashing out some Project Euler with Python for virtually the first time and as a .Net developer, I am a little out of my comfort zone. (Maths is not my strong point and I am diving into python). Part of me wants to fire up Visual Studio and get the problem's solved but there is another side of me that wants to do this in python so I can find out what the fuss is about.

My question is : Is this doing my real work any good? Is it beneficial to learn more that one language? Or can it be unproductive?

From my current experience working in a vba/vb.net/c#/SQL/asp.net/js environment and coming from a Delphi background I sometimes end up thinking in some psuedo-code. And there have been times where vb's session() and c#'s session[] have tripped me up for a long time.

+45  A: 

If the only tool you have is a hammer, you'll treat every problem as a nail.

In other words, it's very useful to have working knowledge of several different languages, and generally attempt to be language agnostic. Knowing several languages allows you to see solutions to problems that wouldn't otherwise be considered if you only knew one language.

Adam Davis
+2  A: 

learning a new language not only expands your skillset, but many times gives you ideas for better patterns of how to implement something in your language of choice.

I'd recommend you learn a new language (or a subset) every year.

Michael
+1  A: 

Yes. It broadens your perspective and permits a much deeper understanding of how a computer and a programming language actually work, which the VM-type environments obscure from you(sometimes quite heavily).

Paul Nathan
+1  A: 

The idea is to learn new ways to approach the same problems, not necessarily to replace your old toolset. To this end, you should not only learn Python, but learn the Pythonic way of doing things, by for example, comparing your Euler solution to other solutions given in the answers thread.I don't think it can ever really be "unproductive," as long as you don't wind up using Python idioms even where they don't make sense. But this is part of the process -- as you pick up new techniques in your arsenal, you have to decide when and where these techniques are applicable.

Jimmy
A: 

"vba/vb.net/c#/SQL/asp.net/js"

There's at least 4 languages there. Are you professional at all of them? Are you guru at any of them?

David B
yeah... thats not for me to answer. But that's what my worry is. I bumming around doing python (for fun) where I could be a guru at one of those.
John Nolan
+1  A: 

Different languages have different applications for certain situations.

For instance, I could write an entire web app in Java and have it run as an applet. But there are several other languages that are much better suited to running in a browser environment.

contagious
+11  A: 

The right language can make your code easier to write.

If I'm just trying to parse a text file, that's a lot quicker to write in Python. But if it needs to be really fast, suddenly C is more attractive.

When I'm coding a complex algorithm, a high level language like Lisp lends itself naturally to abstractions that would be comparatively clumsy in C++.

I often start coding in one language and switch to another once the algorithm's kinks are worked out. Prototyping in Matlab and then moving to C is very common. You don't have to worry about dynamic memory issues while prototyping, and when you're ready for prime time you switch to something faster. But if you only knew C, you'd take longer to finish because you'd have to worry about all those little details that Matlab hides from you.

amo
+2  A: 

I don't think anyone is going to argue that learning more than one language will help you as a developer and a problem solver. I think a more important question is when should you learn this new language or these new skills. If your company provides time for training or learning new skills, I would dive in during this time. Otherwise you need a good business reason to justify using another language to solve a problem that is costing your company more $$. A lot of this boils down to your relationship with your employer but learning new languages will help you and eventually your company in the long run.

SaaS Developer
Learning a completely different language will, without doubt, help you as a problem solver. Because you will be forced or encouraged (depending on language and problem) to solve your problem in a completely different way.
gnud
Yeah that's what I was trying to say. No one will (or should) argue against that fact.
SaaS Developer
+2  A: 

Since language is the natural way to express our thoughts, a different language will help you think differently. I found this to be equally true for programming languages.

Especially python helped me address problems in a way i couldn't before, and I refer especially to the parts of the language that seem freaky (functional, duck style typing, generators,...) if one thinks along the lines of the languages you mentioned.

tabdamage
+4  A: 

The question I find myself mulling over more than "Should I learn this language" is "If I learn this language, will it be replaced by $SHINY_NEW_LANGUAGE_OF_THE_DAY in two months, therefore rendering what I learn useless?" With the turnover rate of technology in general, I'm having a harder time figuring out if it's even worth the effort to learn a language/framework/feature because odds are, it will be outdated by the time you can even get to a level close to mastery.

Lieutenant Frost
Maybe, but having learned that will put you in a better position to learn the next big thing. Plus, the more you know the better ;)
Rafa G. Argente
+2  A: 

You played RPG few times, right? You know what multiclass means? When you learn other class skills you have some benefits and some limitations. You lose in being better in your main class, and you win in that you can do something that other class members cannot.

Same here. You have limited amount of time (you can't change this) and you choose if you spend it to improve your skills in your current toolset, or to learn new toolset. Being expert in one language or being newbie in 10 different languages, it is up to you ;)

Ilya Ryzhenkov
A: 

I think learning new languages is a good habit, providing you don't do it at the expense of missing deadlines :) However, I think it is important to be very selective about what new languages you might introduce into a production system -- if you are the only one who knows Python, it isn't a good idea to add it. That's kind of a systems/architectural decision that should be made carefully.

Jeff Kotula
+9  A: 

I found learning Python to be very specifically helpful in deepening my understanding of C#. While working on Python projects, I learned about generators, which are extremely easy to implement in Python.

Seeing how the yield statement works in Python made it easy to understand the very similar yield keyword in C#. Understanding why you'd implement a generator in Python also made it a lot clearer to me why you'd do the same in C#.

I put this to direct use almost immediately. I built a class that implemented IEnumerable<T> over something that was pretty hairy under the hood (a series of calls to an external API). Now I can write LINQ queries that automatically get translated into API calls. This has simplified code throughout my entire application.

Could I have learned about C# generators another way? Sure. But I didn't. The C# docs for yield and IEnumerable<T> have been available to me for months, but I never really understood them. Being exposed to the concepts in a different context made them much easier to grasp.

That's a pretty solid example of how working in another language can inform your understanding of the one you work in every day.

Robert Rossney
+5  A: 
John Nolan
I think the middle graph is too pessimistic. Hopefully you became more productive in general by learning OO, even if it took some time to get up to speed. Otherwise it would indeed be a waste of time.
JacquesB
A: 

I suggest that you carefully watch a technology before investing time on it (Slashdot/Delicious/Digg and others). What you are doing is correct. I'll also advise you to watch out for marketing/mob smells.

These days I've given up chasing the latest. Instead I find it much better to put more time on my Stroustrup/Knuth/SICP.

Vulcan Eager
+7  A: 

Alan J. Perlis said:

A language that doesn't affect the way you think about programming, is not worth knowing.

So we should learn a language for better thinking about programming, maybe in a completely different way from the stuff in daily working. From a practical point of view(learning by doing), Peter Norvig suggests to:

learn at least a half dozen programming languages. Include:

  • one language that supports class abstractions (like Java or C++),
  • one that supports functional abstraction (like Lisp or ML),
  • one that supports syntactic abstraction (like Lisp),
  • one that supports declarative specifications (like Prolog or C++ templates),
  • one that supports coroutines (like Icon or Scheme),
  • and one that supports parallelism (like Sisal).

As my own experience, at least the concepts of dynamic programming, functional abstraction and coroutines are important to all programmer, no matter what language you are using in your work.

Neo
+1  A: 

here are som peeps wondering same thing. I think one of the important threads is that you should learn different kinds of languages: assember, C, functional, OO, ...

http://ola-bini.blogspot.com/2008/01/language-explorations.html

http://it.slashdot.org/article.pl?sid=08/03/18/1633229

http://khigia.wordpress.com/2006/11/02/what-is-my-next-programming-language/

http://mvanier.livejournal.com/998.html

Gene T
+1  A: 

Different languages will solve the same problems differently. If you read the GoF book and the various implementations of the patterns you'll see some of differences in the solutions. Knowing how to solve issues differently with various languages will enhance your ability to think out of the box when addressing new problems.

David Robbins