6 ms·
My feeling is these paradigms, SOLID and SIMPLE, boil down to basically: small objects, connected minimally, though interfaces. SIMPLE appears to be leaning ev
by taberiand 7y ago
My feeling is these paradigms, SOLID and SIMPLE, boil down to basically: small objects, connected minimally, though interfaces.
SIMPLE appears to be leaning even more towards the functional programming side of things; I think we should probably just get it over with and accept that composition of functions operating on immutable data structures is just the right way to go.
- tobr 7y agoIs there a language that leans heavily towards immutable data, but steers clear of the, shall we say, dorkier side of functional programming?
- 7thaccount 7y agoJulia is pretty good at this. Immutability is the default with functional composition. It is primarily intended for numerics though.
- xenihn 7y agoSwift.
- ummonk 7y agoJS with React is great if you use an immutable data structures library and compose functions.
- deckard1 7y agoES6 and newer JS is a great functional language. That said, I do not recommend immutable libraries. Here are the reasons: 1. They provide false comfort. Nothing in JS is truly immutable. People are just going to end up breaking the rules (purposely or inadvertently). 2. Boxing and unboxing regular JS objects becomes a pain in the ass and a maintenance horror show. You'll never know what an object is and you'll have to jump through countless hoops to get plain old JS objects to do anything with anyway. Much better is to educate developers, and make sure code is properly reviewed before merging. Immutability doesn't need to be built into the language. Code customs and practices can go a long way.
- ISO-morphism 7y agoThis is Clojure. It's functional, but more as a side effect of focusing intently on simple, immutable, persistent data structures and their compositions. I'd strongly recommend looking into it, along with many of the presentations by its initial author Rich Hickey.
- BoorishBears 7y agoImo no Lisp variant can claim to not be in the "dorkier" side of things ("dorkier" being read as "hard to approach" in my eyes). I'd say Kotlin over Clojure.
- adamkl 7y agoI’d suggest you watch Rich’s talk “Simple made easy”. [1] It’s one of his main points that something like a language being “hard to approach” can be overcome by spending a little effort to learn it (as opposed to sticking with something like Kotlin just because its easy to pick up because it’s familiar). The benefits of learning the unfamiliar (in his case, he’s speaking specifically about Clojure) being that it allows you to write code that is much simpler to reason about. I have no particular beef with Kotlin (or most any languages... right tool for the job and all), but I have lately become infatuated with Clojure and many of Rich’s viewpoints. [1] https://www.infoq.com/presentations/Simple-Made-Easy/ https://www.infoq.com/presentations/Simple-Made-Easy/
- BoorishBears 7y agoEh, I've used languages that were "hard to approach", one of my favorites (Erlang) is one of those (I use quotations especially because learning all of Erlang's syntax takes about a day). This is a misapplication of the presentation really. It speaks to a level above selecting a language and is really about the design of systems. Picking up Kotlin or Clojure is not "harder to approach" by virtue of what's provided in this context, it's harder because Clojure syntax uses parenthesis. Like that's literally it. Clojure with the same exact constructs represented with more C-like syntax would, at the level the presentation speaks to, allow the same level of simplicity. I think a lot of developers feel "It looks funny" is not a fair critique of a useful tool, but just look at Erlang vs Elixr. I love Erlang, much more than I like Elixr, but Elixr gained mind share in large part because it's Ruby-like. Cognitive overhead is lower working with a language that at least "looks like", what you're used to, and more developers know C-like languages, thus a language like Kotlin is "easier to approach" but necessarily "easier" in the way the presentation talks about
- whiletruu 7y agoElm.
- vereis 7y agoIn my opinion Erlang (and by extension Elixir) are functional-ish languages that are at their core very pragmatic about not being too _dorky_.
- swamp-agr 7y agoHaskell.
- tempguy9999 7y agoWhat is 'dorky' WRT functional programming?
- c256 7y agoOffhand, I’d say “too much theoretical math in the starting and middle stages of mastering the language.” Syntax that is based around/descended from APL. Lambda calculus prominently featured in the learning process. Things like that. It’s definitely a feel argument, and thus highly subjective.
- Multicomp 7y agoI'm not a FP expert, but I do try to use FP as much as possible and yes, I agree that there is some serious dorkiness possible with certain PLs. Anecdote, not data, but I've found that Rust, Erlang, and F# (if MS stack) tend to be in the sweet spot of expressive enough without drowning in symbols, without being as mushy as, say, Python/Ruby/pick something.
- soulnothing 7y agoKotlin for me. Val is immutable and they differentiate collections, i.e. list vs mutableList. This is still hampered by the JVM but it works. Combine that with multi platform productivity. If you do want to get dorkier there are fully functional libraries.
- pkolaczk 7y agoScala / Dotty, or its smaller brothers like Kotlin or Swift
- pytester 7y ago>I think we should probably just get it over with and accept that composition of functions operating on immutable data structures is just the right way to go. It can provide an incremental improvement but it is https://en.wikipedia.org/wiki/No_Silver_Bullet https://en.wikipedia.org/wiki/No_Silver_Bullet
- tempguy9999 7y ago> ... composition of functions operating on immutable data structures is just the right way to go Yeah. No. Maybe. The cost of immutability can be high. Immutability can be very elegant when it's right, but mutability can be clearer other times. As another respondent said, there's no silver bullet. There's no 'right way to go'; as ever it depends.
- iLemming 7y ago> The cost of immutability can be high If you analyze expenses for software projects of 1960-80ies and compare them with recent years, you probably see that the most expensive item now is at the bottom. The most costly thing used to be hardware. The not so expensive - developer's time. Now it's the opposite - the equipment is cheap, and the software developer's salary is the most expensive thing. Of course, that does not apply to every single case, but for the majority of projects, that is true. Immutability by default (baked into the language), offers enormous benefits, and increases programmer's productivity, it simplifies many things, especially concurrency and parallelism. Languages like Erlang and Clojure are good examples. The price you are talking about does matter. But very often, the benefits outweigh the small cost.
- tempguy9999 7y agoNice reply, thanks. I fully understand the benefits and we agree then, except possibly for the issue of the cost. I haven't checked the value of eg. for{} in scala vs a mutable/procedural loop, but I wouldn't be surprised if it was an order of magnitude or two different. Figures are needed, and I don't have them (nor the time to benchmark them now, simple though it is).
- kevingoslar 7y agoPlease note that the article merely encourages the application of some of the best practices introduced by functional programming - strong typing and more mindfulness around mutability and side effects - into all forms of programming. Functional programming as it exists today takes these ideas to a somewhat extreme form. That has its place and value, but as experience in the real world shows, as long as it feels so mathematical, it isn't everybody's cup of tea. Hopefully, over time we find more intuitively accessible abstractions for the really useful principles that functional programming is based on.
- iLemming 7y ago> as long as it feels so mathematical, it isn't everybody's cup of tea. Languages like Elm, Elixir and Clojure don't feel "so mathematical".