3 ms·
Well, a lot of people say actors magically make your software concurrent, and kinda they are right, and kinda they are not. Each actor can be written as if the
by myrryr 10y ago
Well, a lot of people say actors magically make your software concurrent, and kinda they are right, and kinda they are not.
Each actor can be written as if the software is single threaded (just don't do a blocking call!), and you do get concurrency out of it.
if your software can be modeled easily as actors then hey, that will work well, and mostly you can.
Sometimes you can't and then it can turn to shit pretty quickly if you don't know when that is the case.
Mostly though, I love functional programming because it makes mucking around with data structures a lot easier.
- taneq 10y ago> if your software can be modeled easily as actors then hey, that will work well, and mostly you can. I feel like "if your software can be modeled easily as X then hey, that will work well, and mostly you can" applies to all languages/styles, and if only people who like different languages and styles could just accept that this then we'd all get along fine. It's just a pity when people (not saying you're saying this) go "X is the BEST WAY TO PROGRAM and all other ways are STUPID and are for STUPID PEOPLE" and it ruins whatever point they were trying to make.
- bertiewhykovich 10y ago> Mostly though, I love functional programming because it makes mucking around with data structures a lot easier. Can you talk more about that? My experience has actually been largely the opposite: immutability actually makes working with data structures /harder/ for me. I'd be interested in hearing about any hidden advantages you've discovered there.
- deepGem 10y agoOne such example is the Scala List data structure. It's fundamentally a linked list but the built in routines for Lists such as zip, reduceLeft, map make it easier to transform List elements. By easier I mean, you write less code to do the same task as compared to an imperative program such as Java and without side effects.
- eudox 10y agoIn that case, though, the immutability is a property of the operations rather than the data. And you can have mutating versions of most of those operations that alter the data they are working on, e.g. a mutating map.