- Joined
- Feb 9, 2013
If it's code you're delivering to someone, I'd say Go.I've spent too long working with typescript and shit. I think it might be making me legitimately retarded. I'm considering running out a library or two in another language, for a project I'm consulting on, mostly for kicks (but also because it might be beneficial to have in the future,ifwhen we decide to migrate to something more robust). What I can't decide is whether to go with go, rust, or the dark horse candidate swift. It'd help if I could get an idea of which one generates the most complaints.
Or hell, maybe I'll just go back to cpp, even though I've barely touched it since university. What could go wrong?![]()
Rust sounds interesting, but I feel like it's still in its hobbyist language stage. I don't know if it'll ever really break out of that niche.
And personally, while I'd love to use all kinds of exotic languages for professional work, I know I'll get bitched at or it'll come back to bite me in the ass at some point.
Also Go has some decent ideas (some borrowed from the hobbyist languages that I'd like to use) that solve a lot of typical headaches you see in other mainstream languages.
I really like any language that prefers error aware return types over try/catch.
Try/catch usage just encourages lazy programming. Like I can't tell you how many times I've seen people (and full disclosure, I'm guilty of this too) who just say fuck it and wrap everything with a try catch. Often there's no agreement with caller/callee about how errors are supposed to be handled. Like at work, our plugins are written by some guys and consumed by others. Sometimes the plugins promise to never throw anything. They promise to catch their errors, log them, and return null. But I see the code consuming the plugins and they wrap them in a try/catch anyway.
In Javascript, unless you read every line of code of every library you use, you have to really trust the documentation is accurate. And programmers never maintain documentation. You might as well wrap any call to any library with a try catch, just to be safe.
Some languages try to require function signatures include the types of any exceptions they throw, but that gets annoying in a different way. I think that's just an attempt to patch up a flimsy model.
Error aware return types convert the human protocol of relying on documentation into a code based protocol that forces you, with the syntax of the language, to think about and account for every possible interaction that might fail.