polymorphism is totally overrated
i can write a generator in 20 minutes and i have to re-run it like once a year, whereas if i've got generics i've gotta wait 5 mimutes each time i compile it
polymorphism is totally overrated
i can write a generator in 20 minutes and i have to re-run it like once a year, whereas if i've got generics i've gotta wait 5 mimutes each time i compile it
Depends on what kind of program you write (and a language). Writing generators (other then macros) has never been my thing. Especially when more then 50 people is involved in the project. I always had better things to so.
But I'm just old fashioned LISP ans C guy. Whatever floats your boat 🤟
Also things like Protocols in clojure are absolutely awesome.
macros are generators
you just don't really grasp what is going on under the board
it's a really liberating thing knowing what goes on under the board
i'm not against the idea, per se, but text/template has got everything covered and personally i prefer to use string concatenation and fmt.Sprintf rather than go to the extra effort of writing a template because frankly i'm not used to templates and it is fast for me to do
all your macros do is make for less keystrokes not less thinking, and they make for more divergence of your codebase from the underlying language - that's why #golang doesn't have macros
that's why there is gofmt, and why go is more readable than python, which is the most readable language until go
knowing what is done because of your code lets you avoid a bunch of really dumb performance and security problems that almost everyone falls into then tries to pretend didn't happen, and that's why #golang makes complex operations require a lot of code, so you remember it's complex
that's why go doesn't have macros, and why its "generics" are so limited (only work on builtin types)
a lot of people, like our fiatjaf, don't realise this and think "any" is some python/javascript dynamic type thing
no, it's an interface, any is an interface
that's why you have to type assert it and that's why if you type assert it wrong your program dies with a nice stack trace
it's false economy, all these things, that's why two of the most experienced developers in the whole industry who are still alive (!) are working on Go... co-designer of C and a guy who was documenting Unix, and teh guy who devised the chrome javascript interpreter, which is the fastest one and is the basis of nodejs
the whole industry disses on these guys and the industry uses their shit all day long, it's hilarious
Oh my, where can I sign this.
I really enjoy go (and about 60% of shit I write is in go). I'm just sad that I can't write more "generic" code in a LISP style. Shaping program by the data you process is something I call liberating. You should definetely at least try. It WILL change your view on programming.