Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
NateDad
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
26 ms
·
211.
▲
by
NateDad
11y ago
REST is great for CRUD, and easy from javascript/web pages, but it sucks for non-CRUD actions (like logout a user or reboot a machine), and it is not as friendly as RPC for consuming from client libraries. I have designed both, and I f
212.
▲
by
NateDad
11y ago
The compiler doesn't need to care about these directives. They don't have anything to do with the compiler. That's half the reason they're in comments. Otherwise you're just adding another kind of comment the
213.
▲
by
NateDad
11y ago
Fixing the lack of generics is not the intent of supporting a standard way to do code generation. The intent is to allow for things like generating code from protobuf specs and yacc. In fact, there was even debate against adding go:gene
214.
▲
by
NateDad
11y ago
They did a lot of research on the "internal" folder name and after downloading every github repo that contained go code, they found only a handful of repos that used a folder called internal. Don't think they went into that
215.
▲
by
NateDad
11y ago
Worth it for this line: There's a term for programmers who don't make dumb mistakes: Goddamned LIARS.
216.
▲
by
NateDad
11y ago
I won't get into it on generics other than to say, in my 2 years of full time development in Go, not having them has not been a big deal.... and no I don't use type unsafe code everywhere either.
217.
▲
by
NateDad
11y ago
Auto converting is an anti pattern. Explicit is better than implicit. Auto conversion is how mistakes get made. This is why modern languages don't let you implicitly convert from a string to an int, for example.
218.
▲
by
NateDad
11y ago
A nil pointer is a perfectly valid value that can satisfy interfaces. http://npf.io/2014/05/intro-to-go-interfaces/#toc_4
219.
▲
by
NateDad
11y ago
Note that everything in the same package can access all the private stuff... so you do have some flexibility. You can write two types that reference each other's private data/functionality... they just need to be in the same pack
220.
▲
by
NateDad
11y ago
Go can do this easily: type Radians float type Degrees float func (r Radians) ToDegrees() Degrees { // maths here }
221.
▲
by
NateDad
11y ago
Note, you can do this easily in Go, too: type Kelvin int type Celcius int func SetReactorTemp(temp Celcius) {} func GetOperatingTemp() Kelvin {} temp := GetOperatingTemp() SetReactorTemp(temp) // comp
222.
▲
by
NateDad
11y ago
Just a copy and paste from the solution I posted elsewhere... this really shouldn't be too hard to work around: You can easily make a wrapper type that simply masks the underlying Next() method with its own implementation. type M
223.
▲
by
NateDad
11y ago
The thing is, implicit interfaces give you so much freedom and make it so easy to keep your code decoupled, that the very rare times that you hit something like this Next() problem, you just work around it and accept it as a cost for all th
224.
▲
by
NateDad
11y ago
They're not autonomous. They're piloted by a person. There's very little difference between looking at the screen in the cockpit to know when to drop the bomb, and looking at the screen in the control room.
225.
▲
by
NateDad
11y ago
Why do people single out drones? It's not like it would be different if there were a pilot in the thing. I guess it's just good old FUD.
226.
▲
by
NateDad
12y ago
Umm holy crap. I get annoyed with 3k line files. Why in the hell are those files 50k lines?
227.
▲
by
NateDad
12y ago
+1 when non-programmers start fixing bugs, I'll worry about how hard it is for them to read the language.
228.
▲
by
NateDad
12y ago
There are a lot of tokens which are not strictly necessary, but which make a programmer's job easier. There's more to designing a language than making it use as few tokens as possible. A programmer's job involves a lot of d
229.
▲
by
NateDad
12y ago
Fitting more on screen is not objectively better, otherwise people would be talking about minified javascript is so much easier to read than python, since python wastes all that horizontal space with its newlines. And defining what is signa
230.
▲
by
NateDad
12y ago
I have three main concerns - one is that the original package authors get credit... Right now it looks like you're obscuring that by totally replacing the original import path with your own (leaving out the github username). Second is
231.
▲
by
NateDad
12y ago
"These TVs wake up quickly" So a TV that turns on when you turn it on is a feature worth certifying for, now? Ahh the joys of smart equipment. My dumb TV turns on instantly.
232.
▲
by
NateDad
12y ago
I hope they do the no bezel thing on the next xps 15. It's super sexy, but I need the extra ram and real estate in the 15.
233.
▲
by
NateDad
12y ago
Well, so, that's actually not doing the right thing. You just changed the names in the list of strings that holds admin names, but not the names on the user objects themselves. Even if the first half were returning the users themselve
234.
▲
by
NateDad
12y ago
var admins = users.Where(user => user.isAdmin()).Select(user => user.Name) vs var admins []string for _, user := range users { if user.IsAdmin() { admins = append(admins, user.Name) }
235.
▲
by
NateDad
12y ago
He does say "don't do this" and that's exactly one of the reasons why... because you lose compile-time type safety (it's still type safe at runtime, though). All the reflection is bound to be slow, as well.
236.
▲
by
NateDad
12y ago
You can do that in go with just a few more characters: g := some_input() // A list with 3 elements a, b, c := g[0], g[1], g[2] I'll grant you, having to specify the indices is slightly more verbose, but it's
237.
▲
by
NateDad
12y ago
People think focus means saying yes to the thing you've got to focus on. But that's not what it means at all. It means saying no to the hundred other good ideas that there are. You have to pick carefully. I'm actually as pro
238.
▲
by
NateDad
12y ago
forgive the copy-paste response from elsewhere on thus thread. an example from https://www.spacemonkey.com/blog/posts/go-space-monkey - we decided to transliterate our 90k lines of Python directly to Go, line by
239.
▲
by
NateDad
12y ago
Can you explain how tuples are significantly different from multiple returns in real programs? You can do func foo() (string, int, bool) { return "one", 2, true } func bar(s string, i int, b bool) {} b
240.
▲
by
NateDad
12y ago
Thanks for typing all that out. It's great to hear that most of what that article complains about is not affecting current PHP projects. I know there's a ton of PHP out there, so it can't be that bad. :)
More ›