Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
NateDad
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
58 ms
·
541.
▲
by
NateDad
12y ago
...that you'd actually want to program in and doesn't have footguns the size of the deathstar?
542.
▲
by
NateDad
12y ago
Factual implies correct. But you are incorrect that it is weak. You're looking for objective and subjective.
543.
▲
by
NateDad
12y ago
I don't understand why all the ML-lovers have to bash Go for not being OCaml or Haskell or Rust. It's like bashing Python for not having static typing. Go is not one of those ML languages with a complicated type system. It has
544.
▲
by
NateDad
12y ago
That post is a piece of garbage. He's clearly angling for a language like Rust or Haskell that has a very complex type system for preventing errors in the code, and no other language would succeed with the way he was writing code (wh
545.
▲
by
NateDad
12y ago
Haha, no. You pretty much never forget them. And if you're worried, you can run a linter to find spots you've missed. My go programs are 100x as robust as my programs with exceptions because Go actually forces you to think about
546.
▲
by
NateDad
12y ago
This is a feature. The statement might not succeed . You shouldn't use it as part of a bigger expression and assume it will work. t, err := foo() if err != nil { return err } bar(t) this makes it totally
547.
▲
by
NateDad
12y ago
Getenv returns an empty string just like unset env variables act like an empty string on the command line. If it returned an error, people would complain it works differently than they're used to. You can't please everyone.
548.
▲
by
NateDad
12y ago
I have my facts straight, thankyouverymuch. Here's an article from golang.org itself: http://talks.golang.org/2012/splash.article "The language was designed by and for people who write—and read and debug and
549.
▲
by
NateDad
12y ago
"The problem with Go is that it wasn't designed to implement any large projects" What? Uh no. That's exactly what it was designed for. Big projects at Google. It has been stated by the creators of Go multiple times
550.
▲
by
NateDad
12y ago
They are human. They've also been programming for over 30 years with numerous big successes that prove they know what they're doing.
551.
▲
by
NateDad
12y ago
You'll have to explain to me what you mean by composition if you don't mean foo(bar(baz())) or foo().bar().baz() Composition means putting things together, if you're not doing it on one line, then what's wrong with a
552.
▲
by
NateDad
12y ago
More code does not mean less clear. I've seen some really hairy list comprehensions that I broke out into 3 loops and made them 1000x more clear, because you could actually follow what each conversion was doing.
553.
▲
by
NateDad
12y ago
So, by disjoint unions, I'm going to assume you mean sum types, like a value that can be either a pointer or an error, but never both, and you use special keywords to access one or the other. Sure, that's really useful - you guara
554.
▲
by
NateDad
12y ago
Yep. A zero value is very handy. Not having it would make a lot of code needlessly complex just to avoid the boogeyman of nil/null.
555.
▲
by
NateDad
12y ago
bar[i] := <anything> won't compile. You can only assign to slice/array indices.
556.
▲
by
NateDad
12y ago
FYI, you don't need to run go behind anything, the http server can handle thousands of requests per second. Of course you can if you want.
557.
▲
by
NateDad
12y ago
Not sure why you think you can't iterate over an array in go: for _, a := bytes { x += a } No there's no generics. I rarely need generics. Usually I need a specific, and waste time making a genetic. No there&
558.
▲
by
NateDad
12y ago
It sounds like you're trying to stuff too much in a single line. Line returns aren't in short supply. You can just write the loop and then write another loop. It'll be more clear that way anyway. And if you really do this a l
559.
▲
by
NateDad
12y ago
It's pretty minimalist, honestly. That's what everyone complains about, right?
560.
▲
by
NateDad
12y ago
This is what source control is for. You switch to the branch and hack on it. In the rare case you need different versions of dependencies, you use a tool like godep (but if you have to resort to that, you're doing something wrong, you
561.
▲
by
NateDad
12y ago
Just write the loop. It's 3 lines.
562.
▲
by
NateDad
12y ago
There are a ton of anti features that have been introduced in the last 30 years. Things that are clever but make your code harder to understand and harder to maintain. Many of these are things people like, but have proven to be somewhere
563.
▲
by
NateDad
12y ago
Loops make your life worse, really? Loops are trivial code that are nearly impossible to screw up. Writing a loop and writing map/filter probably take nearly the same time. If this is the biggest problem you have in coding, you'
564.
▲
by
NateDad
12y ago
Why? "my code" is in $GOPATH/src/github.com/natefinch/ ... all code that is not "my code" is in other directories. Why bother having to switch over to some other gopath to get there? Go import dir
565.
▲
by
NateDad
12y ago
So you call say 3 methods, and at the end you have a "file not found" error... which call resulted in that failure? I don't know Scala specifically, but from what I know of most languages that support this kind of chaining,
566.
▲
by
NateDad
12y ago
Because it lets your math code look more like math and less like code. v := Vector{} v2 := Vector{} to add the two vectors, currently you have to do something like result := v.Add(v2) rather than the nicer result
567.
▲
by
NateDad
12y ago
They're really not. You still have to have someone pass your type into something expecting an interface. It's no different than passing a string into something expecting a path when you pass it an html document... at some point
568.
▲
by
NateDad
12y ago
Why do you care if you accidentally implement an interface?
569.
▲
by
NateDad
12y ago
So you're saying you'd prefer it if you had to explicitly tell Go that your type implements an interface? Something like this? type Shape interface { Area() int } type Square struct { sideLen int } /
570.
▲
by
NateDad
12y ago
Shape is definitely much more accurately modeled as an interface than a base class, since it has no functionality on its own.
More ›