4 ms·
Is there a functional-programming-first curriculum? Even though knowing OOP is important (if even just for the vocabulary), I wonder if a lot of pain could be s
by escherize 11y ago
Is there a functional-programming-first curriculum? Even though knowing OOP is important (if even just for the vocabulary), I wonder if a lot of pain could be sidestepped by talking about data as a separate concern than ADTs, and state as a fact rather than a place. [1]
[1] https://www.youtube.com/watch?v=ROor6_NGIWU https://www.youtube.com/watch?v=ROor6_NGIWU
- zodiac 11y agoI think this book is supposed to be used after HtDP, which I would consider functional-programming-first.
- zeckalpha 11y agohttps://en.wikipedia.org/wiki/How_to_Design_Programs https://en.wikipedia.org/wiki/How_to_Design_Programs
- yodsanklai 11y agoYes, there are many books that start with functional programming. If I remember correctly. "Concepts, Techniques, and Models of Computer Programming" start with pure functional program, and define objects as function with state. An other one is "Essentials of programming languages". Also Pierce's "Types and Programming languages"....
- zeckalpha 11y agoTaPL doesn't teach FP, but rather how to design languages.
- spion 11y agoI find that it helps me to think of objects as tiny machines rather than places to hold data. It then becomes easier to reason about which classes make sense and which don't. A "User" class doesn't make sense, but UserTable (machine to access the users) and Authenticator (machine to authenticate them) do. A BlogPost class doesn't make sense, but a PostRenderer (machine to render blog posts) does. OOP then becomes about decomposing computers into smaller communicating computers, not about lumping together data and all the possible code related to that data. Which incidentally means that there will be things that are pretty much just dumb data / facts (e.g. User)
- agumonkey 11y agoAnd tiny machines are functions with a bit of state.
- raducu 11y agoI highly recommend the Domain Driven Design approach. But I've found it a lot harder to comprehend and make others give it a try (probably orders of magnitude harder than object oriented design or design patterns or normal refactorings). I like to think about designing classes and aranging them in packets/modules/applications more like creating birocratic systems. You have to think in general terms what an institution/building does, what is its core activity, what it is authoritative over, then you design each room/department with its own mini-authority, make sure there is no duplication of authority/data between rooms, make sure each person inside a room does/knows about only the stuff in that room so they can really perform by being specialized and not commuting between rooms with their arms full of customer/citizen's files. Make sure, as much as possible that each room knows about adjacent rooms only (or maybe at least at the same floor). At the same time you have to think how the regular citizens use these institutions and what interfaces you provide them with to solve their requests. You don't want a taxpayer modifying his own tax file, you probably want a clerk to do that; you also don't want a taxpayer visiting 100 rooms to submit his tax files. Then you have to think about how many customers you would serve, how wide the coridors should be made, what kind of security you need at the entrance and so on.
- macco 11y agoYeah, there is: https://www.edx.org/xseries/systematic-program-design-0 https://www.edx.org/xseries/systematic-program-design-0 It uses the functional approach, that also Felleisen uses.
- agumonkey 11y agoSICP, HtDP, then RealWorld{Haskell,OCaml} are easy starters.
- samth 11y agoThis book is designed to be taught in the second course of a CS curriculum, after students take a functional-first course based on How To Design Programs. You can see the home page of a course taught using this book here: http://www.ccs.neu.edu/home/vkp/2510-sp14/ http://www.ccs.neu.edu/home/vkp/2510-sp14/