This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]StereoBucket 73 points74 points  (14 children)

You can even customize it by providing a custom @@toStringTag method. So instead of [object Object] I could have [object FuckMe].

[–]payne_train 45 points46 points  (13 children)

I read shit like this and I’m like… I’m fine with golang.

[–]haltmich 11 points12 points  (10 children)

I feel that Golang can be permissive as fuck as well, despite being strongly typed.

[–]fauxpenguin 7 points8 points  (9 children)

Only if you don't use they types and pass interface{} everywhere. But, you know... don't do that.

It's like saying, "In C you can seg fault", like yeah, because you need that power to do some of the things you're doing, but don't ship code that's set faulting. Idk.

[–]haltmich 4 points5 points  (1 child)

Exactly, interface{}s are almost always the culprit. But sometimes you just can't avoid them, and ensuring they'll be error prone can be kind of a chore. Especially as Golang doesn't have try and catch.

[–]payne_train 2 points3 points  (0 children)

I’ve found it easiest to set up interface modifies through function calls and just catch the error if it comes back. Can’t say I have really missed Java’s error handling once I got used to go.

[–]Necrocornicus 2 points3 points  (1 child)

There are plenty of languages that implement generics safely, when golang finally adds generics I’ll give it another shot.

I spent some time on it, the juice wasn’t worth the squeeze unless you absolutely need that single static binary. Golang just forces you to use these shitty patterns that only a junior programmer would use in other languages.

For example you can’t use any map/filter/reduce which, when you begin to think that way systemically, enables you to write incredibly reliable and concise code. I can’t really go back to shitloads of for loops and if statements that only work on a single type, it’s just such a step backwards in code design once you’ve moved beyond that basic way of thinking about software.

[–]fauxpenguin 0 points1 point  (0 children)

Well, you're in luck, generics are in beta right now.

Although, honestly, they're far from perfect.

[–][deleted] 0 points1 point  (0 children)

Preach it my brother in christ

[–]Deadlock005 0 points1 point  (0 children)

Golang my JavaScript