I was learning Java 6 in highschool. One day my brain wrinkled and I asked the teacher a big question:
"Why can't methods be more like variables? I want to try, like, making an array of methods out of it"
My teacher, bless his heart, replied:
"I'm just a P.E. teacher filling in electives because the county can't afford to hire anyone with a computer science degree, but go ahead and install whatever you want if you feel like experimenting"
So I stumbled around Google for a while playing with phrases like "passing methods without anonymous inner classes" and "public final methods" until I eventually stumbled across a bunch of blog posts by this guy called Martin Odersky. That led me directly into dropping Java and picking up Scala, the JVM language he designed.
Scala basically blew my world open. I discovered the beauty of first-class functions, immutability, currying, and pattern matching. Unfortunately, Scala was sort of peaking at the the time, so I eventually had to pack up and learn other languages. I experimented with Haskel (too hardcore for me!), Elixir (good but tiny ecosystem), and Groovy (cool, but unfocused). I always ended up returning to lame languages like JS (meh...), Python (ugh...), and Lua (ugh!!) because that's where the projects that most interested me were happening.
These days I mostly work in JS professionally. It's not ideal (hungrily eyes tc39/proposal-pattern-matching & tc39/proposal-pipeline-operator)... but my FP background still has a lot of applicability in JS-land. I frequently receive compliments on my code and I attribute a large part of that to the lessons and discipline which FP has taught me.
Quick little followup question to my own comment: I'm considering picking up Rust because I'm a big fan of what they're doing with immutables and pattern matching. Are there any Rustaceans on this community? What do you think of it as far as the FP experience goes?
I consider myself a relatively experienced Rust programmer (5+ years experience, 2-3 years professional).
I think it excels in most aspects, but advanced "type-meta-programming" and currying. But I think even this may be a good thing, because often higher-kinded types and lazy-evaluation is either mental overhead or leads to unpredictable performance (looking at you Haskell), so that the programmer doesn't get the idea to get too fancy, when the issue at hand is much more simple. Also often the syntax is a little bit boilerplaty compared to something like Haskell, but also this could be seen as a good thing, as everything is "documented" within it, IMHO it feels easier to read that way (as long not, something isn't hidden behind a crazy (proc-)macro (which still can be a good thing, but should be used carefully)).
Non the less I think it could improve with more advanced type-metaprogramming (and inference), because often you have like 5 lines of trait-bounds that are not really interesting for the end-user and should IMHO be inferenced (and communicated by the compiler otherwise). But I think after reading a few articles of compiler devs (like https://smallcultfollowing.com/babysteps/blog/2022/09/22/rust-2024-the-year-of-everywhere/) I think this will indeed improve soon, and it did already considerably over the time I'm programming in Rust.
I was learning Java 6 in highschool. One day my brain wrinkled and I asked the teacher a big question:
My teacher, bless his heart, replied:
So I stumbled around Google for a while playing with phrases like "passing methods without anonymous inner classes" and "public final methods" until I eventually stumbled across a bunch of blog posts by this guy called Martin Odersky. That led me directly into dropping Java and picking up Scala, the JVM language he designed.
Scala basically blew my world open. I discovered the beauty of first-class functions, immutability, currying, and pattern matching. Unfortunately, Scala was sort of peaking at the the time, so I eventually had to pack up and learn other languages. I experimented with Haskel (too hardcore for me!), Elixir (good but tiny ecosystem), and Groovy (cool, but unfocused). I always ended up returning to lame languages like JS (meh...), Python (ugh...), and Lua (ugh!!) because that's where the projects that most interested me were happening.
These days I mostly work in JS professionally. It's not ideal (hungrily eyes tc39/proposal-pattern-matching & tc39/proposal-pipeline-operator)... but my FP background still has a lot of applicability in JS-land. I frequently receive compliments on my code and I attribute a large part of that to the lessons and discipline which FP has taught me.
Quick little followup question to my own comment: I'm considering picking up Rust because I'm a big fan of what they're doing with immutables and pattern matching. Are there any Rustaceans on this community? What do you think of it as far as the FP experience goes?
I consider myself a relatively experienced Rust programmer (5+ years experience, 2-3 years professional).
I think it excels in most aspects, but advanced "type-meta-programming" and currying. But I think even this may be a good thing, because often higher-kinded types and lazy-evaluation is either mental overhead or leads to unpredictable performance (looking at you Haskell), so that the programmer doesn't get the idea to get too fancy, when the issue at hand is much more simple. Also often the syntax is a little bit boilerplaty compared to something like Haskell, but also this could be seen as a good thing, as everything is "documented" within it, IMHO it feels easier to read that way (as long not, something isn't hidden behind a crazy (proc-)macro (which still can be a good thing, but should be used carefully)).
Non the less I think it could improve with more advanced type-metaprogramming (and inference), because often you have like 5 lines of trait-bounds that are not really interesting for the end-user and should IMHO be inferenced (and communicated by the compiler otherwise). But I think after reading a few articles of compiler devs (like https://smallcultfollowing.com/babysteps/blog/2022/09/22/rust-2024-the-year-of-everywhere/) I think this will indeed improve soon, and it did already considerably over the time I'm programming in Rust.