Hacker News new | ask | show | jobs
by fabiensanglard 2514 days ago
I hope this doesn't happen. I love golang because it is simple and easy to read. Both will go away when generic programmer start to write unreadable meta-programming class which "you don't need to understand, just use them".

I admire golang devs for being opinionated and stand up for the core lines of their language so far.

I see generic as renouncing these principles.

5 comments

What are you on about? The current draft doesn't enable any type of meta-programming.
I don't think it's as clear-cut as you make it seem. Generics greatly reduce the amount of code we need to read in exchange an slight increase in abstraction. In my opinion, the tradeoff is worth it, especially given that Go already has abstractions that are more difficult to grok than generics, which, all things considered, aren't that hard to understand.
It’s not worth it because most people tend to abuse them.
do you have any statistics that can back your claim?
May be you could share feedback with us and the designers about which parts you think will be hard to understand? This is a valid concern but only way to address this is to specify and share as feedback to the proposal.
This design does not permit metaprogramming.
This. If I really need generics I'll use a different language.
This reminds me the discussion about first version of iPhone how so many people were advocating why adding copy&paste functionality was a bad idea.
More like people were advocating against the shitty Copy&Paste phones used to have.

When it came out, it was possible to C&P pictures to emails and other fancy stuff that wasn't possible before.

I'm quite sure that was possible on android from the beginning.
Agreed. There are good objections to generics; this is not one of them.

EDIT: If any Apple employees are reading this, I really wish autocorrect would stop confusing generics and generics. :)

Must every popular language evolve into C++ or Common Lisp?
I wonder if there's room for a language that is small, allows for nearly limitless abstraction, and still has great tooling. Go is (or, you could argue, was) small, and now has better tooling, but is just beginning to increase its ability to create abstractions. Common Lisp is large (only 200 pages fewer in its spec than C++, if I remember correctly), has unparalleled tooling (like the don't-unwind-the-stack debugging and SLIME), and really good abstraction power. Scheme is small and consistent (unlike CL), and also can create similarly advanced abstractions, but is missing some of the tooling that CL has enjoyed for eons.

I'll be really cool to see a language that feels consistent, tight, well-engineered, and small; can create powerful abstractions similar to what can be achieved using CL macros and CLOS; and has an awesome debugger, editor interop, interactive programming with a REPL, build tools, etc.

Scheme?
I fleshed my comment out into a blog post yesterday, which got some interest[0] on Lobsters. It appears that modern Scheme is easier to write portably and an even nicer compromise than I had originally thought.

[0]: https://lobste.rs/s/ytuyya/perfect_language_why_go_still_isn...

Scheme is possibly the best designed language I've ever seen. Which may be why no one uses it.

(Note: Macros, even Scheme's hygenic ones, can produce horrible monstrosities. Like loop. And the urge towards object systems gives Scheme a horde of them, mostly bad. This may be a lesson in getting what you ask for.)

It's called Smalltalk.
That's great if you get to pick the language you use for every project. Not all of us get that luxury.
And also only works if your project requirements are entirely foreseeable from day 0.