Hey what's so bad about C++? I find it beautiful.
little update;
- C is nice but not for the faint of heart
- C++ I found it to be C with added garbage that one has to learn not to mess up memory
- Go is beautiful, thanks nostr:npub1fjqqy4a93z5zsjwsfxqhc2764kvykfdyttvldkkkdera8dr78vhsmmleku for letting me discover it
I am following https://quii.gitbook.io/learn-go-with-tests and fucking hell, finally a guide for noobs that explain to me how I should work and think when I program, how I should do tests and so on.
nostr:note1jvr0e5vk2386r3ne3kwme7vms7lkewvzn8vhh0qjk9qsgx4d834qf9l78p
Discussion
I guess that it depends. It has many more features than C which makes it harder for beginners like me.
like, I don't understand what's "smart" about smart pointers, and why exist...
C++ also has templates (one definition multiple types) and concepts (constrain the accepted types to have particular properties) which are all resolved at compile time.
templates are just complicated garbage code generators that take ages to compile, aka "generics", i have written dozens of code generators for teh same kinds of purposes and i could count the number of times it's been important on two hands in the last 8 years
interfaces achieve the same result but force you to actually think about it so the compiler doesn't have to spend many seconds trying to figure out what you mean when you refer to a method on a type that isn't explicitly tied to it
i have lost count of how many times i've used interfaces for this kind of polymorphism but it's also quite overrated, it's more useful for plugging modules together without needing to know the internals, ie, it helps with encapsulation
go has simple types of generics but only on value types, and they are actually handy a lot (especially between types of integers and between strings and byte buffers)
here is the thing, I can't think of any situation where I would absolutely need these things, so 🤷
I guess I am a minimalist