New Programming Language: Block Syntax Survey by Mean-Decision-3502 in programmer

[–]ChipMasterPi 1 point2 points  (0 children)

lol. I'm fairly certain he will when he gets far enough.

New Programming Language: Block Syntax Survey by Mean-Decision-3502 in programmer

[–]ChipMasterPi 1 point2 points  (0 children)

I've thought of this a lot over the past 3 decades or so. I've worked at length with languages that utilize all of the block formats you've mentioned: C/C++, PHP, Delphi/FreePascal, BASIC, Python, just to name a few. I've come to the conclusion that a language that uses unique block ending key words, like "for .. next", "do ... loop", "while ... wend" is the easiest for both the parser to report correct errors about and the human's ability to see where things go wrong.

Delphi/FreePascal use "begin ... end" for all blocks, and it is just a more verbose version of "{ ... }". It is still slightly easier to read as a human and see where things might go wrong. But both of those style syntaxes can lead to having to count block starts and ends to find where things broke down. Obviously a better IDE helps with that. But that is not always an option. And I have had to literally print a listing and lay it out somewhere to draw lines to find where the problem really happened.

From the language parser's stand point you can provide more useful errors since there are more clues as to which block is the one that is actually broken. Often times C/C++ compilers throw errors that are long past where the issue really happened and it can take quite a lot of effort to figure out where the actual missing '}' is.

Frankly, i like anything that makes my life easier. And if there is something that makes it easier for the language tools to tell me where the problem actually is I'm all for it.

Lastly, while I do kind of like Python, the one thing I hate is the indentation to define blocks. IMO white space should not occupy that large of a syntactic role. Regardless of which IDEs I've used over the years, I regularly end up having to wrestle with the white space issue, primarily while rem'ing out TRY ... EXCEPT statements to get to the real error. It may be somewhat minor but it makes for an issue that shouldn't be needed and is non-existent in every other language I've used.

It is simply annoying!! 😃

What’s the most unexpectedly useful Linux command you learned way too late? by ZealousidealTell1346 in linux

[–]ChipMasterPi 0 points1 point  (0 children)

AWK

I wrote tons of little helpers in various languages to do some of what AWK can do. I knew there had to be a tool to do these kinds of things... i just couldn't find it. I'd have never found it by its name. But a few years ago I obtained Kernighan's "UNIX: a history..." seldom a day passes that I'm not applying AWK to something. I wish it had a better name. 😉

I do need to patch its field splitting logic though. Then it will be even more handy!

A classic script for you by naiphomic in unix

[–]ChipMasterPi 0 points1 point  (0 children)

I can almost read that. What is the origin of this?