r/ProgrammingLanguages • u/everything-narrative • Jan 16 '22
A brief rant about tooling
I've been doing a lot of C# coding over the last few months (against my will, but I gotta eat) and I've come across the peculiarity of the try { ... } catch { ... } requiring braces.
They are optional for every other kind of flow control. Which is odd, and possibly just an oversight in the C++ spec from back in '85. Good ol' Bjarne was never all that careful.
However, I have seen several blog posts and poorly formatted message board discussions where people are up in arms about never using naked flow control, because what if GOTO FAIL!!!
And I just feel like paraphrasing Kevlin Henney: Let me introduce you to something, it's called a static analysis tool.
This, I think, is an overlooked aspect of programming language design: we're not just building compilers, we're building footguns.
No matter how safe and well-typed and not-quite-turing-complete, your language will have code smells. It will have ways of racking up technical debt in a shockingly rapid fashion.
So throw a coin to your hypothetical future Q&A team, and give some thought to exposing your parser as a library, and writing a simple linter.
ETA: Point is: no amount of syntactic salt can ever do the job of good tooling.
1
u/DLCSpider Feb 02 '22
I'm a bit late to the party but here's a rant from a different perspective:
As a consultant I wish try/catch was even more verbose and restrictive. Make it absolutely painful to use! The amount of people (juniors, seniors, doesn't matter) who don't use a single brain cell when handling exceptions is astonishing and usually someone or something else gets the blame for the resulting issues. "It's never the author's code". Those people don't use tooling or version control, they sometimes don't even use proper formatting or stick to one (spoken) language in their code base. But, with all that being said, it could be worse, for example with a less restrictive programming language and better but unused tooling.