3 ms·
As I read this it made me wonder why I was still using Javascript to write my server code. Thing I always hated about it was the lack of types, and practitioner
by valuearb 9y ago
As I read this it made me wonder why I was still using Javascript to write my server code. Thing I always hated about it was the lack of types, and practitioners bleating to "write unit tests" instead. So much less efficient and effective. Even Typescript doesn't seem like much of a fix.
Go sounds like Swift, strongly type compiled languages. Go has better concurrency features and likely compiles faster (I mean anything has to compile faster than Swift).
Swift still seems to have better, faster garbage collection, better language features such as generics, and optionals make error handling and writing safe code much easier.
But Swift doesn't have the community and infrastructure around server development that Go does. I think I'm giving Go a go next project.
- thatswrong0 9y agoIt’s funny because I use JavaScript every day on the front end and often have to write backend in Go. I honestly don’t think Go does enough to it to make it worth using over something like JavaScript. You still have to write unit tests and integration tests. It’s strongly typed, sure, but it’s type system isn’t robust and doesnt really help you that much, and it just feels.. outdated. Every other line of code is “if err != nil”. Nil pointer exceptions are.. still a thing. Yuck. Typescript has a far more expressive type system than Go.
- dimonomid 9y agoNot sure what do you mean by "its type system isn't robust".
- untog 9y agoI've used JavaScript/TypeScript and Swift extensively, and I was very surprised by how much I disliked Go when I tried it. The usual complaints: error handling and lack of generics. But both TypeScript and Swift do a better job in those areas. If Swift had a better story for async then I'd want to write everything in it. As you say, the server-side community just isn't there yet, so it's Typescript for me.
- zumu 9y agoI like building back-ends in Go. That being said, the type system is really not its strong suit and you will still want to write tests.
- dimonomid 9y agoOf course having type system doesn't free you from the need to write tests, and yet, you need to have less test cases, and there are much less possibilities of allowing silly errors like typos etc.
- zumu 9y agoMy point is Golang doesn't have a very safe type system. It's better than plain JS, but if valuearb really wants to experience type saftey, they should look somewhere other than Golang. Swift, which they also brought up, would be a much better choice.
- valuearb 9y agoI'm afraid to try Swift on the server. On one hand I love it and am very productive in it. On the other hand, if I build anything commercial out of it have I coded myself into a trap? How easy is it to use Mongo, or some real database? How much open source code is out there to help build web servers with restful APIs?