8 ms·
But that is true for many other languages of the similar caliber, like Rust and C++ are also extremely complicated!
by z3phyr 7y ago
But that is true for many other languages of the similar caliber, like Rust and C++ are also extremely complicated!
- IshKebab 7y agoIn terms of mental concepts I will maybe give you Rust - lifetimes, and the borrow checker take some getting used to. But C++ doesn't really have any complicated concepts. Sure it has a lot of features, and some of them have complicated edges (ADL, template metaprogramming, etc.), but most application code rarely uses those things.
- vnorilo 7y agoI’m not sure lifetimes are that much more complicated than the way C++ does implicit type coercion of user classes, resolution of compile time polymorphic functions, namespaces or SFINAE. I do agree it’s more like death by a thousand paper cuts rather than the torso-cleaving katana of the borrow checker. However I tend to believe any C++ codebase of consequence will run into some of this stuff, unless practices that avoid all the pitfalls are metoculously followed. Which implies a rather thorough understanding of said complexities.
- IshKebab 7y agoThose are all advanced C++ features. Lifetimes smack you in the face 5 minutes into "Hello world".
- reubenmorais 7y agoMaybe not complicated in terms of how abstract it is, but pretty much everything in C++ is very complicated in terms of all the little rules and exceptions and subtle interactions between behaviors and compilers leveraging UB to do insane things. You can do a lot without thinking about it but if you want to have a precise understanding of things prepare to have to read a ton of rules. It's a language lawyer's dream language.
- wwright 7y agoI think the complexity of C++ comes from the edge cases, unexpected interactions between features, conflicting syntax, and bad assumptions made over its long history. I mean, the rule of three is just insane. How is anyone supposed to anticipate that behavior?
- Izmaki 7y agoThis. Remember that to be functioning in Python, C++, and many other languages you don't need to learn most if not all concepts. That is not true for Haskell where if you know a lot but not everything, you are likely running into trouble quickly. Example from my own experience: I've read 1/5 of "The Haskell Book" and know the essentials pretty well, but throw mature Haskell code (as in "something people made for a real purpose") at me, let alone monads, and chances are I'm blown away.
- youerbt 7y agoBut it I throw mature Python/C++ code at you, with concepts you don't know, how is it easier? Those Haskell threads are full of exaggerations. I don't know/use a lot of Haskell concepts and I can still produce software with it. You can be just fine with IO and passing everything as arguments. Which is, well, what article is talking about.
- vbezhenar 7y agoWhy do you write Python and C++ in one line? C++ is an extremely hard and esoteric language. Python is very easy language. They are like two opposite points.
- pjmlp 7y agoPython is anything but easy, it is the same caliber as C++, just lacking implementations able to execute as fast. If you are able to master all the language changes between minor releases, master every language feature across objects, metaprogramming, functional, old style classes, multiple inheritance, slots,...., the complete standard library, and all major third party libraries, I bow to thee.
- lapnitnelav 7y ago>Python is anything but easy There's plenty of shade you can throw at the good old snake, be it package management, performance / speed, formatting peculiarity but this one is the most unlikely I can think of. What does it make it not easy in your mind?
- mlthoughts2018 7y agoYou may have a point with Rust, but you don’t have a point with C++, and certainly not with other mainstream languages like Python, Scala, Java, C#, and others. In C++, you can focus on subsets of the language that eschew whole huge paradigms (like templating or inheritance) and you’re roughly no worse off in terms of the scope of practical programs you can write with basic software patterns. You can’t do this in Haskell. You really do have to learn all the complex hierarchy of paradigm-committing patterns and use nearly all of them nearly all the time, making it much harder to learn than C++ even though C++ is complicated. Languanges can be complicated in different ways, and Haskell is unique in that you have to engage with every complicated aspect of it nearly all the time.
- tome 7y ago> You can’t do this in Haskell. You really do have to learn all the complex hierarchy of paradigm-committing patterns Err, no you don't. The only slightly unusual concepts Haskell 98 has (from a functional programming point of view) are monads, type classes and laziness. Haskell 98 is a perfectly decent language to write computer programs in. In fact it's even perfectly decent if you largely avoid monads and type classes! The "you can focus on subsets of the language" claim is no weaker for Haskell than it is for C++.
- mlthoughts2018 7y ago> “The only slightly unusual concepts Haskell 98 has (from a functional programming point of view) are monads, type classes and laziness.“ Exactly. The way they manifest in Haskell requires huge time investment before you can write basic programs. For example, how do you write dynamic dispatch in Haskell 98? If you give an answer that either (a) involves exotic use of type classes or (b) say “don’t desire dynamic dispatch in a functional paradigm and instead restructure the whole program to avoid needing it” then you’ve proven my point. That fact that you think monads, type classes and laziness, being “three” concepts (except really they unpack into way more top-level concepts, especially the first two), means you have a huge blind spot. Your experience makes you think of them as self-contained things but they aren’t and even just those three things yield huge complexity sprawl in Haskell.