9 ms·
It's well known that less power leads to less opportunities to shoot yourself in the foot. The article talks about "less" power from a qualitative perspective l
by Geminidog 6y ago
It's well known that less power leads to less opportunities to shoot yourself in the foot. The article talks about "less" power from a qualitative perspective like how "Go" is less "powerful" than "C++" because the language primitives are less dense. It also talks about turing completeness as well but still from a qualitative perspective.
There is actual benefits in removing fundamental core features of programming. You can remove iteration to make something not turing complete but before that you can maintain turing completeness while removing certain core programming features.
In fact There is an entire style of programming that removes these core features and is "less" powerful and "less" expressive as well. It is called functional programming.
Functional Programming is simply the same thing as imperative programming only without the power of mutability. No variable reassignment. No looping.
The strange thing is I always hear people talk about things how functional languages like say... Haskell are more expressive and more powerful than imperative languages. They are technically wrong. These languages are LESS powerful.
So yeah the author is really talking more about cognitive overload of say something like C++ but at a more fundamental level making our core programming model less powerful actually has some interesting benefits outside of just "cognitive overload"
Modules in functional programs (called combinators) are the most modular primitives available in all of programming and FP pushes the programmer into encapsulating his logic into these primitives leading to actually more modular and better constructed programs. The structure of programs changes for the better when things are made less powerful.
- GavinMcG 6y ago> The strange thing is I always hear people talk about things how functional languages like say... Haskell are more expressive and more powerful than imperative languages. They are technically wrong. These languages are LESS powerful. You're just arguing from different definitions, here. In fact, it's worth checking whether your definitions match up whenever you find yourself saying "technically" since it suggests you're applying a particular definition.
- Geminidog 6y agoSo tell me what do people mean when they say Haskell is more "powerful"? Tell me the definition. I don't think there is a different definition. I think it's just that most people aren't sure why Haskell is "better" than say C++.... They know it's "better" but they can't put their finger on "why" and they mistakenly attribute it to a more powerful language without thinking that Haskell is actually less powerful in every possible way. The set of all things you can do to your computer with Haskell is less than the things you can do to it with C++. If you look at it from every possible angle you will see that either you do less with Haskell or Haskell makes it Much harder to do certain things. There's really no angle where you can say Haskell is more powerful than C++ unless you really stretch the definition which I'm sure your subsequent reply (if you reply at all) will be doing.
- dfgdghdf 6y agoHaskell has fully-featured generics and Go does not. In this sense Haskell is more powerful than Go. However, Go has mutability and (mostly) Haskell does not. In this other sense, Go is more powerful than Haskell.
- Geminidog 6y agoKind of but if you think about it generics and parametric polymorphism in general is a restriction on the types that a function can take as parameters. It is a feature that allows you to restrict how a function is used. In a sense you are using generics to deliberately make a function less powerful. Golang doesn't have parametric polymorphism as a restrictive option . Instead you can use interface {} which removes all restrictions makes go as unrestrictive as python. Type checking and any feature related to it in general exists to make languages less "expressive"
- c-cube 6y agoTypes in Haskell are not just restriction, they're also used to generate code automatically for you using typeclasses. Something like [traversable](https://wiki.haskell.org/Foldable_and_Traversable https://wiki.haskell.org/Foldable_and_Traversable) provides behavior just based on types, and is far too powerful to be expressible in Go (or in most typed languages anyway).