You are not logged in.

#1 2010-07-23 16:46:43

Fragasaurus
Member
From: Ottawa
Registered: 2010-05-20
Posts: 25

What's a good way to learn multiple programming paradigms?

G'day,

I'm starting college in a few weeks, taking programming.  Seeing as how the local community college ain't exactly MIT, I'm trying to come up with a way to give myself an edge in terms of knowledge gained.

The program I'll be taking focuses almost exclusively on Java.  So I decided that for every piece of code I learn in Java, I should rewrite in a handful of other languages to get a better understanding of what languages work better in what circumstances.

I've been pondering about what languages would facilitate this kind of learning, though.  After all, I don't want to simply learn a half-dozen similar languages.  They should be varied enough to cover all sorts of different thought processes.  I'm currently leaning towards the following:

C/C++
Something Lisp-y.  Scheme perhaps?
Python

Time permitting, that should leave room for a couple more, I think.  Any suggestions?  What other languages would you folks recommend for this?  Is this even a good strategy?  Does anyone have any tips on broadening one's versatility as a programmer?

Thanks for any potential feedback.

Cheers,
Mat

Offline

#2 2010-07-23 16:57:39

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: What's a good way to learn multiple programming paradigms?

> After all, I don't want to simply learn a half-dozen similar languages.
I have a hard time picturing you rewriting every java app you write for the classes into C, python, Scheme etc. There are 24 hrs in a day, I'm not sure how well you can do it. And then there are questions like: python 2 or 3 etc.

Offline

#3 2010-07-23 17:02:31

Fragasaurus
Member
From: Ottawa
Registered: 2010-05-20
Posts: 25

Re: What's a good way to learn multiple programming paradigms?

I can always try.  If I run out of time, so be it.

Offline

#4 2010-07-23 17:11:36

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: What's a good way to learn multiple programming paradigms?

I honestly mean no offense, it's your life and you shape it etc. etc., but some people need a *real* java dev, or a *real* C dev, and not sb who has a dozen langs in their CV and thinks (s)he rocks.
Have you ever seen a guy who is a dentist, cardiologist, neurologist, cryptologist and manicurist?
Yeah, creating illusions of being a jack-of-all-trades gets you only this far. Of  course, if you *really* are good at couple langs / paradigms, you have a bright future :-)

No, I'm not a dev, but I still have nightmares dating back to the time I was helping a friend to hire a couple developers. I laughed  only not to start crying.

Offline

#5 2010-07-23 17:12:46

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: What's a good way to learn multiple programming paradigms?

I think that's a great idea. I did something similar when I was in college.

First, a few comments about what you said:

Fragasaurus wrote:

The program I'll be taking focuses almost exclusively on Java.  So I decided that for every piece of code I learn in Java, I should rewrite in a handful of other languages to get a better understanding of what languages work better in what circumstances.

I think Java is favored so much in schools is because it has a pretty simple and clean syntax and it includes a huge API. This allows you to learn what you are doing instead of spending a lot of time learning how to do it.

Fragasaurus wrote:

C/C++
Something Lisp-y.  Scheme perhaps?
Python

People often lump C and C++ together, but in my opinion they are very different languages. Learning C might help you learn more about procedural and structural programming. Also, since so many languages are based on C, (including Java) it would help you to be able to "read" many other languages. I can't think of any good reason to learn C++ except for the purpose of learning C++, but the problem with that is that, to learn and use what makes C++ "C++", you would probably need to do more than just redo the assignments from class.

I LOVED studying functional programming in school. I think I spent the most time using ML. Haskell seems to be the popular functional language nowadays. I highly recommend learning functional programming.

Python is a pretty language and the syntax looks pretty different from C, but I'm afraid that you wouldn't learn much "new" stuff by using it.

...Anyway, I think my biggest concern with your plan is that your school might ask you to make something that is easy to do in Java but is would require you to learn more than one extra library if you were to do it in another language. For example, "Make a window with a button that says 'Hello, World' when you click it" would be pretty quick and easy in Java, but would be quite tricky in C. (you would have to learn how to use the Windows API or GTK+ or some other library)

Fragasaurus wrote:

Does anyone have any tips on broadening one's versatility as a programmer?

My suggestion is to pick a language and paradigm that you want to learn and think of a program you would like to make by using it. I'm doing the same thing with Python right now, but haven't yet decided which program I want to make. smile

Offline

#6 2010-07-23 17:14:03

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: What's a good way to learn multiple programming paradigms?

Fragasaurus wrote:

Does anyone have any tips on broadening one's versatility as a programmer?

Thanks for any potential feedback.

Cheers,
Mat

Practice and then practice more. There is no way you will remember the syntax of every language even after years of working on one. There will be times when you will have to take Google's help. So concentrate more on the whys rather than the hows.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#7 2010-07-23 17:20:58

Fragasaurus
Member
From: Ottawa
Registered: 2010-05-20
Posts: 25

Re: What's a good way to learn multiple programming paradigms?

None taken.  I see your point.  It's a good one.

The purpose isn't so much to learn the languages as it is to train myself with varying ways of thinking.

Offline

#8 2010-07-23 17:27:00

Fragasaurus
Member
From: Ottawa
Registered: 2010-05-20
Posts: 25

Re: What's a good way to learn multiple programming paradigms?

Thanks for the replies.

I was thinking of dropping Python.  Might pick it up later, though.  I'll do some RTFMing on Haskell and such.

Offline

#9 2010-07-23 18:37:47

awkwood
Member
From: .au <=> .ca
Registered: 2009-04-23
Posts: 91

Re: What's a good way to learn multiple programming paradigms?

G'day Fragasaurus,

Considering your course focuses on Java I suggest looking at JRuby http://jruby.org/ as an alternate language.
It's a 100% Java implementation of the Ruby language.

That means you can easily port your Java code to JRuby using the same libraries but with Ruby's (IMHO) beautiful syntax.
It's also platform independent so it'll work if the college uses Windows machines.

Similarly there are other languages like Clojure which use the JVM but are dialects of Lisp etc.
http://en.wikipedia.org/wiki/List_of_JVM_languages

Offline

#10 2010-07-24 09:13:16

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: What's a good way to learn multiple programming paradigms?

I was about to say Clojure but awkwood beat me to it wink


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#11 2010-07-27 04:31:42

Coward
Member
Registered: 2009-06-24
Posts: 9

Re: What's a good way to learn multiple programming paradigms?

Try Prolog. It takes a bit of getting used to, but if you're trying to learn new paradigms you shouldn't leave it out.

Offline

#12 2010-07-27 06:36:04

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: What's a good way to learn multiple programming paradigms?

I say master one first. The others more or less will fall into place.
Once you know how to code, picking up another language is easy as long as you keep the docs close by.


neutral

Offline

#13 2010-07-27 06:50:19

upsidaisium
Member
From: Vietnam
Registered: 2006-09-16
Posts: 263
Website

Re: What's a good way to learn multiple programming paradigms?

Inxsible wrote:

There is no way you will remember the syntax of every language even after years of working on one.

That is, of course, why the good lord created reference books wink It's not easy to commit to memory every bit of each language you learn. We each have our language of choice, and the other ones.. just remember the most crucial bits, and use a reference book or Google when necessary.

@Fragasaurus: First and foremost, I think you should learn C (whether or not you're going to use it very much in the future). It's unfortunate that your college program doesn't include it. I would say don't bother with C++, but I guess that's up to you.

Studying Lisp is interesting too -- but as much as I tried to embrace Lisp-iness, there are very few problems that I would actually choose to solve with Lisp rather than another programming language. Though that's more a matter of personal preference, way of thinking, etc.

I can also understand what karol is saying; I'd rather be really good at one or two things, rather than mediocre at a handful of things. To begin with it's nice to try to learn lots of things, but once you know what you like, maybe you should try to focus on being really good with that one language that you like the most.


I've seen young people waste their time reading books about sensitive vampires. It's kinda sad. But you say it's not the end of the world... Well, maybe it is!

Offline

#14 2010-07-27 11:53:33

alexandrite
Member
Registered: 2009-03-27
Posts: 326

Re: What's a good way to learn multiple programming paradigms?

Of course, most languages within a single paradigm are so similar, that just picking three paradigms (like the OP was saying) and learning a language from each would be sufficient to proficiently use just about any language in that paradigm, given appropriate reference books.  Personally, I don't think there's anything wrong with that.  In fact, I would go so far as to encourage it.  Even if the impact on employability is marginal, it's at least a fun way to spend some weekends smile

Also, @OP: Go ahead and drop python.  "Interpreted" isn't really a separate paradigm, so it's really just an object-oriented language with a handful of functional elements.

Last edited by alexandrite (2010-07-27 12:03:55)

Offline

#15 2010-07-27 15:22:58

Google
Member
From: Mountain View, California
Registered: 2010-05-31
Posts: 484
Website

Re: What's a good way to learn multiple programming paradigms?

I am trying to learn as fast as possible myself. I am doing this strategy;

- Read a good programming book for your selected language
- Take notes on some paper for things that you need to remember/should remember
- As you walk around to work/school/class/to meet a friend etc, review your note sheet. Always review for no more than 15 minutes at a time.

- If your notes are too long, break them down into smaller chunks, hopefully logical chunks. Review chunks 15 minutes at a time and no more. Continue that all day long every day when you have 15 minutes free.

It's easier to review/study 15 minutes at a time, 6 times a day instead of studying for an hour and a half straight. That is just an example, you could end up studying 10-12 15 minute blocks a day or more.

This takes advantage of spaced repetition, and you can memorize a lot of data very quickly, and store it in long term memory. People remember and learn better when they are just about to forget something, that's proven. People also learn better in logical chunks. So it's best to take advantage of this. This does make learning a language more 'mechanical' and not very fun, but it gets the job done. It's also best if you couple this strategy with some 'fun' activities like building a program you want to make.

This works for me.

Last edited by Google (2010-07-27 15:30:31)

Offline

#16 2010-07-27 19:18:44

Sekre
Member
From: The Rainy North
Registered: 2006-11-24
Posts: 116

Re: What's a good way to learn multiple programming paradigms?

I say go for it, I do it now at university and I'd say it's actually quite valuable (depends a bit on what you are studying I guess).
Rather than every bit of code I tend to only take larger exercises and try to code or at least design a solution to it in multiple paradigms mostly as a way to see the difference in thinking/approach and also because it is quite fun to do.

Fragasaurus wrote:

I'm currently leaning towards the following:

C/C++
Something Lisp-y.  Scheme perhaps?
Python

Here is what I choose;

For functional programming I picked Erlang (distributed, concurrent functional language) which I find to be fun due to the idea that every task should be a new process. So it scales very well, but also brings in a ton of other problems you normally don't have to deal with (the dark side of concurrency).

Embedded/Procedural is of course C. Nice, clean language. Not much to say really.

OOP I tend mostly to use Java since I know it the best. And I would definitly say keep this one as your main OOP language for now and then look into learning C++ if you have a need for it since Java will fill most of your needs. smile

alexandrite wrote:

Also, @OP: Go ahead and drop python.  "Interpreted" isn't really a separate paradigm, so it's really just an object-oriented language with a handful of functional elements.

what he said. Python/Ruby/Lua/Perl/etc are nice languages and have some stuff in them OOP/Functional/Procedural but they are more like glue anyway. Nice to know and nice to code in but for this task not really necessary.

Offline

#17 2010-07-27 22:33:57

Fragasaurus
Member
From: Ottawa
Registered: 2010-05-20
Posts: 25

Re: What's a good way to learn multiple programming paradigms?

Thanks for the insight, everyone.  I've decided that trying to learn four or five languages off the hop may be an unrealistic goal, especially while trying to maintain some sort of life.  Thus, I've trimmed it down to two or three.

I will certainly continue learning C.  It's ubiquitous, well documented, with a horde of experienced users.  K&R was easy to follow, and the syntax seems pretty natural to me.

I just started reading about and tinkering with Prolog.  Way cool!  I had no idea such a thing existed.  This thread was worth it just for that discovery alone.

I'm still undecided about the functional side of things.  I'll have to do more reading and experimenting.  Haskell has lots of documentation, and a notable user base.  Scheme seems fairly minimal and self-contained, which I find appealing.  Clojure's use of the JVM looks pretty interesting, as does Erlang's emphasis on parallel programming.  Maybe I should hold off on all of them for now.  In the meantime, I have a lot of research to do.

Offline

#18 2010-07-28 05:12:21

upsidaisium
Member
From: Vietnam
Registered: 2006-09-16
Posts: 263
Website

Re: What's a good way to learn multiple programming paradigms?

Off topic: Just noticed where you're from, Fragasaurus! Where exactly in Northern Ontario, and what college will you be going to? I grew up in Sudbury smile (Though I ended up moving to Toronto when I was 18 to go to college..)

Back on topic: I wouldn't necessarily say forget about Python, or other interpretted languages, because even though they may not necessarily teach you different programming paradigms.. There are some problems that are best solved with a simple script. I'm not saying spend all your time study sh/Python/Perl/whatever, but some proficiency in one scripting language can be pretty handy for daily and mundane tasks.

Last edited by upsidaisium (2010-07-28 05:12:57)


I've seen young people waste their time reading books about sensitive vampires. It's kinda sad. But you say it's not the end of the world... Well, maybe it is!

Offline

#19 2010-07-28 10:05:22

wuischke
Member
From: Suisse Romande
Registered: 2007-01-06
Posts: 630

Re: What's a good way to learn multiple programming paradigms?

If you're interested in what "Programming Paradigms" actually means and which programming paradigms exist, have a look at the following paper: http://www.info.ucl.ac.be/~pvr/VanRoyChapter.pdf

Should you like prefer to figure out how things work in order to understand them - I recommend the Lua book (http://www.inf.puc-rio.br/~roberto/pil2/, assumes C knowledge) and building an interpreter for Lisp, Smalltalk/io or similar small languages, which are mostly built in itself. This helped me a lot to gain an understanding of these things and there are good tutorials for simple Lisp interpreters for instance.

Offline

#20 2010-07-28 13:00:57

Google
Member
From: Mountain View, California
Registered: 2010-05-31
Posts: 484
Website

Re: What's a good way to learn multiple programming paradigms?

This is a short easy read about data structures. I think it should be read by anyone starting to program, and learning the value of data structures.

http://courses.cs.vt.edu/~csonline/Data … index.html

Offline

#21 2010-07-30 18:41:57

Fragasaurus
Member
From: Ottawa
Registered: 2010-05-20
Posts: 25

Re: What's a good way to learn multiple programming paradigms?

Thanks for the reading material, guys.  I'll digest what I can.

I wouldn't say I'm turning my back on scripted languages.  Just putting it off for a while.

@upsidaisium:  Back off topic:  Sault Ste. Marie, at Sault college.

Offline

#22 2010-07-31 03:39:58

valium97582
Member
Registered: 2010-06-19
Posts: 126

Re: What's a good way to learn multiple programming paradigms?

Hmm, I will just stay with my Ruby + Common Lisp + Haskell + C mix.

Great. The problem there is when I write try to write main functions and define methods the C way in Ruby.


I'm also known as zmv on IRC.

Offline

Board footer

Powered by FluxBB