3 ms·
This is the kind of thing that really annoy programmers (because in programming languages, you can never omit things like this), but everyone else is perfectly
by OskarS 5y ago
This is the kind of thing that really annoy programmers (because in programming languages, you can never omit things like this), but everyone else is perfectly fine with.
As a programmer though, it certainly annoys me!
- ivan_gammel 5y agoIn fact in some programming languages you can (or should) omit things like this. E.g. pascal does not require or explicitly forbids semicolon before end keyword.
- int_19h 5y agoPascal is fully self-consistent here: in it, semicolon is a statement separator, not a statement terminator. Since the statement before "end" is the last one in the block, there's no statement to separate it from with a trailing semicolon, and so it's a syntax error.
- stkdump 5y agoIt's not a syntax error.
- denton-scratch 5y agoCorrect - the redundant semi-colon denotes an empty statement.
- barrkel 5y agoPascal permits a null production for the statement grammar. simple-statement = empty-statement | assignment-statement | procedure-statement | goto-statement . empty-statement = . from http://www.pascal-central.com/iso7185.html#6.8%20Statements http://www.pascal-central.com/iso7185.html#6.8%20Statements (ISO 7185 Pascal) In practice the separator-vs-terminator distinction mostly shows up in if-statements: if foo then bar else baz; I believe that anywhere else in a statement context, you can put in as many extra ';' as you like and it won't make a difference. And of course you can drop the final ';' before 'end' or 'until'.
- ngcc_hk 5y agoIn those day when moving cursors with full screen editor (which is Not vi or Emacs), how many hours of my life wasted on this deletion of semicolons. Sigh. Still I actually struggled each time this given not exactly sure I am in English or American camp.
- montroser 5y agoSee also automatic semicolon insertion in JavaScript, and conditional permission to omit closing <p> tags in HTML. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#automatic_semicolon_insertion https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... https://html.spec.whatwg.org/multipage/grouping-content.html#the-p-element https://html.spec.whatwg.org/multipage/grouping-content.html...
- crispyambulance 5y agoI feel the same way, but I think programmers should hold their feelings and just pick up an APA, MLA or Chicago style guide or whatever the equivalent is if you're writing in British English and embrace the rules. Or if you're publishing, let an editor fix your stuff. Every effort to make a logically consistent "engineered" language has so far failed by any reasonable measure, notably, Esperanto. Others have tried and had even less success than Esperanto. For things to even change in language usage there really has to be a pain point or some kind of trauma or isolation. Mere aspiration for aesthetics or logical consistency isn't enough. How did the American English come to be anyway? A bunch of people got on boats and went to a remote wild continent and stayed there. Forever.
- mark-r 5y agoThis is sound, pragmatic advice. But it doesn't mean we have to like it.
- repsilat 5y ago> everyone else is perfectly fine with My newspaper will shorten "United States" to "U.S.", and not add an extra period at the end of a sentence. (Not sure if the spaces are different widths.) When the next word would naturally start with a capital letter it can be difficult to tell whether the sentence ends after the abbreviation, sometimes making for garden-path sentences. >> There have been some rumblings inside the U.S. Supreme Court justice Stephen Breyer said in an interview... Though I am a programmer, so maybe it is just us...