6 ms·
This essay I recently saw on HN comes to mind: https://lexi-lambda.github.io/blog/2019/10/19/empathy-and-subjective-experience-in-programming-languages/ https:/
by IAmEveryone 7y ago
This essay I recently saw on HN comes to mind: https://lexi-lambda.github.io/blog/2019/10/19/empathy-and-subjective-experience-in-programming-languages/ https://lexi-lambda.github.io/blog/2019/10/19/empathy-and-su...
- axilmar 7y agoIf everything is subjective and we don't bring counter arguments to one's arguments, then science cannot go on. In programming, we need to know if objectively one programming language is better than the others, so as that we use it to our benefit.
- seddona 7y agoI don't see any claim in that article about everything being subjective, it's very specifically about programming languages. I would argue that programming languages are subjective. There are many different equally viable ways to model the world and programmers should pick the one that aligns with how their brain works. I'm not convinced it's possible to objectively rank programming languages from best to worse. They are not fundamental properties of the universe simply mental models devised by humans for humans.
- galangalalgol 7y agoWe can objectively talk about whether a language is suited to the use it is being put to.
- wolco 7y agoCan we? Expectations around what a language can do are dymanic. I saw something really cool on the weekend. PHP on the client side as a compiled wasm. This allows someone to go severless and run a cms in the client. That's a new use for an existing language.. is it suitable for everything? Not until it is.
- galaxyLogic 7y ago> need to know if objectively one programming language is better Better for what, for whom? Every programming problem is basically a unique problem of its own -- else the solution would already exist as source-code. There's no need to re-program the wheel. Therefore the generic question of "what programming language is objectively better" does not make much sense, unless we qualify the question with: better for what, better for whom.
- cousin_it 7y agoI think the problem is not just subjectivity, but also that people often give strong opinions without examples. Here's an example about Haskell. Go to https://tryhaskell.org https://tryhaskell.org and enter these: 3 div 6 2 3 + 1.0 (div 6 2) + 1.0 The first line returns 3, and so does the second line. The third line returns 4.0. The fourth line fails with this error: No instance for (Show a0) arising from a use of ‘show_M552168474310802709512215’ The type variable ‘a0’ is ambiguous Note: there are several potential instances: instance Show a => Show (Const a b) -- Defined in ‘Control.Applicative’ instance Show a => Show (ZipList a) -- Defined in ‘Control.Applicative’ instance Show GeneralCategory -- Defined in ‘Data.Char’ ...plus 106 others In the expression: show_M552168474310802709512215 (let e_16210 = (div 6 2) + 1.0 in e_16210) In an equation for ‘e_155216847431080270951221555216847431080270951221516210621016210’: e_155216847431080270951221555216847431080270951221516210621016210 = show_M552168474310802709512215 (let e_16210 = (div 6 2) + 1.0 in e_16210) In the expression: (let e_155216847431080270951221555216847431080270951221516210621016210 = show_M552168474310802709512215 (let ... in e_16210) in e_155
- chungus 7y agoDon't get me wrong here, I get what you're saying, but: In practice a beginner would figure out you can't just 'silently' add Integrals and Fractionals by checking the types with the ":t" command Prelude> :t (div 6 2) (div 6 2) :: Integral a => a Prelude> :t 1.0 1.0 :: Fractional t => t Bonus: there is a language extension which does you do this: https://www.schoolofhaskell.com/school/to-infinity-and-beyond/pick-of-the-week/guide-to-ghc-extensions/basic-syntax-extensions#numdecimals https://www.schoolofhaskell.com/school/to-infinity-and-beyon... If your point was that the error messages could be nicer, I agree.
- lgas 7y agoThat's surprising since it's fairly straightforward. The type of `3` gets inferred as `Num a => a` because there's nothing to constrain it further. The type of `div 6 2` gets inferred as `Integral a => a` because the type of `div` is `Integral a => a -> a -> a`. The type of `3 + 1.0` gets inferred as `Fractional a => a` because of the decimal point. Then the same thing happens in the last statement so the type of the subexpression `(div 6 2)` (still) gets inferred to `Integral a => a` and the type of `1.0` (still) gets inferred to `Fractional a => a` because of the decimal point. So at that point you have an expression that's trying to add something constrained to being a whole number to something constrained to being a fractional number and that is ill typed because there is no type you could choose for the overall expression that would meet both sets of constraints. Edit: When I first replied there was text at the bottom of the message saying that no one could explain why this happens. My comment was addressing that portion of the original message. The behavior itself is not surprising for the same reasons.