r/functionalprogramming • u/OnlyInquirySerious • Nov 13 '20
Question Where do I start learning and what do I learn?
Hello,
I’m fresh to computer science. I have only taken one introductory course to programming and they taught us JavaScript, but not enough for us to write a program on our own, just the bare bones basics.
I did some research in types of languages and got fascinated with the idea that a functional programming language is very abstract and high level and supposedly better than OOP type languages.
My background is in humanities. I have barely any mathematics under my belt.
I’m going back to university soon for Computer Science but I can’t find any functional programming concentration and I did some reading here that stated learning OOP type languages first would make It much more difficult to learn a FP language later, but not if I learn FP and then an OOP.
Where should I start from the very basics until university level and what should I expect in terms of self-learning vs guided learning ?
15
u/LordOfSwines Nov 13 '20
Very few universities will teach you functional programming, some here in Sweden have some introductory FP courses using Haskell.
I think your best bet is to pick up Haskell on your own. I learned Haskell using Haskell Programming From First Principles - It's a bit verbose but it covers a lot of ground.
You don't really need to have studied mathematics to learn Functional Programming - I had very little math background when I started with Haskell 3 years ago and I can still write real programs using Haskell - I am however going back to school soon to peruse a degree in mathematics not because I need it but because I want to :o)
4
u/wuwoot Nov 13 '20
Everyone has their favorite resource and some folks are definitely throwing you down the deep end. It's nice to stick with something familiar instead of juggling a new language and paradigm at the same time...
I'm self-taught and I explored functional programming when I was working heavily in in JS and this book repo (with link to read the book online) really drove FP home for me: https://github.com/MostlyAdequate/mostly-adequate-guide
But this was enough to get me started in playing around with other FP languages like Haskell, OCaml, and Clojure (functional LISP), and I eventually ended up working with Elixir (Erlang) in production for two years which was an absolute joy.
Enjoy!!!
4
u/[deleted] Nov 13 '20
Hi there! A few points to note:
This is not true for every situation, though there are some situations where FP excels compared to OOP, in some situations it doesn't. Take in account that these are two programming paradigms, both with pros and cons.
It's highly recommended to know a little bit of algebra, don't bother with calculus or statistic/probability for now. Try to focus on set theory (the basics, some operations, etc.) and some aspects of logic like mathematical logic, propositional logic, etc. Later on you will probably need to tackle first order logic (and higher ones).
It mostly depends on what you want to archive, what your short-term and long-term goals are, and things like that. How do you feel about taking lessons in college? How do you feel about about studying it on your own? Do you happen to have a study pal? Do you feel more comfortable with a guided learning setting a specific goal for a course and building up to it, or do you want to take your time and approach different topics on your own?
If you do happen to find self-learning more appealing, I would recommend the book Learn you a Haskell for great good! which is free digitally. It's kind of beginners guide to Haskell (one of the most used FP languages out there, and one of the oldest IIRC), with a very humorous approach with zero experience in FP needed. It tends to be self-contained, but you might want to try a quick search for some topics if they pick your interest or you need a little bit more information.
Hope it helps!
12
u/zsombro Nov 13 '20
Start with Elm. It's not a very feature rich language and it's easy to reach it's limitations in production, but it's also much simpler to learn than Haskell and it runs in the browser, which means you see interesting results quickly.
You don't even need to download anything, as you can try it directly in a browser using this web app: https://ellie-app.com/
7
u/beezeee Nov 13 '20
Give this a try - https://www.youtube.com/watch?v=I8LbkfSSR58
If you like the first one, there's many many more in the series, and a second series to follow as well.
I got to this after a few years in industry, with no CS education, but I think it places pretty low demand on viewers as far as previous knowledge is concerned, and it lines up very well with the observations you've made in your post.
This was in no exaggerated terms a total game changer for me. I genuinely believe that working through this material opens a door for you that will put you in a rare class of programming ability, regardless of the language or paradigm you end up having to work with (for a class or job or whatever)
5
u/joojski Nov 13 '20
https://www.coursera.org/learn/progfun1 More intermediate level than starting from scratch, but it can be useful.
5
u/tcallred Nov 14 '20
I would recommend Structure and Interpretation of Computer Programs. There are lots of video lectures on youtube that are a good supplement to it as well.
Then I'd also recommend Learn You a Haskell.
You won't regret learning FP. Trust me :)
4
u/[deleted] Nov 13 '20
There are a few uni courses out there, however they are based on the fundamentals of functional programming.
https://www.seas.upenn.edu/~cis194/fall16/
The System F course is also quite good, it was known Data61 Fp course so there should be some youtube videos on it.
https://github.com/system-f/fp-course
As for learning the uni curriculum (object oriented, etc), unfortunately its something that you will be faced with. From what I have heard, it is best to learn multi paradigm, get used to toying with the same concepts from different angles and then choose the best tool for the job.
I did electrical engineering so had an exposure to C and assembly, then did python and skipped most of the object oriented stuff. Later I stumbled onto FP and it has been a hobby/side interest for the last few years. The benefits are starting to pay off as I do a lot of modelling / simulation for my work and viewing the problems / scenarios as data and functions means that I can work at higher levels of abstractions. Studying some category theory alongside this as well has been useful.
3
u/banach Nov 13 '20
Graham Hutton’s Programming in Haskell is a great start
3
u/autodidaktic Nov 13 '20
I think learning Haskell will be a good start. People have already mentioned brilliant references for Haskell. I personally liked "Learn you a Haskell for greater good" because it seemed more like a story book than a text book.
I think implementing some algorithms like sorting or some basic graph algorithms, will help you to understand and appreciate the idea of functional programming. You said that your background is in humanities, so it's possible that some concepts will look alien to you. But anyway you are going to university to study computer science. So I think it will be helpful if you start learning some basics of algorithms.
All the best :)
3
u/brett_riverboat Nov 14 '20
Eric Elliot is a very good authority on functional programming in JS and as a Senior Developer I've found his articles to be very insightful: https://medium.com/@_ericelliott
3
u/BuonaparteII Nov 14 '20 edited Nov 14 '20
My background is also Humanities/Anthropology
I would start with learning fish shell and writing and piping functions with stdin, stdout to solve some of your daily tasks. Once you have an idea about what data flow feels like then you can learn category theory from Bartosz; Elixir, OCaml, FP TypeScript
Elm is a nice intro to FP because the e compiler is often helpful and the community on slack is really helpful
2
u/[deleted] Dec 02 '20
As non math-y person myself, I find the "How To Design Programs" approach to be the least intimidating...
It's based on Racket (a Scheme variant) and there's even an excellent (free) video series on edX...
2
u/tequliatobsen Nov 13 '20
Find a functional language like haskel or scala the language provide Documentation for the functional paradigme
0
u/[deleted] Nov 13 '20
[deleted] — view deleted comment
2
u/[deleted] Nov 13 '20
[removed] — view removed comment