I have been thinking for a while that programming language syntax should be irrelevant for the language. That is, something like coffeescript that doesn't change the language much should be able to be used individuals even when no one else working on the project is.

One way I have thought of doing isas follows:

Let A be the majority syntax, and B be the minority syntax that I personally want to use. The version control repositories store code in A, but my working tree rests in B except temporarily for commit and fetch-related operations. Obviously, there would need to be some tools to make syntax conversion easy and low friction; does anyone know if git hooks could make this workflow all automatic?

@philipwhite but the whole point is readability right? If the equivalent code in A is readable, then there is little point in using B. If it is not readable, then the original B should be in the tree for everyone's benefit. If your peers/colleagues consider your preferred syntax illegible, no tool can help you I'm afraid. All you can do is preach.

Unless of course it's some super AI that can transform the code back and forth, while maintaining readability(tunable to anyone's liking), but at that point you'd be mostly deprecated, wouldn't you?

@namark The latter is what I am talking about, although the transformations I have in mind are superficial enough that they can be done mechanically quite easily.

For example, VB.NET and C# are essentially identical languages with different syntaxes. Other examples would be the preference of curly braces or indentation-sensitivity. I've been following the Zig language's development, and there has been a little debate about switching the `const` keyword to `let`. Syntax bikeshedding like this is stupid because it hardly affects the language itself, but it matters a lot because everyone has to read code the same way (with current tools).

However, if every tool I use to read and write code is passed through my syntax filter, then the debate would becomes an implementation detail. It would make programming language development come much closer to Unix philosophy than it is now.

Follow

@philipwhite
I think there is a contradiction between "superficial enough" and "matters a lot", though I wouldn't argue against improving modularity of any project.

I think the debates like const and let will still happen, both between various syntax devs, and the language devs over the "officially endorser syntax".

I'm not familiar with VB.NET, but quick search revealed "C# is case sensitive while Visual Basic .NET is not", which means the tool will need to be able to come up with new readable identifiers... stop thinking about this, I don't want to lose my job ._.

@namark Adding different color schemes to a text editor is a somewhat superficial change, but one could argue that it matters a lot because every single user stares at the editor's colors for hours at a time.My idea is similar - though unimportant for the structure of software, syntax often gets a lot of attention due to the amount of time programmers spend interacting with it.

I agree that debates will still happen, but I am arguing that they would be moot, and that those who recognize this could remove themselves from the debates.

You hit on one difficulty that would need to be overcome, namely, the need to round-trip the conversion so that things like indentation and variable naming conventions can be preserved. The more drastic the conversion, the more of these difficulties you will find.

Don't worry about becoming obsolete...this would hopefully just make your job consist of less friction. Admittedly, I am not thinking of a way that this could be non-intrusive, so the idea is not done yet.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.