Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Precisely why it's harder to use. C++ is more expressive, and thus creating self-consistent designs is harder.


C++ is more expressive than what? Than C probably. Than Java/C# - arguable. Than Scala/Haskell/Rust/Python/Ruby/R - no way.


More expressive than Java, sure. Java doesn't have overloaded operators, or cv-qualifiers, or templates, or many many many other things that make the type design space more expressive.

Ruby is hardly expressive at all in this respect - you can express to the interpreter very little about types, and the interpreter won't help you much at all.


C++ doesn't have GC, reflection, annotations, code generation utilities (annotation processors, cglib, etc), first-class generic types, existential types, rich standard library etc. That's why it is "arguable".

> you can express to the interpreter very little about types

Dynamic types are still types. Only the error detection moment is different, but lack of static types doesn't mean low expressivity.


in which of these languages can you have types depending on values ? :=)


In Scala and Idris. Haskell has no direct support, but I believe you can get quite close with rank-2 types.

Also, typing is not the end of all the things. Most languages I listed have much stronger metaprogramming capabilities than C++. Scala, Rust, Template Haskell macro systems are superior to C++ templates.


You'll have to give me an example for that. Having static types is more expressive than not having static types, but I think types make designs easier to make and understand. const is just another layer to the type system.


It's another aspect of type design you need to make decisions for. If you can't see that, I can't help you.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: