I just wanted to point out that the author of this article is a high school student. http://jozefg.bitbucket.org/about.html
Wow, "writing lots of compilers and type checkers" definitely wasn't on my radar screen when I was in high school.
Leaving Go
121–130 of 220 posts
Re: Leaving Go
#122It's ironic that the "better" the language (for some hazy definition of "better") the less actual work seems to get done with it. So Go can be pretty annoying at times, and so can Java (I've said before that I find the two almost identical, but that's beside the point now); and C is horrible and completely unsafe and downright dangerous. Yet more useful working code has probably been written in Java and C than all ot…
As someone who thinks that more advanced type systems and proof-carrying-code are some of the biggest advances in theoretical computer science and practical programming in the last few decades, but also is a C# compiler developer, I have also noticed this. Haskell is really interesting, but C# developers get shit done. I'm not sure what the cause is, but it definitely gnaws at me.
Re: Leaving Go
#123Earlier quoted context omitted.
x = append(x, foo) is a common C idiom too; in fact, it's been awhile since I had to work with STL containers, but I think it was common there too. I love Golang namespacing rules. They do exactly what I need them to do to allow me to call into other people's code using the right function calls, and nothing else . I think Golang's namespacing is a high point of the language.
I don't think simply having a separate symbol table for packages and a separate one for types and variables would hurt much, and I hate writing things like aList := list.New(). Having said this, I know many of those things are purported to have such and such super important reasons, it doesn't change the ugly "feel" of the end result. Another instance is the indication of visibility by case, they will go on and on ab…
Re: Leaving Go
#124If you're looking for a language that will enable "bottom-up development", where you gradually define, in Paul Graham On Lisp style, a language optimized for your problem domain, Golang is not the language for you. Similarly, if you're looking for a language that will read and write like a specification for your problem domain, so that writing your program has the side effect of doing half the work of proving your pr…
Reading a golang program is simple because you don't have to chase class hierarchies very far. I personally find polymorphic code to be a detriment to team projects. Anything that hides implementation is a hit on readability.
Re: Leaving Go
#125Earlier quoted context omitted.
> x = append(x, foo) is a common C idiom too; in fact, it's been awhile since I had to work with STL containers, but I think it was common there too. No, vector::insert() is the common idiom and mutates in place. It'd be written `x.insert(x.end(), foo.begin(), foo.end());` For single elements, vector::push_back() is the common idiom, and also mutates in place.
vector::insert() is certainly not a C idiom. In can never be a C idiom because that is C++ code. the x = append(x, foo) idiom can be seen all over C, most obviously with the use of realloc, which is often called to resize an array via x = realloc(x, newsize).
Re: Leaving Go
#126I think people gave Go a lot of credit just because it was designed at Google. People have high respect for Google engineers and so they assume what Googlers have designed must be flawless. So they take for granted ideas like lack of exceptions or lack of operators' overloading being a good thing, even though I'm quite sure they would be quick to criticize such BS if that was a feature in a language not coming from G…
What's interesting with go is that if you can program, you already know it; all your time is spent building stuff, not learning the language. And when it comes to building stuff, Go is just straightforward.
Re: Leaving Go
#127The example could have been simplified: func abs(x Top) Top { switch v := x.(type) { case int32: if v
This isn't simpler, it's smaller. In fact it's more complicated , since instead of 4 completely separate cases you have 4 half-cases and a default. For instance, pass a positive int16 and you get the right answer, but pass a negative int16 and you get a useable but wrong answer instead of nil from the original.
Thanks for the downvote :-)
Re: Leaving Go
#128Earlier quoted context omitted.
I don't think simply having a separate symbol table for packages and a separate one for types and variables would hurt much, and I hate writing things like aList := list.New(). Having said this, I know many of those things are purported to have such and such super important reasons, it doesn't change the ugly "feel" of the end result. Another instance is the indication of visibility by case, they will go on and on ab…
I honestly am not sure I follow what your concern is with that line of code. list.New() looks extremely clean to me.
func ReadFile(filename String) {
file := file.Open(filename)
}
In Go you have to invent a new name, so invariably you will see a lot of: theFile := file.Open(filename)
aFile := file.Open(filename)
readFile := file.Open(filename)
depending on who wrote the code.Re: Leaving Go
#129I just wanted to point out that the author of this article is a high school student. http://jozefg.bitbucket.org/about.html
Re: Leaving Go
#130Earlier quoted context omitted.
When I wrote that paragraph, I definitely did not think of "pragmatism" as "doing whatever people wanted them to do". Golang is also not Perl. If you're looking for Perl, Golang will disappoint you.
If you are looking for X, Y will disappoint you. -or- If you are looking for X, use X.