←back to thread

Go is still not good

(blog.habets.se)
644 points ustad | 9 comments | | HN request time: 0.657s | source | bottom
1. andy_ppp ◴[] No.44983412[source]
They are forcing people to write Typescript code like it’s Golang where I am right now (amongst other extremely stupid decisions - only unit test service boundaries, do not pull out logic into pure functions, do not write UI tests, etc.). I really must remember to ask organisations to show me their code before joining them.

(I realise this isn’t who is hiring, but email in bio)

replies(3): >>44983532 #>>44983602 #>>44983720 #
2. theshrike79 ◴[] No.44983532[source]
Have you seen Java people write Python? Same vibe :)
replies(2): >>44984342 #>>44990455 #
3. sebstefan ◴[] No.44983602[source]
Ah yes. I love working at places that hire experts just to tell them how they should do the work they're an expert at.
4. candiddevmike ◴[] No.44983720[source]
I do this and think it works really well...

myfunc(arg: string): Value | Err

I really try not to throw anymore with typescript, I do error checking like in Go. When used with a Go backend, it makes context switching really easy...

replies(2): >>44985065 #>>44997272 #
5. keb_ ◴[] No.44984342[source]
Reminded me of this classic talk https://www.youtube.com/watch?v=o9pEzgHorH0
6. andy_ppp ◴[] No.44985065[source]
They still throw and just have millions of try catch blocks repeated everywhere around almost every function :-/
7. Mawr ◴[] No.44990455[source]
Sure have: https://youtu.be/wf-BqAjZb8M?t=831
8. chamomeal ◴[] No.44997272[source]
I do actually love returning errors in TS. It solved most of the problems I have with error handling.
replies(1): >>45002752 #
9. andy_ppp ◴[] No.45002752{3}[source]
Yes not terrible, I think throwing is often worse. I do think that Golang forcing you to deal with Errors immediately is just a bit extreme, sometimes it’s nice to have a choice or create abstractions about how to handle them.