4 ms·
I'm a CMU CS minor who has gone through most of CMU's "base" CS courses (211, 212, 213, 251). The majority of these courses were taught with either C or Java, s
by yrral 16y ago
I'm a CMU CS minor who has gone through most of CMU's "base" CS courses (211, 212, 213, 251). The majority of these courses were taught with either C or Java, so I'd rate my abilities in C and Java as probably a 7/10.
When taking 212, which is an intro to functional language course taught in SML. I had some trouble that I never encountered in other courses. I attributed this trouble with the fact that I learned programming with a Java and C mindset; such that I feel like I can only think efficiently in C or Java (or procedural and object oriented). Thus, when programming in SML, there were many times where I knew what to do in an abstract sense (and could easily code it in a functional-like manner in either C or Java), but had trouble expressing my thoughts in SML. Nevertheless, as I learned more and more SML in class, its elegance and grace drew me in.
Although I feel like functional languages are more powerful than OOP or procedural languages, I am hesitant to use them on side projects because I'm not accustomed to thinking and writing code functionally. I feel like I will spend more time figuring out the syntax of the language than actually coding. Furthermore, I have no idea about how design patterns work and have never coded large projects in functional languages, so even if I knew a specific functional programming language well, I would still have trouble using it for a non-toy project.
I feel like my mind thinks in OOP, and as much as I want to change that, it has already set; I still stick with OOP and procedural languages because that is what I am confortable writing in even if I know I'd be better off writing things in functional languages.
From what I understand from conversations floating around campus, 150 is similar to 212, except it teaches more CS fundamentals that 1st years are less likely to know (212 is typically a 2nd year+ class). 210 will follow 150, which is a data structures course that will be taught in a functional language. By starting students out with a functional language and then continuing to teach them other aspects of CS using functional languages, these students will likely start to think functionally - even when coding in C or Java (as I kind of do the reverse when coding in functional languages). This could be a huge advantage, as I believe functional languages are more powerful and allow you to express more ideas with less thought (or "brain memory"). I think PG's essay "Beating the Averages" explains this better.
Thus these students that are taking this new curriculum may be able to code or think in a order of magnitude "better" or faster than the people who learned programming using lower level languages such as Java/C. Nevertheless, I'm envious of the people who get to learn this new curriculum.
I apologize if this post seems like a huge braindump. This is my first "serious" post on HN and I had a lot of difficulty expressing my thoughts clearly and organizing them in a logical manner. When I read others' posts here or PG's essays, everybody seems to be able to express themselves extremely clearly and concisely. Any advice on developing functional language or writing skills will be appreciated.
- barry-cotter 16y ago1. That was interesting, thanks 2. If you eel like functional languages are more powerful than OOP or procedural languages and you're much less comfortable in them than in C or Java, you should do a major project in one, or switch your scripting language. After all, you're still in college, you have fucking up time and capability. Haskell for the Summer of Code, or Jane Street Ocaml? 3. Never, ever pre-emptively apologise. It is a signal of weakness and lack of confidence and will cause people to give you abuse and disrespect you who would not have done so if you hadn't done it.
- loup-vaillant 16y agoThe problems you had or still have with ML and Haskell are probably mostly about pure syntax. For beginners, syntax matters a lot. Over time, we get over it, and learn to see the underlying structure of the code. About the deeper problem of "thinking in OOP", I wrote a small tutorial[1] about the first step: avoiding mutable state where you can help it. The second step is to remove loops (even the recursive loops as well). Instead, use `map` and `filter` (the bulk of list comprehension) where you can. The final step is to generalize this approach by writing your own "higher order" functions to capture common patterns. [1]: http://www.loup-vaillant.fr/tutorials/avoid-assignment http://www.loup-vaillant.fr/tutorials/avoid-assignment
- JoeAltmaier 16y agoIt takes weeks to retrain one's mind to think in a new paradigm. It took me 8 weeks (years ago) to 'get' OOP, coding every day. Maybe I'm slow, but something on that order is expected. To change means painful, unproductive days. I went home sweating every day(!) So some of the emotion regarding choise of paradigm is of course personal - we all want to stay where we are comfortable. Then we rationalize why that is best. I believe the CMU profs have taken a different tack - how to teach folks relatively new (< 20 years?) to computers. They may choose any paradigm that works, and they seem to be perfectly trained to make that decision well. As for job opportunities for their graduates, CMU has traditionally had zero problem there. So we shouldn't cry any alligator tears for them. They will learn 'practical' OOP etc as needed at their first job.
- stonemetal 16y ago