• merthyr1831@lemmy.ml
    link
    fedilink
    English
    arrow-up
    1
    ·
    6 days ago

    copy into a word document. select all the {}; and set their colour to white. ur welcome

  • letsgo@lemm.ee
    link
    fedilink
    English
    arrow-up
    1
    ·
    10 days ago

    Personally I wouldn’t abuse a language like that. If you want to write Python, write Python. Don’t pretend some other language is Python, because it isn’t. The braces need to be in the “correct” place, i.e. { at the end of a line or on a line on its own, and } on its own line, with both braces indented correctly for the code they contain. Braces are important visual and logical indicators in C-like languages and are critical in understanding the flow of the code.

    That said, if this is some silly little noddy program that only you will ever see then you can write it however you want. Don’t expect to be taken seriously as a competent dev though if this is going to be part of your public profile.

  • umbrella@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    10 days ago

    what are some good resources for learning rust by the way?

    is documentation good/up to date?

  • HiddenLayer555@lemmy.ml
    link
    fedilink
    English
    arrow-up
    0
    ·
    9 days ago

    Why aren’t “alternate syntaxes” a thing? You can pretty easily just write code to convert between C-like and Python-like syntax. Why aren’t there IDE extensions that let you write in python syntax and automatically commit the standard syntax.

    • jcg@halubilo.social
      link
      fedilink
      arrow-up
      1
      ·
      9 days ago

      That was exactly what the .NET family of languages was back in the day. Still is, I guess? You could write in VB, C#, or F#, make use of the same standard library and general principles, but then it would all get compiled to the same IL code in the end.

  • Natanox@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    0
    ·
    11 days ago

    For a moment I wondered why the Rust code was so much more readable than I remembered.

    This would make a nice VS Codium plugin to deal with all the visual clutter. I actually like this.

    • Tlaloc_Temporal@lemmy.ca
      link
      fedilink
      arrow-up
      0
      ·
      11 days ago

      I wish I could do this with every IDE. Get rid of all the semicolons and most curly braces and replace them with structural whitespace. You could even save the files with the punctuation and compile that to whitespace when editing.

      • verdigris@lemmy.ml
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        10 days ago

        You people are insane. Languages with meaningful whitespace are my personal hell. Don’t you value being able to space/tab/newline as you please?

        • QuazarOmega@lemy.lol
          link
          fedilink
          arrow-up
          1
          ·
          9 days ago

          Used to, but now that I realise what the real hell is, i.e. collaboration with others who might (and will) have different ideas about how code should be formatted, I’d rather leave that job to an autoformatter, too much mental overhead for little gain when there’s a tool that can enforce a single style across the whole codebase with a simple command, or better yet, a git hook. If anyone complains I can point to the tool and say “sorry, take it up with it, not me”

    • Chais@sh.itjust.works
      link
      fedilink
      arrow-up
      0
      ·
      11 days ago

      I don’t like this type of question. In my experience knowing one language has little impact on learning another. What matters much more is understanding the underlying concepts.
      If you grok OOP it doesn’t matter if you go from Java to C# or from C++ to Python. Yes, there are differences, but they’re mostly syntactic in nature.
      So assuming you got the hang of imperative programming and maybe had some exposure to functional programming, too, the concept you’re likely to struggle with the most is ownership. Simply because it’s a concept that’s fairly unique to Rust.
      Having come from Java, via C++ and Python and having dabbled with Haskell a bit, I feel like The Book does a decent job of explaining Rust in general and its oddities in particular.

  • PowerCrazy@lemmy.ml
    link
    fedilink
    English
    arrow-up
    0
    arrow-down
    1
    ·
    10 days ago

    Why does even a modern language syntax insist on having end of line characters like semi colons. Surely we have moved beyond that. What is even the point of those characters?