11 Replies - 4787 Views - Last Post: 21 October 2012 - 06:26 PM

#1 Lemur  Icon User is offline

  • Pragmatism over Dogma
  • member icon


Reputation: 1359
  • View blog
  • Posts: 3,424
  • Joined: 28-November 09

A Functional Experiment

Post icon  Posted 20 October 2012 - 07:19 PM

I've noticed a rather interesting trend. No one here, or much of anyone in a Comp Sci course has started with Functional Programming. More often they work with Imperative as a starting language, like a vast majority of us here.

I propose an experiment of sorts. I've found two students here that are interested in learning programming, but instead of introducing them to Imperative/Algol-based, I plan to use Scheme. Seeing as they have no experience in programming, and have at least Calculus level skills in Math, this should be interesting.

I believe this can yield some interesting results and give us some insight to our previous threads regarding functional versus imperative as a teaching language.

If anyone has material or suggestions you'd like to offer, I'd love to hear them.

The current plan is to start them on 'The Little Schemer' and see what type of results pop up as I go through it.

Is This A Good Question/Topic? 4
  • +

Replies To: A Functional Experiment

#2 Tayacan  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 145
  • View blog
  • Posts: 275
  • Joined: 18-January 11

Re: A Functional Experiment

Posted 21 October 2012 - 01:10 AM

Actually, at my university, we start with SML. About half the students have never touched programming before, so they get a functional language as their first (although a somewhat impure one). Most of them seem to be coping just fine.

The cool thing about it is that while we learn about the SML type system (which is a lot like Haskell's), we also learn about sets in our math course, and how they're related. Pretty nice.
Was This Post Helpful? 1
  • +
  • -

#3 sepp2k  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2089
  • View blog
  • Posts: 3,179
  • Joined: 21-June 11

Re: A Functional Experiment

Posted 21 October 2012 - 01:42 AM

Interestingly MIT used Scheme as their language for their introductory programming class for a long time before they switched to Python recently. They used their own "Structure and Interpretation of Computer Programs" textbook.
Was This Post Helpful? 1
  • +
  • -

#4 darek9576  Icon User is offline

  • D.I.C Lover

Reputation: 198
  • View blog
  • Posts: 1,682
  • Joined: 13-March 10

Re: A Functional Experiment

Posted 21 October 2012 - 09:09 AM

I would love to be able to grasp functional programming but i have tried 10 times and i failed 10 times. Sigh... i will try again until i succeed..
Was This Post Helpful? 0
  • +
  • -

#5 Lemur  Icon User is offline

  • Pragmatism over Dogma
  • member icon


Reputation: 1359
  • View blog
  • Posts: 3,424
  • Joined: 28-November 09

Re: A Functional Experiment

Posted 21 October 2012 - 10:20 AM

I feel like I'm right on the verge of making a breakthrough myself on functional programming. Of course I use a lot of the techniques from the functional paradigm in Ruby, but the more pure forms still elude me for the time being.

The best way for me to learn is to help another learn from the ground up. Apparently I've earned the nickname 'professor' around town.

I know about the MIT one, Sussman and all that. I need to actually watch through the entire thing.
Was This Post Helpful? 0
  • +
  • -

#6 Simown  Icon User is offline

  • Blue Sprat
  • member icon

Reputation: 319
  • View blog
  • Posts: 650
  • Joined: 20-May 10

Re: A Functional Experiment

Posted 21 October 2012 - 02:18 PM

At York University in the UK, I started with Scheme, using the same book that sepp2k mentioned. As far as I know, it's still the case.

I think that most Universities here start with Java or C# and teach that throughout the whole course generally. I don't think a functional language should be the first language you learn programming concepts in really, but it should definitely be part of a Computer Science course.
Was This Post Helpful? 0
  • +
  • -

#7 mostyfriedman  Icon User is offline

  • The Algorithmi
  • member icon

Reputation: 727
  • View blog
  • Posts: 4,473
  • Joined: 24-October 08

Re: A Functional Experiment

Posted 21 October 2012 - 04:18 PM

I think starting out with a functional language can be easier. For example lisp has very consistent syntax, is very expressive, is high level (has garbage collection, etc), and has an interactive mode (this is extremely useful). Lisp also supports other paradigms which allows for some flexibility. I personally think lisp can be much easier to grasp for beginners than the mainstream imperative languages. A language like C++ is much more verbose, has a lot of quirks and gotchas, and much less expressive than any functional language. Same thing can be said about Java except for the gotchas part. Another thing to note is that functional languages are based on the lambda calculus which is much more abstract and high level than the von neumann style. In functional programming, you focus more on solving the problem at hand by thinking abstractly, rather than thinking about messy details such as what should happen at each step.
Was This Post Helpful? 0
  • +
  • -

#8 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7564
  • View blog
  • Posts: 12,696
  • Joined: 19-March 11

Re: A Functional Experiment

Posted 21 October 2012 - 04:34 PM

This is where the advantages of having an actual teacher in the room come forward. Some students will love the abstract nature of the SICP material, others will want something more "practical" (ie, having more immediately obvious applications). Others will want to make games. A good teacher can tailor the class to this - for example, borrowing ideas from Barski's Land of Lisp for the game-seekers, or from the MIT Python course for the "practical" students, or sticking with the mathematical examples from SICP and the abstract recursions of TLS for the smart ones.

I've often thought that cryptography/cryptanalysis might make an interesting frame for at least part of an intro computing course. Unfortunately, I know very little about the subject, so it'd be a bit of a job for me to generate that course, but I still like the idea.
Was This Post Helpful? 0
  • +
  • -

#9 mostyfriedman  Icon User is offline

  • The Algorithmi
  • member icon

Reputation: 727
  • View blog
  • Posts: 4,473
  • Joined: 24-October 08

Re: A Functional Experiment

Posted 21 October 2012 - 04:37 PM

View Postjon.kiparsky, on 22 October 2012 - 02:34 AM, said:

Others will want to make games.


Did you know that Crash bandicoot (one of my all time favorite games) was written in a lisp dialect?
Was This Post Helpful? 1
  • +
  • -

#10 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7564
  • View blog
  • Posts: 12,696
  • Joined: 19-March 11

Re: A Functional Experiment

Posted 21 October 2012 - 04:48 PM

As a matter of fact, I had no idea. It's amazing the things you learn. :)

@Lemur - speaking of games, this book makes an interesting source book for simple games to implements. Hamurabi, as I've mentioned before, is a good one to implement in almost any language, and Awari (which I've seen sold under the name of Mankala) is also interesting. There are some simpler ideas, as well.
If you feel like you need ideas for exercises for your students, you could do worse than looking here.
It's also fun to see how they made this stuff work out in BASIC. :)
Was This Post Helpful? 0
  • +
  • -

#11 GWatt  Icon User is offline

  • member icon

Reputation: 264
  • View blog
  • Posts: 3,059
  • Joined: 01-December 05

Re: A Functional Experiment

Posted 21 October 2012 - 05:27 PM

At Indiana University the starting language is scheme. In fact, R. Kent Dybvig was one of the professors here until very recently.
Was This Post Helpful? 0
  • +
  • -

#12 ishkabible  Icon User is offline

  • spelling expret
  • member icon




Reputation: 1622
  • View blog
  • Posts: 5,709
  • Joined: 03-August 09

Re: A Functional Experiment

Posted 21 October 2012 - 06:26 PM

I bet the net effect after they use both kinds of languages for equal amounts of time will be the same.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1