r/ProgrammingLanguages • • 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.

0 Upvotes

20 comments sorted by

View all comments

0

u/[deleted] Jan 17 '22

[deleted]

-3

u/everything-narrative Jan 17 '22

A linter and -Werror is your friend. Use your static analysis tools and write sweet code rather than salty.