4 ms·
Go for C++ programmers, or.. trying to keep a straight face when explaining that no, just implementing "Less" to sort an array of some type isn't enough. You'll
by vinkelhake 12y ago
Go for C++ programmers, or.. trying to keep a straight face when explaining that no, just implementing "Less" to sort an array of some type isn't enough. You'll also need to tell Go how to get the length of an array and how to swap two elements.
Now, don't get me wrong. I actually like Go for the things I use it for: replacing Python.
- 0xdeadbeefbabe 12y agoWell go has a nice grammar. Seems like you won't have to write much boilerplate if when you can automate writing the code. What bugs me most is this popularity contest. For example, the idea that go will go mainstream and writers of the future will write about people that did keep a straight face when explaining what you said. You know how people unwittingly revise history. This field has too much fashion going on and not enough engineering.
- tptacek 12y agoPython outcompetes C++ in the market by a significant multiple. Python is used in diverse applications, many of them quite ambitious --- game backends, computer algebra, cryptography, network filesystems, simulation code, machine learning. So is it just that the subset of applications that still get written, for some reason, in 2015 C++ are heavily dependent on specialized Sort implementations? Or is it instead the case that really Sort just isn't that big a deal? It's pretty easy to look around briefly and see that a fair amount of ambitious stuff is being built in Golang. Somehow, they manage to do it without sum types and generics!
- pjmlp 12y agoIt's pretty easy to look around briefly and see that a fair amount of ambitious stuff is being built in Assembly. Somehow, they manage to do it without structured programming and high level languages!
- tptacek 12y agoNo, it's not easy to look around and see that, because that isn't happening.
- pjmlp 12y agoIt was happening in the 60-90's time-frame. So people were productive without higher level abstractions, but then they moved on. Likewise, people were once productive using languages without generics during 60 - 2004(Oberon, C, Java < 1.5, Turbo Pascal, Modula-2), but then they moved on.
- shin_lao 12y agoJust try to remove all C++ applications from your everyday life, you will have the answer to your question.
- pjmlp 12y agoWhile true, and saying this as someone that likes C++, the reason many of those applications are written in C++ is that the choice of imperative languages with AOT compilers is not that big. I remember having to fight to use this new strange thing called C++.
- vinkelhake 12y agoI'm not entirely sure what argument you think I'm making or what you're arguing against. Yes, Python is used a lot. Go is used a lot. C++ is used a lot. Programming language design is all about tradeoffs. The makers of Go went for simplicity. There are pros and cons about their approach. What do you do when you run into something like this? You put your head down and work through it, like I have done every time I've had to write those three functions for sorting something in Go. We can talk about the cons of an approach without having to point out that people work through it. After all, it's pretty easy to look around and see that a lot of ambitious stuff is being built in C. Somehow, they manage to do it without memory safety and generics.