Beehaw
  • Communities
  • Create Post
  • search
    Search
  • Login
  • Sign Up
TadoTheRustacean ( TadoTheRustacean@programming.dev )  to Programmer Humor@programming.dev · 3 years ago

What are variables and semicolons for actually?

message-square
message-square
20
link
fedilink
76
message-square

What are variables and semicolons for actually?

TadoTheRustacean ( TadoTheRustacean@programming.dev )  to Programmer Humor@programming.dev · 3 years ago
message-square
20
link
fedilink

alert-triangle
You must log in or # to comment.
  • FizzyOrange ( FizzyOrange@programming.dev ) 
    link
    fedilink
    arrow-up
    18
    ·
    3 years ago

    Neat FP style. Pretty verbose though. Someone should invent a terser syntax so you don’t need to write do_two_things everywhere. It’s a common operation so maybe it could even be a single character.

    • jendrik ( jendrik@discuss.tchncs.de ) 
      link
      fedilink
      arrow-up
      6
      ·
      3 years ago

      Like a semicolon? No, too boring. What about >>=

    • TadoTheRustacean ( TadoTheRustacean@programming.dev ) OP
      link
      fedilink
      arrow-up
      5
      ·
      3 years ago

      If you know about rust you know it’s a programmable programming language, meaning that you can make macros. There could be a macro that would do that but 1. Macros is rust code to write rust code so they have the complexity of rust squared 2. I said to myself the only macros I will allow myself to use in this challenge is println and allow

    • tatterdemalion ( tatterdemalion@programming.dev ) 
      link
      fedilink
      arrow-up
      5
      ·
      3 years ago

      ; is just a monad after all

  • colournoun ( colournoun@beehaw.org ) 
    link
    fedilink
    arrow-up
    15
    ·
    3 years ago

    Isn’t this basically how lisp works?

    • TheAgeOfSuperboredom ( TheAgeOfSuperboredom@lemmy.ca ) 
      link
      fedilink
      arrow-up
      1
      ·
      3 years ago

      Yup! Also languages in the ML family and others I’m sure.

  • TheAgeOfSuperboredom ( TheAgeOfSuperboredom@lemmy.ca ) 
    link
    fedilink
    arrow-up
    12
    ·
    3 years ago

    Yeah, semicolons are ugly anyway and they’d ruin the beautiful expression of your code.

    • OpenStars ( OpenStars@startrek.website ) 
      link
      fedilink
      English
      arrow-up
      2
      ·
      3 years ago

      POV: your project manager went in an “cleaned” it all up by removing them - your (sic) welcome! 😜

  • Ethan ( firelizzard@programming.dev ) 
    link
    fedilink
    English
    arrow-up
    6
    ·
    3 years ago

    After programming in Go for nearly a decade, the idea of going back to needing semicolons brings me pain. Rust seems cool, but semicolons 🤢

    • TadoTheRustacean ( TadoTheRustacean@programming.dev ) OP
      link
      fedilink
      arrow-up
      5
      ·
      3 years ago

      As you can see, rust allows you to not put semicolons at the end of code blocks. The presence of semicolons is not a language killer. It’s a very hard language, but its worth it.

      • Ethan ( firelizzard@programming.dev ) 
        link
        fedilink
        English
        arrow-up
        2
        ·
        3 years ago

        The presence of semicolons is not a language killer.

        I’m not saying it is. But every time I have to work in a language that requires semicolons I’m constantly forgetting them and constantly reminded of how nice it is to not have to care in Go.

  • tatterdemalion ( tatterdemalion@programming.dev ) 
    link
    fedilink
    arrow-up
    3
    ·
    3 years ago

    Would you rather have semicolons or significant newlines?

    • TadoTheRustacean ( TadoTheRustacean@programming.dev ) OP
      link
      fedilink
      arrow-up
      3
      ·
      3 years ago

      Semicolons. Statement’s can be written in multiple lines such as rust io::stdin(&mut foo) .unwrap(). Idk if it would work if the newlines were significant. Also when I paste something, it could be ready hard for the formatter to format it.

  • NoisyFlake ( NoisyFlake@lemm.ee ) 
    link
    fedilink
    arrow-up
    3
    ·
    3 years ago

    What’s the font?

    • TadoTheRustacean ( TadoTheRustacean@programming.dev ) OP
      link
      fedilink
      arrow-up
      2
      ·
      3 years ago

      JetBrainsMono Nerd Font

      • NoisyFlake ( NoisyFlake@lemm.ee ) 
        link
        fedilink
        arrow-up
        1
        ·
        3 years ago

        How did I not recognize the font I’ve been using for years, lol. Guess it just looks even better on a HiDPI display.

  • tatterdemalion ( tatterdemalion@programming.dev ) 
    link
    fedilink
    arrow-up
    2
    ·
    3 years ago

    Well you have a variable foo being mutated. Maybe that’s what they’re for?

  • tatterdemalion ( tatterdemalion@programming.dev ) 
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    3 years ago

    You can replace return foo with just foo.

    • Username ( Username@feddit.de ) 
      link
      fedilink
      arrow-up
      3
      ·
      3 years ago

      Not here, because it’s being used as a function argument.

      • tatterdemalion ( tatterdemalion@programming.dev ) 
        link
        fedilink
        arrow-up
        2
        ·
        3 years ago

        Oh wow. I hate this lol

  • bitwolf ( bitwolf@lemmy.one ) 
    link
    fedilink
    arrow-up
    1
    ·
    3 years ago

    deleted by creator

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
    • If the mod doesn’t find it funny, you’re banned. Ha-ha!.. For real: do not use the community for “statements”. There are other places for such content. Keep it chill and funny.
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 633 users / day
  • 3.2K users / week
  • 5.12K users / month
  • 8.21K users / 6 months
  • 463 local subscribers
  • 33.9K subscribers
  • 1.61K Posts
  • 26.7K Comments
  • Modlog
  • mods:
  • Feyter ( Feyter@programming.dev ) 
  • adr1an ( anzo@programming.dev ) 
  • BurningTurtle ( BurningTurtle@programming.dev ) 
  • Pierre-Yves Lapersonne ( pylapp@programming.dev ) 
  • BE: 0.19.15
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code