← Back to context

Comment by zanny

10 years ago

Lets use Rust for an example. While I understand what a lot of operators in Rust do, like let X : Y = Z or !foo, I personally adore the Python habit of starting with a word based grammar and graduating common functionality into more obscure abbreviations (def) or glyphs (%).

Using those examples, let X as Y = Z is just one more letter but eliminates any confusion for someone unfamiliar with the syntax, since its fairly distinct from other C like languages.

Its also not particularly cumbersome for a language to support a ! operator and the keyword "not" for logical negation.

Same with : and "in" in for loops.

That and syntax features like whitespace significance as a basis are IMO great for good style.

For a language like Rust where it is now, adding these optionally would greatly increase my enjoyment of the language, because I generally like programming that I can read like Python, despite having a half decade of C++ experience so its not for a lack of benefit from the terseness.

Whenever I come across someone whose favorite language is Python, their argument is usually that "my pseudocode is basically Python!". While Python is certainly not my favorite language I really adore its syntax. A joy to work with. The wordiness and significant whitespace are features to me. For any feature, the syntax is usually the simplest and most obvious thing you can think of. No reason to look things up; guessing is actually a viable alternative! It's the lack of compile-time checks, support for functional programming, run-time weirdness and slowness that I don't like. It's an excellent replacement for shellscript, though.

Rust would do well to avoid weird glyphs, IMO.

  • Ruby is even better as a shell script replacement. It has things like backtics for command execution, built-in regex operators, string interpolation, and other nice shortcuts. Python is a bit too rigid/dogmatic.

  • > It's an excellent replacement for shellscript

    'Only', 'if', 'you', 'like', 'quoting', 'every', 'single', 'word', 'or manual splitting and'.split(), variable, 'interspersing'. Or writing your own shell syntax.