Slashdot Mirror


The Swift Programming Language's Most Commonly Rejected Changes (github.com)

An anonymous reader writes: When Apple made its Swift programming language open source in early December, it opened the floodgates for suggestions and requests from developers. But the project's maintainers have their own ideas about how the language should evolve, so some suggestions are rejected. Now a list has been compiled of some commonly rejected proposals — it's an interesting window into the development of a language. Swift's developers don't want to replace Brace Syntax with Python-style indentation. They don't want to change boolean operators from && and || to 'and' and 'or'. They don't want to rewrite the Swift compiler in Swift. They don't want to change certain keywords like 'continue' from their C precedents. And they have no interest in removing semicolons.

207 of 339 comments (clear)

  1. Duh by Anonymous Coward · · Score: 1

    Don't like it? Fork it!

    1. Re:Duh by Anonymous Coward · · Score: 1

      Don't like it? Fork it!

      Or don't use it. It is not as if we were short of programming languages.

    2. Re:Duh by JustBoo · · Score: 5, Interesting

      Don't like it? Fork it!

      Or don't use it. It is not as if we were short of programming languages.

      Perhaps you guys are not aware that Swift is a language to program Apple DuH-vices. iPhones, iPads etcetera. There are NOT a lot of choices of languages when it comes to that.

      But I am glad Apple is not buying the Script Kiddies Crap and 'dumbing' down the language. Python is the last language on Earth anyone should be modeling a professional language on. The Last.

    3. Re:Duh by Richard_at_work · · Score: 1

      Ever since Apple was forced to drop the "apps must be originally written in ObjC" from the app store terms, you can write in whatever language you want.

    4. Re:Duh by Anonymous Coward · · Score: 1

      There are NOT a lot of choices of languages when it comes to that.

      Not true. In addition to Objective C and Swift you can program for iOS in, for example, Object Pascal or C++ or C# or JavaScript.

    5. Re:Duh by JustBoo · · Score: 1

      There are NOT a lot of choices of languages when it comes to that.

      Not true. In addition to Objective C and Swift you can program for iOS in, for example, Object Pascal or C++ or C# or JavaScript.

      Not true indeed. You and I have a huge difference in what "a lot" means. A lot of difference.

    6. Re:Duh by Anonymous Coward · · Score: 4, Informative

      Object Pascal and C++ and C# and JavaScript to name a few. You can program for iOS using any language which provides you with a toolchain to target iOS.

    7. Re:Duh by JustBoo · · Score: 1

      We're walking... we're walking... and here we are. On display, boys and girls is, "The Product Hipster." They worship products like our ancestors worshiped deities of olde. And this is were the phrase: "Those who believe in nothing will believe in anything" comes from.

      Now, onto the Giant Academic Sloth of Slowness. And we're walking... we're walking....

    8. Re:Duh by interval1066 · · Score: 1

      No. PHP is the last, python second to last.

      --
      Python: 'And then suddenly you have a language which says "we're all stuck with whatever the whiniest coder wants".'
    9. Re:Duh by interval1066 · · Score: 2

      C++ isn't a toy language.

      --
      Python: 'And then suddenly you have a language which says "we're all stuck with whatever the whiniest coder wants".'
    10. Re:Duh by JustBoo · · Score: 1

      Your fractured answer is cut and pasted from some other thread. It doesn't even fit. But you hear that A LOT don't you.

      Gee you must be French, declaring victory when there was NONE. Part of being a hipster is living in a fantasy world, of which you so clearly occupy. You are entertaining, in that Court Jester kind of way. Keep believing baby 'cos even a broken clock is right twice a day.

    11. Re:Duh by Notabadguy · · Score: 2

      Ahahahaha....C++ and C# are toy languages, and you're going to call HIM a kiddo? Listen sonny, back in my day we had punch cards.

    12. Re:Duh by Pseudonym · · Score: 1

      But I am glad Apple is not buying the Script Kiddies Crap and 'dumbing' down the language.

      Swift is a dumbed-down Objective-C. No, that's not a complaint.

      Python is the last language on Earth anyone should be modeling a professional language on. The Last.

      Can't argue with that. Of course, indentation-based syntax is the least of Python's problems. It was fine in Occam and it's great in Haskell, but it would ruin Swift.

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
    13. Re:Duh by Pseudonym · · Score: 1

      Oh, BTW, when you rewrite it in another language be sure to take full advantage of automatic tools to find basic mistakes you may make.

      If by that you mean a static type system, then yes. It helps find the mistakes that the typical Python programmer made, too.

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
    14. Re:Duh by Guy+Harris · · Score: 1

      Listen sonny, back in my day we had punch cards.

      Let's consult the TIOBE Index for December 2015. Hrm, nope. Punch cards don't figure in the top 50 languages. Too bad. Your day is done.

      "Punch cards" probably isn't considered a programming language by the TIOBE folks, and, as far as I'm concerned, they're right not to do so, just it's proper for them not to consider "paper tape" and "text file" as programming languages.

      Two languages that date back to the days of punched cards, and that were often input on punched cards, however, are in the top 25 languages - COBOL at 20 and Fortran at 22 - and RPG, another such language, is at 37.

    15. Re:Duh by teg · · Score: 1

      No. PHP is the last, python second to last.

      And you leave out Perl and APL?

    16. Re:Duh by rochrist · · Score: 1

      I'm holding out for SNOBOL.

    17. Re:Duh by Anonymous Coward · · Score: 1

      sucks when you forget to tick the 'post anonymously' box

    18. Re:Duh by david_thornley · · Score: 1

      How about FORTH?

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    19. Re:Duh by rochrist · · Score: 1

      C'mon. I get WAY more points for SNOBOL!

    20. Re:Duh by david_thornley · · Score: 1

      Yeah, but I got nostalgic. (I actually wrote a SNOBOL program once. Wonderful text handling, really sucky control structures.)

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    21. Re:Duh by MachineShedFred · · Score: 1

      C++ is a toy language. That's a new one.

      --
      Slashdot still doesnâ(TM)t support Unicode after it was added to the HTML standard in 1997.
    22. Re:Duh by interval1066 · · Score: 1

      Hey, I kind of like Perl. I kind of get it for some reason. Its like BASH on steroids with even MORE goofier syntax thrown in. You can't beat it if you like regular expressions. You just use 'em, no "regex compiler" api.

      --
      Python: 'And then suddenly you have a language which says "we're all stuck with whatever the whiniest coder wants".'
    23. Re:Duh by interval1066 · · Score: 1

      Did iAppel decide Objective C was lacking? Not that its a gem of a language, but isn't all their shit written in it? And what's this fucking trend toward VM's and "just-in-time" languages? Its as if the whole software world suddenly went mad and decided EVERYTHING is easier by use of virtual machines and interpreted script-like languages. Madness. Want to squirt out an entire website with one command? Plop, their your RoR app. Want it on an embedded device? Woops... problem.

      --
      Python: 'And then suddenly you have a language which says "we're all stuck with whatever the whiniest coder wants".'
    24. Re:Duh by JustBoo · · Score: 1

      I hear ya'. I currently write software for large multi-server real-time systems. We noticed a huge performance drop. Loooong story short. The hardware systems guys had over 20 VMs running on a single server. Oh... my... gawd. They actually believed the total bull-crap that VMs run free with little over head.

      It makes me sad my profession, once 'ran' on engineering principles, but has now been turned into a Religion by Script Kiddies working for Facebomb, Googler and Twits-a-plenty.

    25. Re:Duh by interval1066 · · Score: 1

      How can you be a "hardware guy" on not know that running multiple vm's might have incur a performance hit on your server? After you keep stackin' 'em on at certain point you're gonna hit a problem. As for my little story; it become obvious to me that the jokers who wrote that RoR app were one note ponies; if it couldn't be done using Ruby on Rails it wasn't worth doing. I re-wrote the app in C++ including a dandy little c++ web services lib I found and fix it easily.

      --
      Python: 'And then suddenly you have a language which says "we're all stuck with whatever the whiniest coder wants".'
  2. People actually *like* Python whitespace? by Anonymous Coward · · Score: 5, Insightful

    Swift's developers don't want to replace Brace Syntax with Python-style indentation.

    I am appalled that enough people like the idea of significant whitespace in Python to actually ask for it as a feature.

    1. Re:People actually *like* Python whitespace? by mveloso · · Score: 5, Insightful

      Yeah, it's crazy. "Let's make some invisible character with a variable width significant."

    2. Re: People actually *like* Python whitespace? by BitZtream · · Score: 4, Insightful

      If you're using variable-width fonts for coding, you're doing it wrong.

      Also, in Python you indent the same way you should be doing anyway, just without the braces. Unless, of course, you're also doing indentation wrong.

      You're right, designing a language the fucks up based on different text editor default preferences makes the users that are complaining about that design decision wrong ...

      Please explain the advantage of white space sensitivity without sounding like a moron, go:

      --
      Persistent Volume manager for Kubernetes - https://github.com/dwimsey/openshift-pvmanager
    3. Re: People actually *like* Python whitespace? by mveloso · · Score: 2

      Yeah, because whitespace never gets changed by stuff inadvertently.

    4. Re: People actually *like* Python whitespace? by Anonymous Coward · · Score: 5, Insightful

      because when i'm moving blocks around, whitespace changes turn my original program into a
      perfectly valid other program which has nothing to do with my original intent ..umm.wait...

    5. Re: People actually *like* Python whitespace? by JustBoo · · Score: 1

      If you're using variable-width fonts for coding, you're doing it wrong.

      Also, in Python you indent the same way you should be doing anyway, just without the braces. Unless, of course, you're also doing indentation wrong.

      You're right, designing a language the fucks up based on different text editor default preferences makes the users that are complaining about that design decision wrong ...

      Please explain the advantage of white space sensitivity without sounding like a moron, go:

      And the absolute stone-cold irony is position dependent languages were tried and rejected by professional programmers in the eighties. Back when one had to have a functioning brain to program.

      Now we have script-kiddies who know exactly one "language" and have decided their way is the only way. According to these dolts, diversity is dead, (just like in universities). And as one can see from the comment above, everyone but them are "doing it wrong."

      And strangely software just keeps getting and more and more crappy. Huh.

    6. Re: People actually *like* Python whitespace? by TheRaven64 · · Score: 4, Interesting

      I'd object to it a lot less if it would either do the sensible thing and treat one tabulator as one indent level and erroring at parse time if a line contained any spaces before the first non-space character, or the slightly less sensible thing of treating n spaces as one indent level and erroring if the line contained any tabs before the first non-whitespace character. Allowing tabs and spaces to be mixed at the start of a line so that your code may look correct but is interpreted differently is annoying and is one of the many reasons why the only times I've ever written Python have been when I've fixed someone else's 'working' and shipped code. It's even worse than the semantics of else clauses on for loops for introducing subtle bugs.

      --
      I am TheRaven on Soylent News
    7. Re: People actually *like* Python whitespace? by Grant_Watson · · Score: 1, Informative

      Indentation is how you communicate block structure to a human reader. You're going to indent your code anyway, and eliminating the extra delimiters prevents the structure humans see from getting out of sync with the structure the language implementation sees. There's a perennial C logic bug where you take an if statement with a one-line body and add a second line without adding braces to denote a block; that never happens in Python.

      That said, I'm happy with either syntax.

    8. Re:People actually *like* Python whitespace? by Actually,+I+do+RTFA · · Score: 1

      I don't know. This, along with returning -tuples, are the two features of Python I like. Intellectually, it's the exact same as how I otherwise write code, just without the extra keystrokes. It still looks strange to me, but... I get the efficiency.

      --
      Your ad here. Ask me how!
    9. Re: People actually *like* Python whitespace? by Richard_at_work · · Score: 1, Insightful

      If you accidentally get whitespace stripped out for some reason, a language which doesnt rely on whitespace would still function as expected.

    10. Re:People actually *like* Python whitespace? by radarskiy · · Score: 1

      Why do you hate Makefiles?

    11. Re: People actually *like* Python whitespace? by igloo-x · · Score: 2, Insightful

      If any part of your workflow unexpectedly strips out whitespace "for some reason", you've got bigger problems.

    12. Re: People actually *like* Python whitespace? by guruevi · · Score: 1

      It's cleaner until you get to a sufficiently complex program and that makes indentation so much harder to read because you're exceeding the width of your terminal.

      I've worked with Python in an unstructured contributor paradigm. I started having bad dreams about the compiler complaining and failing to run because my indentation was not uniform across the entire code base and I had to go fix it (you can use spaces or tabs but not both and no different ways on the number of spaces either even though they appear visually and for all intents and purposes even Python-logic-wise the same, an indent is an indent, deal with it).

      --
      Custom electronics and digital signage for your business: www.evcircuits.com
    13. Re: People actually *like* Python whitespace? by Anonymous Coward · · Score: 1

      Ding! So you've never used source control then. Kind of says it all.

      I pity the Academic Script Kiddies the most. They have all these Sand-Castles built in the sky... and they will never be able to live in them.

    14. Re: People actually *like* Python whitespace? by Anonymous Coward · · Score: 5, Informative

      You're right, designing a language the fucks up based on different text editor default preferences makes the users that are complaining about that design decision wrong ...

      Please explain the advantage of white space sensitivity without sounding like a moron, go:

      The advantage of white space sensitivity is that it reduces the visual noise when producing and reading source code, and it helps build in a consistent look and feel for the language. For instance with F#, the designers are using white space sensitivity to remove a large amount of boiler plate syntax, which makes for a much more concise language. Conciseness is very important because you can fit complex data manipulations into small blocks of very readable code, which is the core of the design team's tenant of "Do more with less code".

      If you want to avoid, indentation errors you use the begin ... end blocks, but for most functions and types they are quite unnecessary. If you want to compress multiple assignments on a single line, use the let ... in ... syntax. F# also makes \t illegal when white space sensitive code is in use. With proper language design, white space sensitivity is a productivity advantage, and it does not sacrifice program readability.

      Does this mean that white space sensitivity is outright superior to visual token semantic block delimiters? No of course not, it does mean that there is a trade-off space for the feature within the language's design so some languages are designed better than others.

      There is also a trade-off space for using text editors instead of IDEs for programming. Sure you can stick to your favorite text editor, but you lose a large amount of useful information and features that IDEs that understand your programming language will give you, and since text editors are text editors and not program editors, they are completely correct when they display whitespace in semantically incorrect representations of the programming language.

      Some whitespace sensitive languages like Python have warts when you use a language unaware text editor because Python's design considerations did not standardize and enforce in the interpreter how to use whitespace from different text editors. However, if you are using a text editor for programming, you are in a sense "doing it wrong" for many programming languages. Maybe you are fine with your current language, but if you are going to try a different language you should use the appropriate tools for that language. Use the right tools for the job. You wouldn't try to cut a 2 by 4 plank with a jeweler's saw would you? If not, do not use a text editor that is Python agnostic to edit Python code. It is really that simple. If you are collaboratively creating Python programs with others, adopt PEP-8.

    15. Re:People actually *like* Python whitespace? by Anonymous Coward · · Score: 2, Interesting

      I do most work in python know, though for most of my life I used C and C++. Python and Emacs just lets me complete some quick and dirty tasks.

      If I had to do actual work in Python, it would be annoying. There have been many times when the indention protocol created errors that were difficult to fix. The brackets in C, the operators, make a lot of sense for professional code.

    16. Re: People actually *like* Python whitespace? by Anonymous Coward · · Score: 2, Interesting

      It has happened when you use --ignore-whitespaces when merging with git.
      Most of the code in the repository isn't Python and the Python code was part of something that wasn't run often, so we didn't notice the bad indentation from ignoreing the whitespace during the merge.

    17. Re: People actually *like* Python whitespace? by TheGratefulNet · · Score: 5, Insightful

      100% this!

      twice in the first few months of my learning python, I saw someone post code on a web forum that was impossible to know what the intent was; because the spacing was messed up (web forums do this all the time) and this, alone, proved to me how stupid this braceless style of space-sensitive indenting was.

      there are 2 things and they should NOT be combined! one is for the compiler to define what a block is. the other is documentation for humans, so we know what the block is.

      and yes, they do act differently. I can use white space to tell a HUMAN things but white space is quite a stupid way to talk to a computer.

      there's a lot I like about python, but guido is just plain wrong, here, and its frustrating that he won't admit it.

      --

      --
      "It is now safe to switch off your computer."
    18. Re:People actually *like* Python whitespace? by GlobalEcho · · Score: 1

      I find that Python is attractive, and works extremely well, for people well-suited to information-dense representation of ideas. This includes physicists, mathematicians and other folks who are used to that property of the hard sciences literature. For software architects and developers, its attractiveness is more if a mixed bag, where many of those folks are more comfortable and productive with a greater amount of structure.

    19. Re: People actually *like* Python whitespace? by Fwipp · · Score: 1

      You know that coffescript gets compiled to JavaScript, right? Like, you didn't think that browsers executed coffeescript natively, I'm sure you wouldn't have commented if you were that clueless.

    20. Re: People actually *like* Python whitespace? by benlwilson · · Score: 1

      The solution is simple,
      Build the compiler to handle many different syntax options based on settings and enforce standards that make all formats logically convertible.
      All possible syntax options MUST! be convertible between all other formats programmatically with no user interaction or checking required.

      A programmer should be able to sit down, change some compiler settings and be editing existing coding in the format they prefer and still able to commit to the same repo as others use.
      Perhaps the compiler could generate a 'standard syntax' copy of the source code for the repo at compile time.

      As long as the rules for each syntax option correlate 1:1 conversion is simple
      etc
      || or
      { begin
      tab intended should be convertible without issues
      return result

      The only thing that would need to be handle carefully is preventing people using words that are keywords in other syntax options.
      etc, if you're using || you cant have a variable named and

      So adding new syntax options to existing code would be tricky.
      But i believe the overall concept is a step in the right direction. Where syntax does not matter, only the logic

    21. Re:People actually *like* Python whitespace? by statusbar · · Score: 1

      Yeah, it's crazy. "Let's make some invisible character with a variable width significant."

      Like Makefiles do?

      --
      ipv6 is my vpn
    22. Re: People actually *like* Python whitespace? by Anonymous Coward · · Score: 1

      The advantage of white space sensitivity is that it reduces the visual noise

      I find myself enabling white space highlighting all the time while debugging existing Python 2.6 code, fuck invisible errors and whomever thought it would be a great idea to interpret a mixture of space and tab chars as valid indentation ( optionally fixed in 2.7 if you beg the runtime for validation and finally fixed in 3 - will see the later sometime after 2020). Also fuck maintaining a python script when working on a team of non python developers, each and every one with their own editor settings.

      TL;DR: Visible "noise" is preferable to pythons invisible bugs and errors.

    23. Re: People actually *like* Python whitespace? by tepples · · Score: 3, Informative

      In a language that uses braces (whether { ... } or begin ... end), a tool such as GNU indent restores readability to code whose leading space has been mangled by (say) your discussion software. This is not true of Python.

    24. Re:People actually *like* Python whitespace? by SuperKendall · · Score: 3, Insightful

      Why do you think people didn't hate that aspect of Makefiles the same reason. Especially bad there as it used to be the case it HAD to be a tab, not a space, and if your editor had been configured to convert tabs to spaces BOOM, dead Makefile.

      --
      "There is more worth loving than we have strength to love." - Brian Jay Stanley
    25. Re:People actually *like* Python whitespace? by Anonymous Coward · · Score: 1

      I hated makefiles for the whole tab issue long before Python came to be. Have you ever had the pleasure of dealing with makefiles in dos' old editor, for example? Not. Fun.

    26. Re:People actually *like* Python whitespace? by fahrbot-bot · · Score: 2

      Why do you think people didn't hate that aspect of Makefiles the same reason. Especially bad there as it used to be the case it HAD to be a tab, not a space, and if your editor had been configured to convert tabs to spaces BOOM, dead Makefile.

      Or cut/copy and paste in X Windows where tabs get converted into spaces.

      --
      It must have been something you assimilated. . . .
    27. Re:People actually *like* Python whitespace? by mrun4982 · · Score: 2

      Yea, I'm always amazed when I read/hear people who actually like Python's use of whitespace. It's by far my biggest complaint about the language and a big reason why I don't use it. I can't count the number of times somebody messed up whitespace, mixed tabs/spaces, etc in other code and those changes would have broken python code.

    28. Re: People actually *like* Python whitespace? by Ksevio · · Score: 2

      If you accidentally get curly brackets and semi-colons stripped out your C program probably won't work as expected though

    29. Re: People actually *like* Python whitespace? by snizzitch · · Score: 1

      The advantages I see are 1. Fewer keystrokes: An obvious benefit, but perhaps better than one might think if, like me, you mis-key what you're intending to type, every 10th curly brace or so and have to spend a few extra moments wrestling with repositioning things and 2. Fitting more code on the screen feels like it gives me a small, but not insignificant, mental boost, by increasing the likelihood that I can see related bits of code without having to scroll to find them. I worked as a professional C# developer (with curly braces) for about 7 years before starting to code all personal projects in F#, and have used Python in numerous continuing education courses, and I immediately preferred significant white-spacing, but it's probably just a personal preference. I've never even thought of the potential for increased software defects, so I don't think that would be a likely issue for me. I'm certain that the type system in F# all but eliminates the chance that you'd get a code block out of place and still have your software compile. Perhaps that would be a more likely problem with Python, but still not one that I've encountered. I try to adhere to the "Make your methods (or, functions) small, then make them smaller than that" school of clean code which might be a part of the reason why I've not run into indentation problems. I've also not tried integrating with a team which has used different code editors with potentially different whitespacing configurations, but that doesn't sound difficult to overcome. The biggest problem I've probably ever had that is at all closely related to this conversation was maintaining old Delphi/Pascal code, which as I recall did not have significant whitespace ('begin" and "end" I believe, blech), but also the coding environment lacked a feature to automatically fix code indentation, and some of the monster methods in the legacy code that I was maintaining was nigh unreadable due to horribly mis-aligned indentation. I would never advocate for adding significant whitespacing to an existing language.

    30. Re: People actually *like* Python whitespace? by snizzitch · · Score: 1

      The irony of Slashdot not preserving the whitespace between my paragraphs here is not lost on me.

    31. Re: People actually *like* Python whitespace? by NostalgiaForInfinity · · Score: 4, Funny

      Please explain the advantage of white space sensitivity without sounding like a moron, go:

      if (flag)
          if (other_flag) do_this();
      else
          do_that();

    32. Re: People actually *like* Python whitespace? by NostalgiaForInfinity · · Score: 1

      I should say that I really don't care much either way about significant white space in Python: it really doesn't seem to make a big difference in practice either way.

    33. Re: People actually *like* Python whitespace? by Pseudonym · · Score: 1

      That's only true of an operator language, which most languages are not. Stripping whitespace turns struct foo into structfoo, which doesn't mean the same thing. Maybe you could do it with AP/L?

      Having said that, I've been Haskell programming for over 20 years, and I don't recall this ever happening once.

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
    34. Re: People actually *like* Python whitespace? by cerberusss · · Score: 4, Informative

      For this reason, your editor should have a setting that visually displays tabs. Put the following line in your ~/.vimrc if you use that. It also shows trailing spaces.

      set listchars=tab:.\ ,trail:-

      Just posting to add this tip. I totally agree with you, that the above situation should be an error condition.

      --
      8 of 13 people found this answer helpful. Did you?
    35. Re: People actually *like* Python whitespace? by Anonymous Coward · · Score: 1

      There's a perennial C logic bug where you take an if statement with a one-line body and add a second line without adding braces to denote a block; that never happens in Python.

      You have got to be kidding. This frequently happens in Python, because either you get "intelligent" auto-indent which makes something you wanted outside the block happen inside the block if you're not careful, or you have to manually set the indentation to be correct for each line. Then there's the problem of copy-pasting code from emails or web forums, which completely messes up code if your spacing convention is different from the pastee's.

    36. Re:People actually *like* Python whitespace? by serviscope_minor · · Score: 2

      Or cut/copy and paste in X Windows where tabs get converted into spaces.

      No they don't. This is very simply not true. If you like, I could go into an arbitrarily detailed explanation of how the copy/paste system works in X11 (and DnD---they're the same mechanism and they also follow a reasonably sensible design). I can happily copy/paste text between my browser and editors all day without tabs and spaces getting mixed up.

      To repeat: There is absolutely *no* replacement of tabs with spaces in X11 itself. If your program is doing this and you don't like it, then find a program that doesn't. Please don't engage in the sport of blaming X11 for things that have nothing to do with it.

      In character cell renderers (e.g. xterm), which take a sequence of characters and render the results with significant interpretation, tabs often get rendered as a sequence of spaces. Some terminals (gnome-terminal does) do the bookkeeping required to remember which spaces came from a tab. To see why it's hard, imagine what the output should be for the sequence '\t\bHello, world'. Or a more complex example:
      '\tHello\r ' or '\tHello\x1b[A\r\x1b[C\x1b[C\x1b[C\x1b[B '.

      Clearly it's possible (I can think how to do it), but I doubt you can do it without overhead. gnome-terminal is one of the slowest, and I doubt that's a coincidence. But unless you regularly dump gigabytes of shit into the terminal and expect it to keep up, then it's perfectly servicable.

      --
      SJW n. One who posts facts.
    37. Re:People actually *like* Python whitespace? by serviscope_minor · · Score: 1

      Yes. Intensely aggravating.

      At least modern editors with syntax highlighting alleviate it a little by highlighting all leading spaces in bright red as errors. That doesn't make it a good idea though and I remember duelling with broken makefiles for that reason many times back in the day.

      --
      SJW n. One who posts facts.
    38. Re:People actually *like* Python whitespace? by Imbrondir · · Score: 1

      Subjective stuff I guess. Me on the other hand throws a sigh for every brace I have to write. Or even sometimes move to make another original authors program intent readable.

      Ive only ever encountered a problem with the whitespace when tabs are mixed with spaces. Which really was a major mistake to allow. But as long as its edited in an IDE, they all protect against using tabs for whitespace anyway these days.

    39. Re: People actually *like* Python whitespace? by Anonymous Coward · · Score: 1

      Indentation doesn't show the intent of the programmer, the braces do.

      If "intent" were what whitespace were for, then a tab that in the editor the programmer used being 2 spaces is equal to another programmer using two characters of "space", but different to the programmer using a tab of 3 spaces. So you now have to engode in the file the width of the tab character used in the editor preference.

      Or throw out all tabs, in which case, it no longer is what the programmer intended when they used a tab char, it's what the discard algorithm thought they meant.

    40. Re:People actually *like* Python whitespace? by Big+Hairy+Ian · · Score: 1

      Having read TFA I think the majority of requests can be summed up as "Please replace LOL with FFS"

      --

      Build a Man a Fire, and He'll Be Warm for a Day. Set a Man on Fire, and He'll Be Warm for the Rest of His Life.

    41. Re: People actually *like* Python whitespace? by Junta · · Score: 1

      Even if the font is fixed with, the width of a 'tab' is not universal. If your text editor says tabs are rendered as 4 spaces, and you mix in some spaces (may not be your fault, might have been someone else in the codebase, though continuous integration on python projects generally set up to reject tabs).

      It's not necesarrily a terrible idea, for for a project that's commonly interpreted as 'easier', the whitespace based grouping causes a lot of headaches. To say the headaches are worth the result and you'll get used to it is one thing, but to pretend it doesn't cause headaches is silly.

      --
      XML is like violence. If it doesn't solve the problem, use more.
    42. Re: People actually *like* Python whitespace? by Junta · · Score: 2

      The problem is that we can point and yell 'stupid' at whatever we want, but reality is that whitespace is mangled by a lot of things, so use of a language very sensitive to whitespace as a 'learning' language has some challenges. If I made a language that required vowels in the keywords to have umlauts, I could run around and say it's stupid that a lot of keyboards don't have keys for that built in, or I could admit that I made a choice that ignores that reality.

      That said, I've seen a lot of C/Java/etc code just get really really mangled because it still compiles and people get slack about whitespace because it doesn't matter. Then if you go in and indent it, some maintainers will get mad because they don't want 'ownership' of a line to change in annotation just because someone changed indentation. So there's some upside to being a pain in the ass about indentation to force the issue. Of course the same could be done with a style check in continuous integration, but that's extra work that a lot of folks would skip.

      --
      XML is like violence. If it doesn't solve the problem, use more.
    43. Re: People actually *like* Python whitespace? by Xyrus · · Score: 4, Informative

      You're right, designing a language the fucks up based on different text editor default preferences makes the users that are complaining about that design decision wrong ...

      Please explain the advantage of white space sensitivity without sounding like a moron, go:

      The advantage of white space sensitivity is that it reduces the visual noise when producing and reading source code, and it helps build in a consistent look and feel for the language.

      Replace all punctuation in written English by varying white space demarcations. You know, like replace a comma by two spaces, a period by three, and exclamation point by four, etc. Would that improve the language, or make it painful to read, format, etc.

      Or how about something a little more relevant. Math has all kinds of logical demarcations. How about just replacing the parentheses with white space? Does that make it concise and easier to read?

      The number one source of errors I (and many others I have worked with) have come across in my years of dealing with Python have come from white space errors. Using white space as a significant demarcation instead of just a visual cue in a language (or just to make it pretty/readable) is beyond stupid, as literally every person and every editor have different preferences and ways of handling white space. Even changing fonts can screw it up.

      I can cut and paste C, C++, Java, etc. code from anywhere to anywhere and have it be interpreted in exactly same way as it was intended. You CAN'T do this with Python because you have no idea what white space characters you're actually grabbing, nor do you know how your particular editor/OS/etc. will attempt to format it.

      This should be obvious. Don't use an invisible and variable set of characters as logical delimiters.

      --
      ~X~
    44. Re: People actually *like* Python whitespace? by Junta · · Score: 1

      For your own code, the white space code formatting sensitivity and other python 'features' are pretty much more annoyance than value. When you are subjected to it, it's annoying as all get out.

      The benefit comes when having to contend with someone *else's* code who has had to put up with it. So basically it's a big self inflicted aggravation for the greater good of collaboration.

      To me, the people who go all frothy at the mouth over python produce hard to read code in their language of choice. People who do not use python, but don't go bitchy when they have to deal with it tend to also write pretty readable code in their own language. The intent in python is simply to force the issue by making it hard for the interpreter to follow when it is also hard to follow for a human. This can be added to a project in any language that has central automated repository, but python just enforces it at the lowest level, no matter how lazy the coder/maintainer want to be about it.

      There are unfortunately downsides, but there are downsides everywhere. I have encountered confusing code in brace delimited blocks because indentation was screwed up (and while pre-emptively feeding every chunk of random code through an indent program is possible, it's not something that always comes to mind).

      --
      XML is like violence. If it doesn't solve the problem, use more.
    45. Re: People actually *like* Python whitespace? by faffod · · Score: 1

      If you're pasting a large enough block it is easy to miss one line and fail to indent it (or miss it in the copy). Now you have a bug, that may be extremely difficult to find. On the other hand, with curly braces, not only will you have a compile time error if you fat finger something, the editor also can automatically indent everything correctly - saving all sorts of productivity.

      Yes, it still is possible to make a mistake with copy/paste, trying to make something idiot prof will only result in better idiots. That said, I want my languages to compile time fail on as many errors as possible - those are the easiest bugs to fix.

    46. Re: People actually *like* Python whitespace? by faffod · · Score: 3, Interesting

      [...] There's a perennial C logic bug where you take an if statement with a one-line body and add a second line without adding braces to denote a block; that never happens in Python.

      This is why Swift explicitly does not allow for one line statements without curly braces.

      more generally speaking, the language tries to avoid things that lead to dumb mistakes, no default fall through on switch case statements, explicitly requiring every case in a switch to be accounted for, etc. Anytime you imply meaning you introduce the potential for had to find bugs - especially later in the code development cycle when someone adds seemingly innocent changes.

    47. Re: People actually *like* Python whitespace? by TheGratefulNet · · Score: 4, Interesting

      also, 100% this.

      I could care less what human-A did for his indenting, at least on C code. if the code works and compiles, I can FIX his indentation and not ruin a thing; only make it more readable.

      there is no concept of a re-indent or auto-indent (such as found in emacs, for example) for python. you can't do it. because as I posted before about this: there are 2 things and they should never be mixed. one is a cue to the compiler what a block is, and the other is a cue to the HUMAN what a block is. and combining them is what guido fucked up, on.

      in C, I can do whatever wild indenting I want and a re-indent can fix it so I can read it again. I got very used to that. code was ROBUST in this way, and humans can mess with the look of it without doing harm. if I move a block from some inline code to a nested routine, it always ALWAYS works. not so in python. in fact, I'm not even sure HOW to move a block from one level of indent to another with perfect safety. its just STUPID!!!! stupid beyond belief to those of us who have been writing code for decades (I'm mid 50's and have been doing software eng work since my teens).

      part of me wants to add a feature to the language so I can add braces back again, then preproc the source to remove it as a phase before running the code. I know it won't be accepted by anyone in my company but it would restore sanity to my own python projects, at least.

      imagine a source code control system where check-out gets you those braces, you do your edits and each time you save the file to local git or svn (etc) it removes the bad chars and makes it 'real python' again so you can run it. that way you kind of have it both ways and editing, at least, is now more safe.

      --

      --
      "It is now safe to switch off your computer."
    48. Re:People actually *like* Python whitespace? by fahrbot-bot · · Score: 1

      Perhaps this has been corrected in some X Windows servers or is a configurable item, but I distinctly remember it being so back in the day (I've been using X Windows since the beginning) and I *just* performed a test using Xming on Windows 7:

      copying: "xxx<tab>xxx" and it pasted as: "xxx<5 spaces>xxx"

      Output of "od -a" below:

      0000000 x x x ht x x x nl x x x sp sp sp sp sp
      0000020 x x x nl

      This doesn't have anything to do the applications like xterm or gnome-terminal, but the X Server itself.

      --
      It must have been something you assimilated. . . .
    49. Re:People actually *like* Python whitespace? by serviscope_minor · · Score: 1

      Perhaps this has been corrected in some X Windows servers or is a configurable item,

      No it isn't and no it never has been, because of the way X11 copy paste works. Essentially, one program asserts the selection (saying it's the owner). When you paste, the receiver looks up the owner of the selection, then sends a message:

      "Hey owner of the clipboard I'm interested in, what datatypes do you support"

      "I support X, Y Z [optionally more than fit in this message, in which case look here (specified as WindowID+property name]"

      "OK, I want type Y. Please dump it in this location (specified as window ID+property name)"

      * selection owner dumps blob of opaque bytes in specified location (more later)

      There's no mechanism or spec for the server to intervene. If your tabs are becoming spaces, the fault lies with either the application receiving the data or the application sending it, almost certainly the latter.

      This doesn't have anything to do the applications like xterm or gnome-terminal, but the X Server itself.

      No, you are mistaken. If you print hello to xterm, it translates the to spaces. From that point on, it has no idea that those spaces came from a tab. Therefore when you copy it, xterm copies it as spaces.

      If you don't believe me, try this:

      echo -ne '\t' | xclip -i ; xclip -o | od -c

      You will see from od that xclip happily copies then pastes a tab.

      This doesn't have anything to do the applications like xterm or gnome-terminal, but the X Server itself.

      You are mistaken. More information:

      In the description I gave above, the data is dumped with XChangePoperty. This is a generic function for setting attributes of windows and is used for programs to communicate with one another. It's not specific to copy/paste and the XServer has no way of knowing that a specific XChangeProperty event is part of a copy/paste sequence, so it has no way of interposing and modifying the data. Not only that, the XServer has no idea what type the data (beyond whether it's 8, 16 o 32 bit) is since that's not held in the property and is negotiated as part of the exchange above. Also, data types are completely arbitrary and are represented by a string (well an Atom), and are usually MIME types these days, plus a few old X ones like TEXT.

      If you disbelieve me still, I invite you to play around with xprop and verify yourself that you can set window properties with tab characters in them and then read them back with no loss using xprop again.

      --
      SJW n. One who posts facts.
    50. Re:People actually *like* Python whitespace? by fahrbot-bot · · Score: 1

      The application was xterm. You make good points, but they suffer from my actual example showing tabs converted to spaces. Furthermore, I explicitly remember cases where copy/cut and paste in an xterm window, running an editor, like vi, messed up a Makefile when the tab was converted to spaces. Regardless the mechanism, it happened then and just now. (Dial down your autism and realize that you don't know everything.)

      Other than that, Happy New Year.

      --
      It must have been something you assimilated. . . .
    51. Re: People actually *like* Python whitespace? by BitZtream · · Score: 1

      Anyone who uses one line if statements in C/C++ shouldn't be writing code.

      That behavior will get you fired if we find it more than a few times in code reviews.

      No dev with any real experience uses if's without braces, that is one of the more stupid 'features' of C like languages and anyone who sees it instantly knows thats an bad pattern.

      Brackets are how I communicate structure. Indentation for structure just makes you stupid since my editor may use 2 or 4 spaces or tabs and you can't simply 'reindent' to match the editors style. Indentation is a

      that never happens in Python.

      Yes it does, I've seen it MANY MANY times because it doesn't cause an error in the script it causes different behavior. Its never caused a problem for you because you just haven't discovered it (or haven't written very much code). Just discovered a bug in a script last week that was due to someone having a line tabbed in too far and being considered part of the if when it wasn't and should have been executed every pass, instead, it happened only under a special case which rarely occurred ... end result, about 30k worth of items weren't billed and had to be corrected. Fortunately, 30k items is pretty trivial for us and no one was too pissed off but if you think it doesn't happen you're just utterly inexperienced.

      Python has made the choice to use indentation as part of its syntax to enforce a style. That was utterly fucking stupid, as is anyone who thinks otherwise. Its as stupid as people who don't understand why people prefer tabs versus spaces for indentation and in fact is the exact same sort of stupidity. Its a shithead way of some asshole enforcing his preference on everyone else.

      If the point was clean style, then it still would have required block delimiters and simple wouldn't execute if the indentation didn't match the block count ... but no, thats not what they did, they half assed it and resulted in a language thats used by people too stupid to find a good one.

      Again I state, you CAN NOT offer ONE valid reason why whitespace is a flow control.

      Let me help you and show you where its stupid:

      Copy and pasting code from some other location, have to figure out and fix the indentation ... or do you have some magical editor that can read your mind and fix the indentation automatically (You don't, even fi you think you do, again you just haven't found the bugs yet)

      Pasting code from python a multitude of websites results in an unusable mess of code because of so many that screw with formatting and trim spaces.

      One space versus 2 is difficult to see, but is a completely different meaning in python. Good luck working on any sort of large scale project with very many contributors, your choice in shitty language will cost you god knows how much time figuring out someones intention after someone screws up a merge but you can't see it because half is using tabs and the other half is using spaces.

      2 space 'tabs' in your editor is different than 'tab' in my editor (which uses tabs), and both are different than anyone who prefers 4 spaces or one ...

      GNU indent/astyle and other style fixes can not work on python, they can not infer what your intended logic is and magically fix it.

      The list is far longer, but I'm tired and this is a silly debate. If you like unreliable code, great! The rest of us can safely avoid python as its a big glaring 'I'm an idiot!' kind of language. People who think its great are either stupid or just don't know any better because someone told them it was great, the second is correctable, the first is a birth defect.

      --
      Persistent Volume manager for Kubernetes - https://github.com/dwimsey/openshift-pvmanager
    52. Re:People actually *like* Python whitespace? by serviscope_minor · · Score: 1

      Regardless the mechanism, it happened then and just now.

      Did I ever claim otherwise? I explained twice that it was xterm and not the xserver (which is what you claimed) doing the conversion. I even explained the mechanisms of how the server couldn't do it and why xterm (and most other, but not all terminals) did do it. I then showed you a command you could run to prove the xserver is more than capable of copying and pasting tabs. I gave you the name of a different X terminal program which doesn't have the bug. Yet you still persist in your claim that the server is at fault. I'm at a loss as to understanding why.

      Let me spell it out one more time:

      xterm converts tabs to spaces. Not X11. xterm. It's a program with a bug.

      (you know what, I bet the windows terminal does that too. Try running a text mode editor in cmd.exe and seeing if it will copy tabs as tabs)

      (Dial down your autism and realize that you don't know everything.)

      Oh I see, so instead of learning anything you just insult the person who gave a long, detailed explanation of how it works and why you were mistaken and what the quite subtle issues were when it comes to copying and pasting tabs from a terminal window (up to and including character sequences which made it difficult). I look forward to you spreading more misinformation about X11 in future.

      I'm not sure why people are so desperate to rag on X11. Sure it has flaws (a LOT) of them, but it gets blamed for the weirdest stuff. I think it's because people have blindly followed the "x11 sucks lol" meme. Therefore everything they see wrong they blame X for. Hey, and a whole bunch of stuff which isn't wrong too.

      --
      SJW n. One who posts facts.
    53. Re:People actually *like* Python whitespace? by fahrbot-bot · · Score: 1

      It's a program with a bug.

      Then it's a common bug, probably in an X library. Just to note that I was specifically talking about copy/paste using just the mouse, not explicit application commands, so I'm unsure as to the exact mechanism that supports the data transfer in *this* case. However, since xterm is an X11 client, then it technically is an X11 thing. It's not "misinformation" it's common perception based on practical experience. Quite simply, there are many cases were copy/paste in X Windows - or, using an X Windows client - converts tabs to spaces. Where/how it happens is irrelevant from a practical standpoint. It happens using X. It's not specifically weird, and, since it seems to happen a lot, I've always thought it was a design decision, not a bug.

      I'm not sure why people are so desperate to rag on X11.

      I'm not ragging on X11 and don't think it sucks. I love X Windows and have since I had to compile the server and clients from scratch when it came out. I even wrote an intermediate X server (of sorts) when I worked for a small company back in the 1990s, that can sit between the X Server and any/multiple X Client/s and monitor, trap, trace, control, record and playback the X protocol traffic (basically everything in the O'Reilly "X Protocol Reference Manual, Volume Zero", which I have on my shelf here at home) - it was called Concurrent X Control (CXC). And CXC itself could be controlled from an external application via stdin/stdout.

      Thanks for the discussion.

      --
      It must have been something you assimilated. . . .
    54. Re: People actually *like* Python whitespace? by mattventura · · Score: 1

      So, anyone who has contributed code to the Linux kernel?

    55. Re: People actually *like* Python whitespace? by mattventura · · Score: 1

      But that's the entire advantage of tabs. Everyone can set them up to display as the width they want to see. I like 3 space tabs, Alice likes 4, Bob likes 8. We can each set up our editors to our preferred width. Yes with a sufficiently advanced editor you could achieve the same with spaces, but that's needless complication.

    56. Re:People actually *like* Python whitespace? by serviscope_minor · · Score: 1

      Then it's a common bug,

      It's common to most terminals. I've never seen it anywhere else.

      probably in an X library.

      No, it's not a library bug. It's specific to an entire class of program because in that class (terminal emulators) it is difficult to keep track of where tabs come from. I know gnome-terminal takes the effort. I also know gnome terminal is one of the slowest terminals. I expect that is not a coincidence. Also, even gnome-terminal fails when programs use cursor positioning commands rather than tabs.

      If you believe otherwise, please find a single program that ISN'T a terminal emulator which has this bug.

      I was specifically talking about copy/paste using just the mouse, not explicit application commands, so I'm unsure as to the exact mechanism that supports the data transfer in *this* case.

      Interestingly, that's immaterial. X11 actually supports an arbitrarily large number of named clipboards. The common ones are PRIMARY (for the selection/click), CLIPBOARD (for explicit application commands) and XdndSelection. Once you have the clipboard name, the code to use it is identical. If you used explicit copy/paste commands in xterm (you can map then to keystrokes if you like), you'd find that the same bug manifests.

      However, since xterm is an X11 client, then it technically is an X11 thing.

      Since when does a bug in a few application programs count as a system bug? That's like claiming "Big Rigs Over the Road Racing" crashing is a Windows bug because that's a windows program.

      And on that note, why don't you complain about windows having the same bug? I invite you to try copy/pasting a tab from the windows terminal emulator. Let me know if it works. Try running vim in the windows terminal (I'm 99% sure that works with cygwin) and copying code. It doesn't work.

      It's not "misinformation" it's common perception based on practical experience.

      Common perception doesn't make it correct.

      Quite simply, there are many cases were copy/paste in X Windows - or, using an X Windows client - converts tabs to spaces.

      Where? Have you ever, ever, ever had a progam which isn't a terminal emulator do that?

      It happens using X.

      No it doesn't. It's happening precisely because you're not using X, I expect. What I think is happening is that you're using X to arrange a bunch of terminal widows then using a bunch of *terminal* programs not *X* programs. You'd have exactly the same problem on OSX[*] and Windows if you used nothing but terminal programs in the systems' terminals. Try using X programs instead.

      A precise equivalent of what you're complaining about is using a program which truncates lines to the terminal's width and complaining that the X11 can't copy/paste full lines.

      I'm not ragging on X11 and don't think it sucks.

      Well, that's great then. I love X too. But please, please if you love it then please don't spread misinformation about it. You're talking about at worst a "bug" in xterm, not a bug in X. What you're actually talking about it the interaction with naive character cell renderers and richer clipboards, which is the case on all platforms.

      The funny thing is though is everyone already knows about this and have provided xterm the ability to convert mouse actions into key events. This includes interaction with the clipboard. If you are failing to copy tabs from vin-in-xterm it's because you've not set vim up correctly., Type (from within vim) :set mouse=a

      Now vim can handle the copy/paste events itself and do it correctly, rather than hoping xterm will magically deduce what it means from a rendering on the screen of the document. I don't mean that lightly. By the time a terminal has rendered the character stream to the screen, all logical meaning has been lost. The application might know of the existence of tabs, but xterm cannot possibly know.

      I even wrote an intermediate X server (of sorts) when I work

      --
      SJW n. One who posts facts.
    57. Re: People actually *like* Python whitespace? by Junta · · Score: 1

      I agree, but 'the' definitive style guide for indentation said '4 spaces, no tabs'. I always thought the tab character made most sense for indicating code depth, with spaces for extending the tabs on a line continuation to align with whatever content it should align with. However it's more important that everyone be using the same thing than me getting my way, so I use spaces now.

      --
      XML is like violence. If it doesn't solve the problem, use more.
    58. Re: People actually *like* Python whitespace? by david_thornley · · Score: 1

      Yup. Of course, when the editor auto-indents the line properly, that's a clue that I messed up.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    59. Re: People actually *like* Python whitespace? by david_thornley · · Score: 1

      So, you're saying I should always use the IDE? Including times when I want to log in remotely from whatever machine is handy and make a quick change? Text editors are a whole lot more generally useful than IDEs, and modern ones (like vim and emacs) can handle the indentation just fine in most languages (although I'm not completely fond of emacs LISP formatting).

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    60. Re: People actually *like* Python whitespace? by david_thornley · · Score: 1

      That's what autoindent is for. I type in a C++ program, and the editor does the indenting. This means that, if I've typed an incorrect grouping, the indentation makes the problem obvious. Really, it's not like I do my own indentation any more.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    61. Re: People actually *like* Python whitespace? by david_thornley · · Score: 1

      In my experience, "'the' definitive style guide" means nothing without enforcement. Unless you have some way to enforce spaces (and the language does not), people are going to use tabs. This will often be missed on code reviews, since the nature of whitespace is not immediately obvious. This means that someone new to Python is going to check in something with tabs. It's possible that the VCS will reject it, in which case said programmer will substitute spaces for tabs, and that's a potential disaster if said programmer makes a mistake.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  3. The moral of the story is.... by Anonymous Coward · · Score: 2, Insightful

    People want to change a language they know little/nothing about, to be similar to one they know very well. Who are these people that are too busy for semicolons, brackets, and the differences between "default:" and "case _:"? Take a lesson from the C# guys and do what's best for the entire community, not a bunch of neckbeards that are too good for a semicolon.

  4. They're called architects by BitZtream · · Score: 5, Insightful

    The people who have their own ideas about how it should evolved are called architects, and they have their own opinion so that the language has some sort of coherency and isn't a complete and utter mess, which is what results when you do design committee.

    Nice inflammatory summary though, no bias.

    Swift's developers don't want to replace Brace Syntax with Python-style indentation.

    No shit, they aren't retarded. Have you people not learned how stupid that is yet, how many retarded bugs do you have to have from the wrong spacing before you get it through your heads that it was a stupid fucking idea?

    They don't want to change boolean operators from && and || to 'and' and 'or'.

    No shit, they aren't idiots.

    They don't want to rewrite the Swift compiler in Swift.

    No shit, they aren't retarded. Other than proving something, WHY WOULD YOU? NO ONE DOES THIS unless they are just trying to swing their dick around. You write your languages in C with ASM for the places it makes sense. Unless you just like to make yourself need two compilers, one to compile your language so you can build your compiler in your language. Again, retarded.

    They don't want to change certain keywords like 'continue' from their C precedents.

    No shit, they aren't idiots.

    And they have no interest in removing semicolons.

    No shit, they aren't idiots.

    If you had half a clue, or simply had read the second sentence under most of those things I wouldn't be the one pointing out that you're not qualified to be talking about language enhancements. Hell, as stated, almost all of these things are changes for someones personal pet preference, not because its useful for anything.

    Swift IS INTENTIONALLY C like, intentionally. ALL of those requests are utterly stupid when your talking about a language that is intentionally like C/C++. If you want python ... USE PYTHON.

    --
    Persistent Volume manager for Kubernetes - https://github.com/dwimsey/openshift-pvmanager
    1. Re:They're called architects by bill_mcgonigle · · Score: 4, Insightful

      Thank you.

      If I _had_ to write python, for some reason, I'd probably write a little pre-compiler to take something maintainable that I'd write and output whitespace-tokenized python.

      I don't see why the people who want Swift to be Python don't just write one of these of their own. They'd learn why nobody wants to use whitespace as a token separator but after that presumably they'd be happy in their mad little world writing code the way they want and finally compiling it with the Apple compiler.

      In the perl community we never told somebody they were crazy if they wanted to code perl in some insane, dead, or fictional, language -- just write a module for it and don't bother us with your dysfunction. What manager at Apple decided it would be a good idea to take feedback from the peanut gallery?

      --
      My God, it's Full of Source!
      OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
    2. Re:They're called architects by techno-vampire · · Score: 2, Informative

      You write your languages in C with ASM...

      I can easily remember when any language that couldn't compile its own compiler was considered a toy language. Clearly, times have changed, possibly for the better, possibly not.

      --
      Good, inexpensive web hosting
    3. Re:They're called architects by Forever+Wondering · · Score: 2

      If I _had_ to write python, for some reason, I'd probably write a little pre-compiler to take something maintainable that I'd write and output whitespace-tokenized python.

      Been there, done that. In perl ;-)

      --
      Like a good neighbor, fsck is there ...
    4. Re:They're called architects by Guy+Harris · · Score: 1

      You write your languages in C with ASM for the places it makes sense.

      The GCC developers aren't using only C any more, and LLVM is written in C++, as is clang.

      The low-level parts of language runtimes might be written in a mix of C and assembler, but that's another matter.

    5. Re:They're called architects by tepples · · Score: 2

      If you want python ... USE PYTHON.

      What should I use if I want all of Python except its slowness, GIL, and inability to detect typos until runtime when a NameError occurs?

    6. Re:They're called architects by dfghjk · · Score: 2

      "I've never had a bug caused by indentation changing the logic. Python code is usually succinct enough with small enough methods that things like that are immediately obvious."

      How would you know if you've never had one?

      It's sad when you contradict yourself in consecutive sentences. LOL

    7. Re:They're called architects by TheRaven64 · · Score: 4, Interesting

      The problem with this attitude is that compilers really should be written in a language that's good for writing compilers. This leaves you two choices:

      • Write your compiler in an inappropriate language.
      • Make your language good for writing compilers, at the expense of its intended uses.
      --
      I am TheRaven on Soylent News
    8. Re:They're called architects by Oligonicella · · Score: 2

      Which language was able to do it on the first pass?

    9. Re: They're called architects by Anonymous Coward · · Score: 1

      Well, because you can't write native ios apps in anything except Apple's approved garbage language.

      False. You could use Object Pascal or C++ or C# or JavaScript or any language which provides you with a toolchain to target iOS.

    10. Re:They're called architects by Kohath · · Score: 5, Insightful

      As a python programmer for 15 years, I've never had a bug caused by indentation changing the logic.

      "It's never been a problem for me" is not an argument in favor of anyone using it except you.

      "My plan/software/language has a zillion failure modes and hidden quirks, but I have them all memorized and they don't cause me problems. Let's roll this out to the general public."

    11. Re:They're called architects by pjt33 · · Score: 1

      I can't remember which open source project it was that I once tried to compile, but discovered that the README was correct when it said that it wouldn't compile with make. Instead I was instructed to use a make tool by the same author as the project I wanted to compile. So I downloaded the source for that make tool, and discovered that to compile it I needed a compiled version of the make tool. The bootstrap issue is not a problem for closed source projects where you'll always have the previous iteration's binary around, but if there's a remote possibility that in the future you'll want to open-source the compiler it becomes a serious issue.

    12. Re:They're called architects by vtcodger · · Score: 1

      > Swift IS INTENTIONALLY C like, intentionally. ALL of those requests are utterly stupid when your talking about a language that is intentionally like C/C++

      If C/C++ is truly the ultimate programming language, why change it in any way?

      --
      You can't see ANYTHING from a car, You've got to get out of the goddamned contraption and walk...Edward Abbey
    13. Re:They're called architects by srijon · · Score: 2

      They don't want to rewrite the Swift compiler in Swift.

      No shit, they aren't retarded. Other than proving something, WHY WOULD YOU? NO ONE DOES THIS unless they are just trying to swing their dick around. You write your languages in C with ASM for the places it makes sense.

      Actually there are loads of reasons to do this, and loads of languages do, including (from Wikipedia) compilers for BASIC, ALGOL, C, D, Pascal, PL/I, Factor, Haskell, Modula-2, Oberon, OCaml, Common Lisp, Scheme, Go, Java, Rust, Python, Scala, Nim, Eiffel, and more. One major reason for self-hosting the compiler is to support richer metaprogramming and tooling. Take a look at some of the posts on why Microsoft sunk years of effort into rewriting the C# compiler in C# (Roslyn). Ditto Perl 6 (Rakudo). The Swift folks recognize this, even if you don't. That is why this is the only one of the feature requests they say would be nice to do - they just have other priorities first. My bet is, down the line, as the language matures, they will reach a point where they are forced to rewrite the compiler in Swift.

      Nice inflammatory comment though, thoroughly researched.

    14. Re:They're called architects by jcr · · Score: 2

      I can easily remember when any language that couldn't compile its own compiler was considered a toy language.

      I remember that too, but it turns out that self-compilation is a parlor trick. We all have more important things to do than rewrite a compiler when one already exists that does the job.

      -jcr

      --
      The only title of honor that a tyrant can grant is "Enemy of the State."
    15. Re:They're called architects by Ksevio · · Score: 1

      If I _had_ to write python, for some reason, I'd probably write a little pre-compiler to take something maintainable that I'd write and output whitespace-tokenized python.

      Python is a tricky language for some people. New and versatile programmers seem to pick it up because it's makes logical sense and doesn't bog the programmer down with syntax. Older programmers more used to C/C++ tend to run into problems because they don't understand whitespace as syntax or don't have editors configured for it correctly. I wouldn't try to port the whitespace to another language, because it only works in python due to the simplicity of the syntax in genera. Trying to mix whitespace syntax with perl style syntax would be a disaster.

    16. Re:They're called architects by NostalgiaForInfinity · · Score: 2

      How would you know if you've never had one?

      Unit tests.

    17. Re:They're called architects by igloo-x · · Score: 1

      As a python programmer for 15 years, I've never had a bug caused by indentation changing the logic.

      I have. Once. Although I've only been programming in Python for about 8 years. It took me about 10 minutes to spot. I remember it so well because it was the first and only time I've made the mistake so far.

      I honestly find it astonishing that everyone is throwing their hands up like whitespace-for-flow-control is the single stupidest thing to happen in computing. I've written a shitload of code myself, hacked on plently of people's projects, copied and pasted tons from random forums, mailing lists and websites and I cannot for the life of me figure out how anyone with actual motor control and a sensible toolchain could have had the kind of problems that justify the prevailing attitude here.

    18. Re:They're called architects by BitZtream · · Score: 1

      or don't have editors configured for it correctly.

      And thats when you should have realized you were working with a shitty language and why whitespace for syntax is fucking stupid. The fact that you keep going is mind numbing.

      When a misconfigured editor can break your code or cause bugs, you've already lost before you started writing code.

      --
      Persistent Volume manager for Kubernetes - https://github.com/dwimsey/openshift-pvmanager
    19. Re:They're called architects by david_thornley · · Score: 1

      Python code is usually succinct enough with small enough methods

      In which case you're not working in my world. Some big blocks are not logically complex, but are because there's a lot of sequential things to do. Splitting these functions up to make them easier for Python to handle would make things much harder to read and maintain.

      There are cases where I get the indentation wrong, but the editor is happy to set me straight, because I rarely get the braces wrong, and, if I do the editor makes it obvious.

      Therefore, it sounds like you're saying that indentation-based grouping works better on more simple programs, which is good reason to think it's a bad idea in Swift.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    20. Re:They're called architects by fizzup · · Score: 1

      self-compilation is a parlor trick.

      Self-interpretation is a better one.

  5. So far so good! by mwk88 · · Score: 1

    Having read only the summary, I'm still happy to have an opinion: Swift maintainers, so far you show excellent judgement!

  6. Eminently Practical by SuperKendall · · Score: 5, Interesting

    The list and the explanations of why things were rejected really does a great job of illustrating why I like Swift - because the people behind the design have a great amount of practicality tempering the desire to include every modern language feature. It makes Swift nicer to work in, and in the long run will make it a LOT nicer to maintain.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
  7. Python by Dan+East · · Score: 3, Insightful

    Swift's developers don't want to replace Brace Syntax with Python-style indentation.

    Good, it seems Swift's developers aren't idiots.

    --
    Better known as 318230.
    1. Re:Python by cdwiegand · · Score: 4, Insightful

      It's called copy and pasting code. I don't want to have to worry about going over every line ensuring the indentation carried over and either adding or removing it to every line. If the language is brace-based, I can hit Format Document and it adjusts it. Without a delimiter like that, you can't "Format Document".

      --
      . Define sqrt(x) as something really evil like (x / rand()), and bury it deep. Watch your coworkers go nuts.
    2. Re:Python by JazzHarper · · Score: 4, Interesting

      In 1976, Stuart Feldman, the author of make(3) at Bell Labs, realized too late that using tab as a significant character (to distinguish recipes from rules) in makefiles was a Bad Idea. In an interview, he admitted, "And then a few weeks later I had a user population of about a dozen, most of them friends, and I didn’t want to screw up my embedded base. The rest, sadly, is history."

    3. Re: Python by guruevi · · Score: 1

      Yes, sometimes I copy and paste stuffs in my code especially while debugging. Python also bitches if you don't stay consistent with your indentation. Sometimes it just makes more sense to indent differently, especially when you're not soloing the project. Python is like PHP that way, good enough to script or make a not so complex program because a library warrants it but when you need others to do stuff with you, it becomes a gluttonous mess. And yes, a good project would have code style in agreement but that's usually not how things are done in the real world.

      --
      Custom electronics and digital signage for your business: www.evcircuits.com
  8. My suggestion by Waffle+Iron · · Score: 1

    I downloaded the new open-source swift release and played with it a bit. Overall, I think the core language definition is one of the nicest I've seen, with a good balance of features, performance and usability. The learning curve seems reasonable as well. The standard libraries need a huge amount of work (they lean too heavily on "bridging" in verbose cruft from old NextStep Objective-C code or using glibc C APIs with a bunch of unsafe pointer casts). However, I'm sure all that can be fixed over time.

    The one thing I find to be a glaring shortcoming in the core language is that strings are not indexable by integers. That really throws a wrench into the works, and burdens developers with a bunch of clumsy iterator handling for a large number of usage cases. I know they did that because they use UTF8 inside, but that's an implementation detail that should be hidden from the programmer. They already do magic copy-on-write for strings, so how hard could it be to switch to UTF32 under the hood if they detect the program is doing too many random accesses on a particular string?

  9. Re:Appel is EVIL by JustBoo · · Score: 1

    Yeah, the only problem with that is at the first error in your code the French Compiler would crash, erase itself completely and then send an email about how victorious it was. THen you'd have to reinstall it (9 hour process) to find out what really happened. Oui! Oui!

  10. Yet 'optionals' somehow made it through by JoeyRox · · Score: 2

    What?.Were?.They?.Thinking

    1. Re:Yet 'optionals' somehow made it through by Kjella · · Score: 2

      What?.Were?.They?.Thinking

      That dereferencing a null pointer is a very common programming mistake? You only need the optional syntax if your objects can be null, if your objects can be null you better make handle that situation. But in many cases people rely on some other business logic to always make it not null, which works great until somebody changes something and the code goes boom. This isn't so much a feature for writing code as it is for maintaining code.

      --
      Live today, because you never know what tomorrow brings
    2. Re:Yet 'optionals' somehow made it through by beelsebob · · Score: 1

      Why on earth would optionals be considered a bad thing? Not only having the compiler check that you don't ever make a null pointer dereference (probably the single most common type of bug that exists); but also extending that checking to any value that may or may not exist. What possible justification is there to not do that?

    3. Re:Yet 'optionals' somehow made it through by JoeyRox · · Score: 1

      Options are bad because they cause compiled code bloat and also lazy and messy constructs that overuse them.

    4. Re:Yet 'optionals' somehow made it through by beelsebob · · Score: 1

      You realise that swift optimises them away into use of a sentinel in pretty much all cases, right? (usually, actually a null pointer).

    5. Re:Yet 'optionals' somehow made it through by JoeyRox · · Score: 1

      It doesn't from the X86 (emulator) and ARM code I've analyzed, even with full optimizations enabled. Plus even at its most optimal the best it could do are a bunch of branch conditionals, which dirty up the branch-prediction cache.

    6. Re:Yet 'optionals' somehow made it through by beelsebob · · Score: 1

      Wait, are you suggesting that it should optimise out the checks?

      You seem to be missing the important bit of this... You *need* to check for those null pointers. You always did need to check for them before you had optionals making sure that you did. It's flat out a bug to not check. Saying "it's faster to not check" is irrelevant - checking is necessary for program correctness.

    7. Re:Yet 'optionals' somehow made it through by JoeyRox · · Score: 1

      Null/invalid values need to be checked but the problem with optionals is that they encourage multiple redundant inline checks vs more structured approaches that perform the check only once.

    8. Re:Yet 'optionals' somehow made it through by beelsebob · · Score: 1

      Uhhh, no, no they don't - they actually encourage exactly the opposite. They let the type system define exactly where the well-structured boundary between "I've not checked for null here" and "I have checked for null here" is.

    9. Re:Yet 'optionals' somehow made it through by JoeyRox · · Score: 1

      Yep, and it encourages repeating that check multiple times in the same construct vs just once. Putting a question mark in the language definition vs a nil/null check does not a well-structured boundary make.

    10. Re:Yet 'optionals' somehow made it through by beelsebob · · Score: 1

      Again, no. It encourages putting the check in exactly one well structured place:

      func f(x : Object?) { // We know that the check has not happened yet, x may be null
              guard let y = x else {
                      return;
              }

              g(y)
      }

      func g(x : Object) { // The lack of a ? documents that by this point we expect that the check must of happened. Not only that but it asks the compiler to enforce that it must have happened
              doShitWithX(x)
      }

      The type system enforces that a) we definitely do check, and b) that the person writing g, or doShitWithX does not need to check, because it's been documented (in a provable way) that the check has already happened by that point.

      There's no encouragement of multiple checks at all. Instead, there's encouragement that you make a single check, and then document explicitly where that check is, in a way that the compiler can verify.

      Not having optionals, instead encourages you to make multiple checks, as the author of g, or doShitWithX, will feel the need to assert preconditions in their functions, because they have no good way of informing their callers that they should never receive null.

    11. Re:Yet 'optionals' somehow made it through by JoeyRox · · Score: 1

      The only thing this optional construction adds is a redundant data member (used to track whether the optional is assigned or not), whereas a traditional null/nil check can use the original field value to make this determination.

      Regarding the multiple redundant checks that optionals encourage, those mostly come from optionals chaining.

    12. Re:Yet 'optionals' somehow made it through by beelsebob · · Score: 1

      I can buy that optional chaining (not optionals) encourages lots and lots of redundant null checking. That said, no more than obj-c, which already did redundant null checking on every single message send. Optional chaining effectively is an obj-c compatibility measure, to mimic it's "it's safe to send messages to nil" behaviour.

      Optional types rather point out that obj-c's behaviour was weird here, and that you should make your best effort to prove to the compiler that something really isn't null before sending messages to it.

  11. Channels that apply line.strip() for line in msg by tepples · · Score: 4, Interesting

    Also, in Python you indent the same way you should be doing anyway, just without the braces. Unless, of course, you're also doing indentation wrong.

    Several channels through which people discuss program code strip leading and trailing whitespace on each line. This transforms all programs passed through them into programs that are "doing indentation wrong." Yes, in theory, these channels are defective. Yet people work around these defects using tools such as GNU indent because a defective channel gets work done better than no channel at all.

  12. try the same for C and C++, see how it goes by darthsilun · · Score: 1

    ...don't want to replace Brace Syntax with Python-style indentation. They don't want to change boolean operators from && and || to 'and' and 'or'.

    etc.

    Why did they think Swift would be any different?

    1. Re:try the same for C and C++, see how it goes by serviscope_minor · · Score: 1

      try the same for C and C++, see how it goes

      Fun fact: C++ supports and, or and not as operators as well as && || and !. They're synonyms so you can't separately overload operator&& and "and".

      --
      SJW n. One who posts facts.
  13. UTF-32 does not hold a grapheme cluster by tepples · · Score: 1

    They already do magic copy-on-write for strings, so how hard could it be to switch to UTF32 under the hood if they detect the program is doing too many random accesses on a particular string?

    Because a single grapheme cluster in Unicode does not fit into a single UTF-32 code unit. If you don't understand the importance of grapheme clusters, try searching this essay for the word "cluster".

    1. Re:UTF-32 does not hold a grapheme cluster by PhrostyMcByte · · Score: 3, Insightful

      Because a single grapheme cluster in Unicode does not fit into a single UTF-32 code unit. If you don't understand the importance of grapheme clusters, try searching this essay for the word "cluster".

      To have the Character type represent a full grapheme cluster is... odd.

      99% of apps do nothing more than concatenate strings before passing them to some other API. These apps do not need to care about encoding or higher concepts like grapheme clusters. Asking every app to care about them is a major violation of the 80/20 rule.

    2. Re:UTF-32 does not hold a grapheme cluster by Waffle+Iron · · Score: 1

      Let those who few people who care about grapheme clusters use the existing clumsy API. That doesn't mean that the UnicodeScalarView shouldn't be indexable the way it's done in most every other language.

    3. Re:UTF-32 does not hold a grapheme cluster by Hognoxious · · Score: 2

      "Because Unicode" is used to justify all manner of things.

      And it's always wrong.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    4. Re:UTF-32 does not hold a grapheme cluster by tepples · · Score: 1

      Let's say you want to exclude all arguments of the form "Because Unicode". In that case, I'm curious as to how you define a "character".

    5. Re:UTF-32 does not hold a grapheme cluster by tepples · · Score: 1

      What can be done, programmatically, with a single code point? Or how is it useful to, say, take a substring that includes the accent (without the letter) of its first character and the letter (without the accent) of its last character?

    6. Re:UTF-32 does not hold a grapheme cluster by Waffle+Iron · · Score: 1

      What can be done, programmatically, with a single code point?

      Plenty. There are many uses of strings that have nothing to do with human language, and a programming language should not make those uses either hard to use or inefficient. In particular, you shouldn't define the character primitive to be functionally equivalent to a substring of unbounded length. That's both hard to use and inefficient.

    7. Re:UTF-32 does not hold a grapheme cluster by dissy · · Score: 1

      In particular, you shouldn't define the character primitive to be functionally equivalent to a substring of unbounded length.

      Do your strings hang low? Do they wobble to and fro?
      Can you cast them as an int? Can you cast them as a float?
      Do you constantly manipulate em, with that null string terminator?
      Do your strings hang low?

      Be sure to tip your unbounded length strings, we'll be here all night.

    8. Re:UTF-32 does not hold a grapheme cluster by NostalgiaForInfinity · · Score: 1

      Because a single grapheme cluster in Unicode does not fit into a single UTF-32 code unit. If you don't understand the importance of grapheme clusters, try searching this essay [utf8everywhere.org] for the word "cluster".

      Allowing strings to be indexed by codepoints does not interfere with providing iterators that iterator over grapheme clusters. The absence of such indexing, however, precludes the easy porting of a lot of existing algorithms that are written in terms of codepoints.

    9. Re:UTF-32 does not hold a grapheme cluster by NostalgiaForInfinity · · Score: 1

      What can be done, programmatically, with a single code point?

      Pretty much all Unicode processing algorithms are expressed in terms of code points. So, quite a lot can be done with them.

    10. Re:UTF-32 does not hold a grapheme cluster by tepples · · Score: 1

      Do "a lot of existing algorithms that are written in terms of codepoints" require random access, or can they be run over a UnicodeScalarView that produces code points in linear order?

    11. Re:UTF-32 does not hold a grapheme cluster by Hognoxious · · Score: 1

      One byte, to be interpreted as per ISO/IEC 8859-1.

      It was good enough for Homer, Jesus Christ and Shakespeare. So unless you're writing something überspecial It's good enough for you.

      If you want to scribble goddam pictures, use a png.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  14. Re:Rust has made Swift obsolete already. by Anubis+IV · · Score: 5, Insightful

    [Rust] is the successor to Swift, and is an improvement in every way.

    By definition, how can Rust be a successor to Swift, when Swift wasn't even announced until 2 years after Rust's first release?

    I don't have a horse in this race, but statements like that one I quoted make it fairly evident that your comments carry a heavy slant. Moreover, given the pedigree of both Rust and Swift, it seems like a pretty bold claim to suggest that either one could be "an improvement in every way" over the other. That's made even more true by the fact that both are in active development with lots of changes happening and that both of them are borrowing the best ideas from the other.

    Choose the language that suits your task and platform best, whether that's Rust, Swift, Go, C++, Python, ASM, or something else entirely. Don't lock yourself down to one view for how all programming is supposed to work, since that's a quick path to obsolescence.

  15. Re: French programming by rduke15 · · Score: 2

    You are kidding, but I remember actually programming in French.

    Well, I don't really remember much. But in the 80ies, there was a French database for Mac called 4..? (I only remember there was a 4 in it's short name). The programming was in French. At the time, I was quite new to computers and very young, and there was no Internet.

    I would hate a non-English programming language now, but at the time, I guess it was OK. Especially since the choice was that DB or Oracle.

    I'm glad it let me bypass Oracle at the time. And I'm furious I have to deal a bit with Oracle now, for an application created before PostgreSQL was available. Installing and configuring Oracle on Debian now feels like going back to DOS 2.11... No apt-get install, no SQL history, horrible formatting of output, ... but I digress...

    Yes, I'd (almost) rather program in French than deal with Oracle...

  16. Changing the License to GPLv3 by glennrrr · · Score: 1

    There was a lively comment thread on Swift.org which was shut down under the organization's code of conduct regarding a pull request replacing the Apache license with GPLv3. Hilarious.

    1. Re:Changing the License to GPLv3 by jcr · · Score: 1

      The project should probably have an open troll thread. Might keep the noise down in the serious discussion threads.

      Maybe we should just make a Swift board on 4chan.

      -jcr

      --
      The only title of honor that a tyrant can grant is "Enemy of the State."
  17. Re: French programming by kevingolding2001 · · Score: 1

    But in the 80ies, there was a French database for Mac called 4..? (I only remember there was a 4 in it's short name).

    That would be 4th Dimension.
    https://en.wikipedia.org/wiki/...

    My very first programming job (while still finishing uni part time) was with this.

  18. Wrong, I don't by SuperKendall · · Score: 5, Insightful

    Indentation is how you communicate block structure to a human reader. You're going to indent your code anyway

    No, I am not. That's why I have a computer, to do tedious things for me - like correctly indenting code... pretty much every function I write I can write loosely and then simply tell the editor to re-indent my code correctly.

    And that is why Python and Fortran are really the only languages I dislike, because they are the only ones (that I have used anyway) where the code CANNOT BE FORMATTED, because you have to know what code does in order to format it. In Fortran a character being present at a certain indent level meant that line was really a comment - oops!

    But in Python you are far worse off, because the wrong indent changes execution, changes what you meant the program to do. There's no way for a formatter to guess how the code SHOULD be structured, so it cannot be - ensuring a life of tedium and very probable mistakes for coders that follow after the first one.

    Python is the Wolverine of coding languages, the ultimate loner language.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
    1. Re:Wrong, I don't by igloo-x · · Score: 1

      pretty much every function I write I can write loosely and then simply tell the editor to re-indent my code correctly

      Or you can just write it properly in the first place and save yourself all the trouble? Does writing stuff 'loosely' really save you that many keystrokes?

    2. Re:Wrong, I don't by SuperKendall · · Score: 1

      I kind of figured that had been fixed, it was Fortran77 I used - I have to admit that was a small quibble really, compensated very well by using Emacs as an editor.

      At least I wasn't doing punch cards straight up.

      --
      "There is more worth loving than we have strength to love." - Brian Jay Stanley
    3. Re:Wrong, I don't by dave1791 · · Score: 2

      If you are not going to bother to write code that is easy for humans to read, then I don't want to be one of the people who has to maintain it. I'll take easy to read code over clever any day of the week, because at some point in the future - be it days, weeks, months or years later - someone will have to go back through that code and try to understand what it does.

      Over the years, I've seen too much code where nobody understands how it works and won't touch it. Nine times out of ten, it was because of "obfuscation through laziness".

    4. Re:Wrong, I don't by Junta · · Score: 2

      FWIW, the same argument about editor would apply to the 'tedium' of braces. Many editors when contending with languages you hit '{' and enter and poof, proper indentation and close brace inserted.

      --
      XML is like violence. If it doesn't solve the problem, use more.
    5. Re:Wrong, I don't by faffod · · Score: 1

      the COMMON block called, it wants its throne back.

    6. Re:Wrong, I don't by david_thornley · · Score: 1

      I've seen C++ that physicists have written. It doesn't look much better.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    7. Re:Wrong, I don't by goose-incarnated · · Score: 1

      No, I am not. That's why I have a computer, to do tedious things for me - like correctly indenting code.

      But you're going to be doing the tedious things like adding curly brackets in - Python is great because it avoids that.

      No, it doesn't. You still have to add the 'block-start' symbol (AKA the opening brace in other languages). You cannot start a block without a block-start symbol in python. In some cases you even *need* a special keyword to end a block.

      --
      I'm a minority race. Save your vitriol for white people.
    8. Re:Wrong, I don't by Ksevio · · Score: 1

      You could say the colon is similar to the open-curly bracket, but it has a fixed location as the end of the phrase opening the block and it's a fairly commonly used punctuation mark in English. The only time you'd need to put something at the end would be if the block would be otherwise empty, so it's helpful from a readability point of view to have the "pass" keyword there.

    9. Re:Wrong, I don't by MachineShedFred · · Score: 1

      Yeah, you're inviting the old-school anti-IDE folk to come and chime in now.

      I use an IDE, and it indents for me 90% of the time, because it understands the language and auto-indents another tab stop when a curly brace and carriage return is input, or begin / end, etc.

      I almost never use the tab key when coding, because I, like you, have a smarter tool to do that inane task for me.

      --
      Slashdot still doesnâ(TM)t support Unicode after it was added to the HTML standard in 1997.
    10. Re:Wrong, I don't by SuperKendall · · Score: 1

      If you are not going to bother to write code that is easy for humans to read

      I am, that's the whole point. I can do so while letting much of the tedious part of making it easy to read handled by re-formatters.

      Furthermore the benefit of something that can be fully textually re-formatted is that anyone ELSE can make it readable to whatever peculiar tastes they may have, by simply re-formatting with different directives.

      Do not presume that the style YOU like is the one everyone likes. As a consultant I adapt whatever style is desired by the team I am working with, not solely based on my own selfish desires...

      --
      "There is more worth loving than we have strength to love." - Brian Jay Stanley
  19. All the time by SuperKendall · · Score: 1

    I often write code where, on the fly, the indentation is not correct. Sometimes I decide I don't want some code in a block and move it elsewhere... sometimes I write a whole if statement on one line because it's cleaner.

    In the end it doesn't matter because after I write a bit of code, I have the editor re-indent the code. Which I can do because white space does not control meaning of execution.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
    1. Re:All the time by Actually,+I+do+RTFA · · Score: 1

      So, you have a shitty editor that doesn't indent code as you go?

      --
      Your ad here. Ask me how!
  20. So, fuck readability, user opinions, human factors by gestalt_n_pepper · · Score: 1

    They're sounding suspiciously like a software company that distributes a desktop OS and starts with the letter "M."

    --
    Please do not read this sig. Thank you.
  21. Optional is one of the best aspects of Swift by SuperKendall · · Score: 1, Informative

    Unless you've used them for a while, you probably wouldn't know. But Optionals are the best idea to come along in some time. There have been things a bit like them, but not constantly used in languages - the great thing about Swift is support for anything being an optional.

    Optionals eliminate so many classes of bugs, from ints where some magic value indicates "not set " to knowing if any variable has a "real" value. Just look at the Facebook 48 years of friendship bug, all because of a default of 0 which would have been .None in swift.

    Databases can have null values after all, why shouldn't programing languages?

    As for the "?", in swift it both makes it clear you are calling something that may not exist, while at the same time ACKNOWLEDGING that you know it may not exist. I really liked how in ObjC you could call null functions with no result, but there was a very real possibility that missing a call led to some other issue. As in so many other things, Swift lets you do something possibly dangerous if you like, but you have to agree you know what you are doing.

    In real life 'myLabel?.text = "blah"' is so close to 'myLable.text = "blah"' it hardly matters, and the work you do to work with optionals is enough motivation to make other things non-optional when possible, a driver for good design because you have a clean data path in some portions of the code.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
    1. Re:Optional is one of the best aspects of Swift by cbhacking · · Score: 1

      I *think* C# (and possibly other .NET languages; I wasn't using any others at the time) was the first language to have universal support for optionals (technically called "nullables" and the syntax is just a shorthand for System.Nullable, but it works like you'd expect), but I agree with your statement about their usefulness. In fact, it's interesting that you bring up databases; the .NET libraries for getting database values use nullables for those types which aren't inherently nullable in .NET, so that you are forced to be aware that a database record's Boolean or integer or date or whatever may simply be missing. It works very nicely.

      --
      There's no place I could be, since I've found Serenity...
    2. Re:Optional is one of the best aspects of Swift by Pseudonym · · Score: 2

      I think the Hindley-Milner languages beat it. Haskell had Maybe types standard in the mid-90s (and non-standard several years before that). ML probably had them before Haskell did.

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
  22. Re: French programming by davesag · · Score: 2

    That'd be 4th Dimension. It was great. I built many a complex website back in the 1990s using 4D.

    --
    I used to have a better sig than this, but I got tired of it
  23. Re: Rust has made Swift obsolete already. by Fwipp · · Score: 1

    You know that's a troll, right? They post in like every programming language thread.

  24. Re:So, fuck readability, user opinions, human fact by Luthair · · Score: 1

    Virtually every developer in the past 40-years knows the C-syntax, deviating from it (e.g. python, typescript, etc) is what causes readability problems.

  25. Re:Null pointer dereference by beelsebob · · Score: 1

    Uhhh, rust's way of dealing with pointers that might be null is optionals...

    https://doc.rust-lang.org/std/...

  26. New Wave by SuperKendall · · Score: 1

    No, no, no. We old fogies need that "default" keyword because it makes much more sense and easier to read than '-'.

    If you really want to replace "default" with something that makes more sense for the modern age and is instantly understanding able, I have the correct solution:


    case -\_(``/)_- -:

    Apologies for the crude representation of this, Slashdot doesn't support Unicode well.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
  27. That's the whole problem by SuperKendall · · Score: 1

    Or you can just write it properly in the first place

    I did, the compiler thought so, and so did I.

    There was absolutely nothing wrong with the code before and after indenting, just how it was sculpted on screen.

    That inability to choose how to sculpt the visual aspect of code in Python is a monstrous shortcoming, which overshadows all of the other great things about Python.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
    1. Re:That's the whole problem by igloo-x · · Score: 4, Insightful

      That inability to choose how to sculpt the visual aspect of code in Python is a monstrous shortcoming

      No, I think it's perfectly in-keeping with the rest of the zen of Python. Namely, there should be one (and preferably only one) obvious way to do something.

      There's no bickering about bracing style, or special snowflake developers applying their own misguided style on everything. It discourages people from writing deeply nested, difficult-to-follow logic in favour of simple, flat code.

      And when everybody sticks to the same conventions, it magically becomes a lot easier to read, understand, share, work on, learn from and contribute to everyone else's code.

    2. Re:That's the whole problem by serviscope_minor · · Score: 1

      No, I think it's perfectly in-keeping with the rest of the zen of Python. Namely, there should be one (and preferably only one) obvious way to do something.

      I wish the zen of python would die. This line is intensely irritating and demonstrably not correct. It literally only applies if you're invested heavily in the python community and have picked it up from there.

      There's no bickering about bracing style, or special snowflake developers applying their own misguided style on everything.

      So there's no long screeds about how you should never use tabs and only use spaces? And what's currently considered the "proper" amount of spacing? None of those things are obvious, and the space-vs-tab one is WAAAYY more of a minefield than K&R style braces vs GNU style (a particular form of horrendousness) or brace-on-a-new-line style.

      The choice is not obvious, and there are MANY ways of doing it.

      It discourages people from writing deeply nested, difficult-to-follow logic in favour of simple, flat code.

      What? No it doesn't. It's just a marginally different way of indicating blocks. If anything the lack of {} makes it shorter and so easier to nest.

      And when everybody sticks to the same conventions, it magically becomes a lot easier to read, understand, share, work on, learn from and contribute to everyone else's code.

      The existence of conventions is necessary precisely because there are multiple ways of doing things and they're all obvious. If they weren't it would just be the language not a convention. For example no one uses anything other than + to add numbers.

      --
      SJW n. One who posts facts.
    3. Re:That's the whole problem by igloo-x · · Score: 1

      It literally only applies if you're invested heavily in the python community and have picked it up from there.

      It applies if you want to be able to understand other people's code more easily.

      So there's no long screeds about how you should never use tabs and only use spaces? And what's currently considered the "proper" amount of spacing? None of those things are obvious, and the space-vs-tab one is WAAAYY more of a minefield than K&R style braces vs GNU style (a particular form of horrendousness) or brace-on-a-new-line style.

      The choice is not obvious, and there are MANY ways of doing it.

      The style guide written by the author of the language says "Use 4 spaces per indentation level." Regarding tabs vs. spaces, it says "Spaces are the preferred indentation method." It says this right at the top of the document. It's also in the beginner's guide of the official documentation, and is illustrated with numerous examples in the style guide itself. It doesn't get much clearer than that.

      What? No it doesn't. It's just a marginally different way of indicating blocks. If anything the lack of {} makes it shorter and so easier to nest.

      Properly-formatted Python code should be limited to lines 79 characters in length. Practically speaking, you can't use more than 3 or 4 levels of indentation in 79 characters. In most cases, deeply nested logic is spun off into top-level functions or methods. If you can't do this cleanly, it's a good indication you're doing something else wrong and should consider simplifying your approach. This also has the benefit of making that logic easier to cover with unit tests.

      The interpreter itself doesn't enforce most of these rules because there are always edge-cases where breaking the rules makes things more readable. PEP8 states this right at the top. It still makes 99.9% of the rest of the code easier to work with though, so it's worth it.

    4. Re: That's the whole problem by cyber-vandal · · Score: 1

      Sounds like COBOL. Do you have to put an asterisk in column 7 for comments too?

    5. Re:That's the whole problem by serviscope_minor · · Score: 2

      It applies if you want to be able to understand other people's code more easily.

      I don't follow: wanting other people to understand your code is all fine and good, but that doesn't make one of two equally obvious ways more obvious. If you had to learn it from the community then it wasn't obvious in the first place.

      Doesn't mean you shouldn't follow the community, but the so-called zen of Python is massively oversold.

      The style guide written by the author of the language says "Use 4 spaces per indentation level."

      The style guide is not part of the language. Nothing about the language itself makes that obvious. I learned python when I needed to work on some python code someone else wrote. The first thing I didn't do was go and start reading up about the author of Python. I started hacking and occasionally referenced syntax guides.

      But the language itself does not make the choice obvious. Quite the opposite. Guido never tells you to use + to add integers because that IS obvious. He has to tell you to use 4 spaces because it isn't obvious.

      It's also in the beginner's guide of the official documentation

      Not everyone starts with the official beginners guide. In fact, I'd bet most experienced programmers don't because we don't need to be told what a for loop is. Once you know it's a pointer/reference based language with a few builtins, immutable strings and integers and a few other bits and bobs, you know 95% of python and the rest is mere syntax.

      Properly-formatted Python code should be limited to lines 79 characters in length.

      Because we're still on punched cards?

      It still makes 99.9% of the rest of the code easier to work with though, so it's worth it.

      Not going to argue with that. But I do dispute that the language makes it so. The language has tons of alternative ways to do almost everything. The community has style guides because the choice of which to use is not obvious from just the language.

      --
      SJW n. One who posts facts.
    6. Re:That's the whole problem by david_thornley · · Score: 1

      As it happens, I don't like 4-character indentation. I prefer 3 or even 2.

      Now, if Python only used tabs for indentation, that would work. However, you've just said spaces are the preferred indentation method, so I can't reformat to make it more readable to me. Moreover, if a combination of tabs and spaces develops, there's the possibility that someone will mess something up and screw the program up royally.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    7. Re:That's the whole problem by goose-incarnated · · Score: 1

      That inability to choose how to sculpt the visual aspect of code in Python is a monstrous shortcoming

      No, I think it's perfectly in-keeping with the rest of the zen of Python.

      This whole "pythonesque way or the highway" results in python's stupidities being propagated instead of fixed. Significant whitespace was a stupid design decision, one among many other stupid design decisions. I feel it is the worst design decision in python - take away all ability for the computer to determine that you may have made a block-level mistake.

      --
      I'm a minority race. Save your vitriol for white people.
    8. Re:That's the whole problem by goose-incarnated · · Score: 1

      It literally only applies if you're invested heavily in the python community and have picked it up from there.

      It applies if you want to be able to understand other people's code more easily.

      You must be mad - you *do* realise that with all languages other than python I can simply reindent and/or reformat to my preferences? I don't *need* to understand other peoples formatting unless I'm using python.

      --
      I'm a minority race. Save your vitriol for white people.
  28. Top of the list by Hognoxious · · Score: 1

    Make it more like Java.

    Make it less like Java.

    --
    Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  29. Concatenating != indexing by tepples · · Score: 1

    To have the Character type represent a full grapheme cluster is... odd.

    I'll admit that human users' mental model does appear "odd" to someone who has been indoctrinated with the "character == code point" philosophy.

    99% of apps do nothing more than concatenate strings before passing them to some other API.

    And if you're just concatenating, you don't need to index.

    1. Re:Concatenating != indexing by PhrostyMcByte · · Score: 1

      I understand that it's neat to have a deeper understanding of something that most have pretty large misconceptions on, but lets not let that get to our heads. Dismissing people as "indoctrinated" or for any other reason will only hamper us.

      Believe me, I've been on your side of the argument more times than I can count. I've been helping with proper Unicode understanding and contributing related fixes to various projects for the better part of a decade. The understanding I've landed on is a simple one: making Unicode support a dogma is not helping anyone. It just leads to more and more complicated bugs. Instead, in almost every case I've observed, making code blind to Unicode is far more robust.

      Very few people have a need to interpret their strings as little more than an opaque chunk of bytes. For those people, specialized APIs can exist -- but beating everyone over the head with it by making it the default in the primitive string type is going to hurt way more than it'll help.

  30. Python is the real "Special Snowflake" here by SuperKendall · · Score: 1

    There's no bickering about bracing style, or special snowflake developers applying their own misguided style on everything. It discourages people from writing deeply nested, difficult-to-follow logic in favour of simple, flat code.

    It sure does; that's why Python is the Soviet Block House of programming languages. You talk about "misguided style", but then take the worst possible style and say it's best that everyone has to use it regardless of actual clarity.

    When you cannot make the code visually beautiful, I cannot see how you can possibly keep up architectural beauty also.

    It's not about "special snowflakes", it's about inflexibility inherently leading to less clear code - both conceptually and visually.

    That was borne out in the Python I had to go in and try to repair.

    Swift is like a Python you can actually construct something robust in.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
    1. Re:Python is the real "Special Snowflake" here by igloo-x · · Score: 1

      Please post some examples of competently coded, PEP-8 adherent python that you find 'unclear', and explain what you think is unclear about it.

    2. Re:Python is the real "Special Snowflake" here by david_thornley · · Score: 1

      Now, let's see some badly written Python and compare it to badly written C. If we're perfect, it doesn't matter what language we use, or how it can be made harder to understand if written incorrectly. We aren't perfect.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    3. Re:Python is the real "Special Snowflake" here by SuperKendall · · Score: 1

      Pick any if statement where the body is longer than two lines and you have your example.

      Sorry, but I just find python in general to be a very hard to parse mess of syntax, what little I had to do with minting something written in python once was something of a nightmare.

      It's not like I can't get used to other languages either, I've done extensive coding in elsp, scheme, C, C++, Java, Objective-C, and Swift along with occasional programming in a number of other languages like Haskell and Erlang... Absolutely all of them I could get along with just fine.

      In fact as I think I said elsewhere, I like Python the language, and other things around Python. But the whitespace delineated block structure is such a horrifically bad and disruptive "feature" I cannot work in it.

      It's not like I think Python should go away, I know a lot of people like and use Python and that is great. But that does not mean the whitespace structure should be allowed to infect other languages, it also does not mean because there are a lot of people that like something there cannot also be quite a lot of other people who hate it. To me Python is the White Chocolate of programming languages.

      --
      "There is more worth loving than we have strength to love." - Brian Jay Stanley
  31. They actually care about those by SuperKendall · · Score: 1

    To the contrary; it seems like the Swift team cares about all of the things you mentioned far more than the architecture astronauts that guide the design of just about any other language...

    The Python guys are all up in arms because you can't get rid of a few curly braces, while ignoring that Swift lets you omit whole massive chunks of syntax when possible (like omitting return type when nil, or type information when it's possible to derive it, or easy closure passing into functions). Swift does a great job of letting you chose the level of syntax that provides the best comprehension for code you are writing.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
  32. No real surprises by tsotha · · Score: 1

    It looks like most of the list is just an effort by people to make Swift look like whatever language they're using currently.

  33. Re:Swift Is Queer by Etcetera · · Score: 1

    As queer as Tim Cook.

    Why not go back to Hypertalk and HyperCard!

    Ha ha

    I'm assuming you're trolling, but HyperTalk was actually pretty awesome for its intended usage. AppleScript is still a great high-level language for describing what would otherwise be completely UI-driven macro integration. Most of the really painful re-engineering of code to deal with Apple Events was done back in the 90s, and Cocoa-only writers were able to leverage that going forward. That being said, it's not a general purpose language... it's a scripting language. HyperCard had some nifty UI built-ins, but it was still a scripting language.

    Use the right tool for the right job. For sysadmins, someone who wants to write everything in Shell is probably as bad as the person who doesn't want anything in Shell. (cough*systemd*cough)

  34. Re:They're called architects YACC anyone? by Pseudonym · · Score: 1

    The short answer is "it depends". Lex and YACC are not too bad for prototyping or internal tools, but I'd never ship a production compiler that used them. OK, maybe Lex, but definitely not YACC.

    Lex and YACC are extremely C-specific. You have to write glue code if your compiler is written in something else such as C++, which it probably is if you're using LLVM. There are more modern YACC-alikes which overcome these problems, but still. Also, you have to jump through hoops if you want more than one lexer/parser linked into the binary. Many modern production compilers effectively have more than one "input language" (e.g. multiple revisions of a standard, C/C++/Obj-C/CPP), and there's just no nice way to do this in YACC.

    But more importantly, YACC (and, indeed, pretty much any parser generator) tends to produce terrible syntax error messages. Diagnostics about errors in the program is, in a sense, the only part of the compiler's output that a programmer will read. Those syntax and type error messages are, in a deep sense, the most important part of the "user interface" of a compiler. If the error messages are less helpful than they could be, the compiler fails at ergonomics. Just look at all the people who complain about STL type errors.

    Getting YACC to produce high-quality error messages, and convincing it to recover gracefully from a syntax error so that it can proceed, is more work than hand-writing a parser in the first place. You might as well just do that.

    --
    sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
  35. Re:So, fuck readability, user opinions, human fact by tgv · · Score: 1

    Typescript doesn't really deviate much from C/C++, does it?

  36. Re:Appel is EVIL by greenfruitsalad · · Score: 2

    this joke only works in the US. the rest of the world has history and geography of the world (!= USA) in school. also it helps when history books don't have chapters beginning with "on the 8th day, Abe Lincoln rode his dinosaur to Philadelphia".

  37. Re:They're called architects YACC anyone? by TheRaven64 · · Score: 1

    Even for prototyping, I wouldn't use them. The separation of tokeniser and parser is an artificial distinction driven by slow computers with small amounts of RAM (as is the C preprocessor). You still need extremely efficient parsers for C-family languages, because #include means that the C compiler often sees several MBs of text. For more modern languages that encourage modularity, you'll only be parsing a small amount and a PEG-based parser will consume a tiny fraction of the total compilation time and be a lot easier to debug.

    --
    I am TheRaven on Soylent News
  38. Re:Danger! by xonen · · Score: 1

    Replace Logical Operators (&&, ||, etc) with words like "and" and "or":

    Bless your c-styled bitwise- and logical operators. For example, Pascal uses 'and' and 'or' as suggested. They happen to be bitwise and and or. For true logical operations you have to jump some hoops. So, before you know your code is full of `if ((b=0) and (c<>0))` etc. That's `if ((b==0) & (c!=0))` for the C readers.

    You could solve it by indicating logical or bitwise operators. Band (bitwise and) and land (logical and)? bor and lor? That would surely make code more readable.

    I love the c-style logical operators. It's obvious what they do. They are very readable as they are not letters, making it much easier to parse for the brains.

    To end with a quote: `I would use pascal more frequent if only it had the syntax of C`

    --
    A glitch a day keeps the bugs away.
  39. Site operators refuse to fix bugs by tepples · · Score: 1

    But there is no technical reason for those channels to be defective

    But there is a non-technical reason: deterring page-widening posts that break the layout for other readers.

    The complaints should be bug reports against the web sites and/or the forum software they use.

    Unless the administrators of sites have a history of resolving these things WONTFIX, often citing past abuses by vandals. Incidentally, "past abuses" like that are why Slashdot supports very few code points outside ISO 8859-1: because people were using bidirectional control characters to spoof moderation and using other characters for obscene glyph art.

  40. Shouldn't change... by Junta · · Score: 1

    Swift shouldn't do away with braces nor should python add them. Once a language has made a choice, they need to stick with it. A language that would change such fundamentals once in productive use would be idiotic.

    --
    XML is like violence. If it doesn't solve the problem, use more.
  41. Re:Answer: Swift by rochrist · · Score: 1

    Wow, that's some genius level comedy there, that is.

  42. Re:So, fuck readability, user opinions, human fact by Luthair · · Score: 1

    The parts that borrow from Javascript, but what they've added is usually weird.

  43. Re: French programming by rduke15 · · Score: 1

    Yes, it was "4th Dimension", aka 4D. I should have kept some floppies from then. Would have been fun to look at that code now...

  44. Re:They're called architects YACC anyone? by Pseudonym · · Score: 1

    Even for prototyping, I wouldn't use them.

    I was thinking about prototyping a new language rather than prototyping a new compiler for an existing language. In that situation, YACC would give you a faster turn-around time during the exploratory phase.

    The separation of tokeniser and parser is an artificial distinction driven by slow computers with small amounts of RAM (as is the C preprocessor).

    The distinction is usually made by the language definition itself. Also, lexical analysers tend to be where you hide all of the ambiguity so that the syntax analyser doesn't have to deal with it (e.g. an "identifier" is anything which looks like an identifier but isn't a keyword). Having said that, I tend to agree with you; it's just as artificial as the two-level "recursive descent parser for statements, operator precedence parser for expressions" that they did back in the bad old days. Or van Wijngaarden grammars, which are probably best forgotten.

    Incidentally, the C committee was smart about this, by defining the C preprocessor so that it operates on C tokens rather than text. That means you can either share the lexer between the preprocessor and the compiler, or do it in a single pass like Clang does (the conceptual phase ordering being lexer -> preprocessor -> parser).

    Which brings up another point: Lex (in particular) also comes from a time in history where it was prohibitively expensive to hold the program text in memory. Today we just memory map it all and work on memory buffers. It's much easier to hand-write a lexer if it doesn't have to deal with interleaved I/O!

    --
    sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
  45. Re:So, fuck readability, user opinions, human fact by tgv · · Score: 1

    And Javascript got it from C: if/while/for (...), braces around blocks, the break/continue, return. It's all very C-like. I don't find typescript's extensions that weird. It would be more C-like to write

    function int f(int x)

    but I like the ts syntax better.

  46. Re:Channels that apply line.strip() for line in ms by david_thornley · · Score: 1

    The complaints should be bug reports against the web sites and/or the forum software they use.

    This is an incredibly useless response. You're asking everybody in the world to make sure their software is Python-safe, even the software that was written before Python was popular and is no longer maintained. Seriously, if your solution to a problem is to make everybody else conform to your particular taste, you don't have a solution.

    If I can push a C program through some communication path and re-indent, and I can't do that with Python, then that's an advantage of C. I can't always choose communication paths.

    --
    "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  47. White-space solution by Tablizer · · Score: 1

    Microsoft does a lot wrong, but I'll give them kudos where due. Their Common Language Runtime has allowed one to code in either VB style or C style using mostly the same constructs and language processor engine.

    If you design a new language, allow it to have 3 syntax styles:

    1. C style
    2. VB-ish style (x...end x, with underscore for continuation, type-name after variable.)
    3. Python/Ruby style with white-space block nesting

    At least one of these styles should make a given coder sufficiently happy (except maybe Lisp fans).

    Make a translator that can convert between each style so that if a person or shop gets the style they don't want, they can convert, and/or allow them to mix their code with the code in the other style. (There may be edge cases where direct conversion may require human intervention.)

    Thus, one module could be written in C-style, but work with a module in the VB style.

    I was thinking of a compiler/interpreter that would look at function declarations to determine the style of that function. If it starts with "def", then assume the rest of the function has the Python/Ruby style. If the function body starts with "{", then assume C-style, otherwise it's VB-style.

  48. Re: French programming by MachineShedFred · · Score: 1

    My current job is helping a team to replace a 3rd party billing provider which still uses 4D databases.

    You can imagine why we are firing them.

    --
    Slashdot still doesnâ(TM)t support Unicode after it was added to the HTML standard in 1997.