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

How does that make the language half-baked? Go didn't have generics until recently which made utility functions like that complicated. C doesn't have them either.


C was created 40 years ago. I wouldn't expect it to have the same feature set as Go. Plus, we already have a language like C, and it's called C.

Go made multiple decisions that make me face palm. It was so close to being a great systems programming alternative.


I want a programming language that’s boring. It should have things that Python has including classes. Fast and compiled. No need to try new things.

A pythonic C++ that doesn’t smell bad.

I wish Go had classes. I like those damn things. Extending a Dog from Animal with all the methods and data in one place is nice.


> A pythonic C++ that doesn’t smell bad.

Obligatory...try Rust?

But actually, try python with mypy and mypyc. It's still a little experimental, but if you stick to simple constructs it works well, and you can compile straight python to fast, static libraries, without using goofy cython syntax.


If by extending you mean that you want to have a type that includes ALL the functionality of another type, without needing to fill in each method, that's already supported.

In your new struct definition, include the desired base type as a member - without giving it a name. That embeds the unnamed member directly, and your new type automatically gets all the interfaces and their underlying implementations. As a python-person I always found this a somewhat odd mechanism, but from a functionality perspective it satisfies what I have wanted to do.

Guess that's what people mean by composability.


You should check out Nim. I wish more people would! https://nim-lang.org/


I like Nim, but it's not for someone who likes classes.


Nim supports classes and methods.


It has methods, but doesn't really have classes. And class-oriented programming is unidiomatic in Nim.


I think you can reasonably represent inheritance using struct embedding, and that's quite idiomatic in Go.


can't you get away with just composing the structs, sure not exactly the same but does a good job still


> C was created 40 years ago.

Closer to 50.


I write mainly in c and like most aspects of it but its the absolute minimum standard for built in library support.

The fact that simple reusable utility functions were/are complicated does make it feel half baked to me too.




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

Search: