9

If so, can you tell me how learning a new paradigm changed your approach for solving programming problems even if the problem is in another paradigm/language/technology?

I will really appreciated If you can tell me in a specific manner, how your X (ie: JAVA/C#/C++) programming skills improved by learning Y (ie: Scheme/Prolog/Lisp).

Also, what paradigms do you suggest helps the most to become a good programmer?

My experiences are only structured - OOP, imperative - procedural, and into some extent template meta-programming, but my goal is not to learn another language, but rather to learn different approaches for solving problems.

Thanks!

migrated from stackoverflow.com May 8 '11 at 17:41

This question came from our site for professional and enthusiast programmers.

  • 1
    I believe the answers to this will be some form of a resounding yes. – R0MANARMY May 8 '11 at 17:51
7

I try to learn at least 1-2 new languages every year. The most I gained was from learning a functional language (F#) which changed the way I look at solving problems - I=now I try to tell the machine what to do instead of how to do it, especially in C# where I use Linq heavily and immutable objects now that I know the benefits of using them. I also use higher order functions quite a lot (methods as parameters) an my coding style has changed (improved) as a result.

  • 1
    Ditto for my Python programming. I would have failed miserably at writing all that tree-munching and parser-generating code in a certain if I hadn't learned the techniques I ended up using (trees pretty much imply recursion or a hand-rolled version thereof, the parser generator consists of higher-order functions and is inspired by parser combinators, etc.) by learning Haskell. – user7043 May 8 '11 at 17:51
  • Thanks, you reaffirmed what I was suspecting... Thanks Again! – Armando May 27 '11 at 4:11
2

Absolutely. Every programming language you learn will have a different way of doing certain things. Some things will drive you crazy, some things you'll love and other things will slowly grow on you.

Its never a waste of time to learn at least the basics of a new language.

1

Ok, here's an example I've encountered.

I've learned a relatively old language (VB6) for a project on some old code we had.
The language is very windows-oriented but there aren't as much high-level powerful classes like we have in .Net framework.

I had to do some picture manipulations, and that introduced me to the windows API functions for the picture manipulations.

After I've learned that it gave me a better understanding of .Net's GDI Classes. And the understanding that sometimes using windows API will be much faster (less function wrapping).

So that's to show that even when you learn old code, you can still learn and get another perspective.

1

Can you Improve your programming skills by learning other language paradigms?

In my experience, definetely yes. Having several different ways of attacking a problem is like a palette of tools. One day you (as I did) will have use for these other tools. Or possibly not. It all depends. Some exempels:

Languages generally does not stand alone, they come with an environment. I did spend a bit of time learning an odd language known as awk . It relies on pattern matching using "regular expressions". From trying to learn the C++ STL (not very successful) I learned about maps . Combining these two concepst I could very quickly write some text transforming utilities in Pearl (the only language available on the plattform ) .

Mostly for the fun of it I tried to learn Erlang (not very succesful). It has a library of functions known as OTP implementing among other things a way of handling errors, sometimes known as let it fail and have a monitor restarting the functions. I have used this idea in some areas, sometimes simply letting things fail instead of doing endless tests.

Trying to learn Haskell (again not very successfully) has really opened my eyes towards other ways of attacking problems. Functional programming sort of (to my mind) starts with writing code that says what result you want, not the writing the steps involved in getting there. I find that this really helped me in writing better SQL code.

Lately, I did try a bit of javascript. And found an environment known as nodered. No code needed for creating a small home automation server.

To put it in perspective, most of my dabbling in various languages was (and is ) on a rather shallow leve mostly to get a feel for what people are talking a about. There are very few languages I actually can be productive in.

0

I also learned a lot from dabbling in a functional language for some time. However, what I took from it was less about doing things differently from imperative languages so much as how to make concurrency easier. It can be applied just as easily in an imperative language as in a functional language, but for some reason, most of the examples I've come across in imperative languages were more complicated. (Other things turned out to be way more complicated in functional languages.)

Another thing I learned from a new language was additional programming patterns. I had read about many of them, but seeing and using several really good implementations of them made it easier to understand and really drove home their usefulness and when they are appropriate.

Not the answer you're looking for? Browse other questions tagged or ask your own question.