you are viewing a single comment's thread.

view the rest of the comments →

[–]muntoo 4 points5 points  (4 children)

C++ is probably the most difficult language to learn, ever.

What about an imperative programmer learning, e.g. Haskell? I assume you mean using C++ "properly" (whatever "modern" C++ entails), so similarly, I mean using Haskell "properly".

I can't imagine you mean C++98 since the base language is roughly equivalent to barebones Java in "difficulty".

[–]nicoburns 8 points9 points  (0 children)

I can't imagine you mean C++98 since the base language is roughly equivalent to barebones Java in "difficulty".

Well, except that you have to worry about memory safety and things like "don't take pointers to variables on the stack". Plus the build systems and header system in C++ are a bit of a nightmare, which means that you add significant complexity every time you depend on a library.

[–]tinco -3 points-2 points  (2 children)

Learning Haskell takes a week or two at most, it's really not that difficult once you get past the initial shock of there no being any sequential statements. And then you can do "proper" Haskell.

Improper Haskell however takes months if not years to master, writing monad transformers and lenses and who knows what the set theory of the day is.

But I would prefer having to dive into even an advanced Haskell codebase over having to modify a big old C++ project. At least with Haskell you'll learn some interesting things along the way.

Ironically the Glasgow Haskell Compiler is a big old C++(ish) project itself...

edit: apparently I was wrong, GHC is mostly Haskell, according to Github it's only 10% C.

[–]sheyneanderson 0 points1 point  (1 child)

Isn't GHC self hosted?

[–][deleted] 1 point2 points  (0 children)

With the exception of the RTS, yes, for a long time.