3 ms·
"Don't use a Web framework" (#1), "use panics wisely" (#2), "be careful when reading from request.body more than once" (#3), "be careful of hidden allocations f
by pcwalton 11y ago
"Don't use a Web framework" (#1), "use panics wisely" (#2), "be careful when reading from request.body more than once" (#3), "be careful of hidden allocations from pointers-to-slices" (#5), "be careful with the surprising behavior of naked-return-implies-return-0 feature of Go" (#6), and "be careful with the interactions between mutation and shadowing" (#7) are all Go-specific. Among popular languages, issues #5, #6, and #7 apply only to Go.
- TheOtherHobbes 11y agoYou may have an off-by-one error. :) Otherwise you're right - but all languages have sharp edges. I'm using Go on my current project and I've gotten a lot further a lot more quickly and with better performance and reliability than I would have using Django, Rails, or Node. Because I'm not in a hurry I thought it would be fun to write a simple custom server/router/middleware bundle around net/http without using any 3rd party packages. From a cold start it all turned out much easier than expected, and so far the whole thing is under 500 loc. Being careful around a few sharp edges seems like a small price to pay.
- shwouchk 11y ago1) Be judicious regarding your choice of tools 2) Be careful with signalling errors 3) Don't read twice from a stream and expect the same data 4) Don't write SQL? 5) Understand pointers 6) Make it easy for readers of your code 7) Understand Scoping 8) Don't use objects concurrently unless they were designed for it 9) Keep track of which versions of dependencies you use