4 ms·
Go is not OOP in any shape or form, no matter what “they” try to tell you. Go is imperative language with procedural style of writing code. Yes, you have ob
by warent 9y ago
Go is not OOP in any shape or form, no matter what “they”
try to tell you. Go is imperative language with procedural
style of writing code. Yes, you have objects and you can
attach methods to them, similarly to Ruby where everything
is an object, but that’s basically it. Never, ever, try to
repeat yourself in Go. You will crash and burn.
When it comes to Go, spaghetti code is what you want to write.
This was really funny. Definitely the rantings of someone who is used to too many layers of abstraction and coded themselves into a corner before finally blaming the language. I'm detecting a lack of self-awareness. Here is where the author should have used the gif that was used at the start of the article
- powerslacker 9y agoyou got me to make an account and move the gif, I hope you're happy with yourself
- warent 9y agoHappy enough to give you the ol' retweet: https://twitter.com/ArentWyatt/status/940480529740193792 https://twitter.com/ArentWyatt/status/940480529740193792 Italian chef kiss EDIT: p.s. thank you for designing your website so that can actually handle some traffic. That's worthy of the hacker news gold achievement
- majewsky 9y ago> thank you for designing your website so that can actually handle some traffic. That's worthy of the hacker news gold achievement Not really. When I had a blogpost on the frontpage for the first time, I checked the monitoring and saw a CPU load of 6% of a single core and 1 megabit per second (that's bit, not byte). [1] And it's simple, really. You just write some text on the page, add a small stylesheet. And then you just stop, resisting the urge to add any JS and tracking and hero images. You just stop. And instead of generating your HTML on the fly from a database, you just serve a static HTML file. [1] Graphs: https://blog.bethselamin.de/posts/latency-matters-aftermath.html https://blog.bethselamin.de/posts/latency-matters-aftermath....
- jstewartmobile 9y agoIt is a fair enough point though. Even Go written by pros often does not fit together easily. Adjusting one library to fit with another is often a non-trivial task, and many package authors freely admit as much. I must have links to at least five different gzip middlewares in my favorites, and I'm sure there are more than that...
- majewsky 9y ago> five different gzip middlewares At which point is it easier to put the app behind an nginx reverse proxy? Chances are that you have a reverse proxy anyway since one Go app is not nearly enough to saturate a server CPU.
- jstewartmobile 9y agoPoint being that something which could be easily slipped-in with a more dynamic language triggers a total re-wrap in Go, or punting to an outside system like your example. Not hating on it though. I like Go for network-y things. edit: And in your example, is it a clear win to centralize compression at the proxy?
- nine_k 9y agoIf I had to point at one thing Go did exactly right, I'd choose the "OOP" bit. Inheritance is an anti-pattern. Interfaces is the way to go. Maybe the only thing I'd add is a compiler warning when an object which does not declare itself as interface X but complies to it is used as interface X. (Typeclasses would be even better, but it opens the can of worms which is the support of generics.)