Re:Help me sort out the meaning of “{}” as a constructor arg...
by bitL on Tuesday November 22, 2016 @02:47PM
(#13016965)
Sure, I use and like both of them. C++ for 3D graphics, Scala for Big Data. Yet I have seen so many things go wrong in both of them so my perspective is a bit different. Imagine if somebody redefines basic operators to mean something different, starts throwing int as exception in C++ or use templates with template parameters with number parameters and you have to figure out what exactly does this thing do? Or in Scala if somebody feels super clever and redefines half of the language by preparing some half-baked barely functioning DSL unable to compile a slightly different code than expected and you have to use it? It's the price you pay in both C++ and Scala for expressibility.
[ Parent
| on HN ]
Re:Help me sort out the meaning of “{}” as a constructor arg...
by jjnoakes on Wednesday November 23, 2016 @11:45AM
(#13023796)
How is that different from using a C function called add_two_ints which deletes the root file system and returns 42?
I don't think it is possible to create a language that can prevent dumb code from being written.
Re:Help me sort out the meaning of “{}” as a constructor arg...
by bitL on Wednesday November 23, 2016 @02:01PM
(#13024878)
It's not about dumb code. Actually both C++ and Scala can allow you unbelievably clever code which is also super difficult to understand by somebody uninvolved. Remember how some Haskell guys were complaining they aren't able to understand the code they wrote at the top of their game anymore?
Re:Help me sort out the meaning of “{}” as a constructor arg...
by jjnoakes on Thursday November 24, 2016 @12:02AM
(#13028251)
Being too clever or too terse is possible in any language though. It is an education and experience problem, not a language problem.
Some languages may be slightly worse than others, but the root cause (and solution) is the same across the board.