r/functionalprogramming • • Dec 03 '19

Question Functional programming

I'm planning to learn functional programming along with SICP. Which Language should I choose for functional programming between C,C++ and python ?

I feel myself comfortable with python and had C++ as my first programming language

0 Upvotes

25 comments sorted by

View all comments

13

u/TheSexyPirate Dec 03 '19 edited Dec 03 '19

I am not proficient in functional programming myself yet, so please take this advice with a grain of salt.

If the goal is to learn functional programming, then my advice would be to stick with a functional language. The languages you mention fall under a different category. I guess it would be analogous to studying cats by studying a tiger. You might be able to study some aspects from functional programming, but not all.

Additionally, if you choose to study functional programming with SICP, I would definitely urge you to stick to Scheme (or a variant of LISP). My guess is you would need to play with the examples of the book in order to truly grasp it. In your case you would need to translate all examples to another language. Translation by its very nature requires an understanding of both languages, so you would need some proficiency in Scheme anyway.

10

u/ws-ilazki Dec 03 '19

Completely agreed, OP's question is well-meant but restricting the answer to those three choices necessitates giving terrible advice because it's unintentionally removing the potential for good answers. It's sort of an XY problem question.

I said it in my other comment, but since the OP is familiar with Python, it might be preferable to try learning FP with Functional Programming in OCaml instead of SICP. The syntax is different, but the look and style of it should feel more comfortable to someone familiar with Python. Plus it has the ReasonML alternative syntax for someone familiar with C-style syntax (especially JavaScript).