halubilo.social
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
@[email protected] to Programmer [email protected] • 1 year ago

===

programming.dev

message-square
76
fedilink
677

===

programming.dev

@[email protected] to Programmer [email protected] • 1 year ago
message-square
76
fedilink
  • @[email protected]
    link
    fedilink
    English
    75•
    edit-2
    1 year ago

    https://programming.dev/post/7789832

    • @[email protected]
      link
      fedilink
      19•1 year ago

      deleted by creator

      • @[email protected]
        link
        fedilink
        16•1 year ago

        by not ever using == and !=, but only === and !==

      • @[email protected]
        link
        fedilink
        10•1 year ago

        Because in reality you’re not doing stupid stuff like that in the image. And using Typescript definitely helps.

        However I’m always annoyed that the month parameter when constructing a date object is 0 based. So 1st of Jan is

        new Date(2024, 0, 1)
        
        • @[email protected]
          link
          fedilink
          8•
          edit-2
          1 year ago

          deleted by creator

        • @[email protected]
          link
          fedilink
          1•1 year ago

          Looks confusing at first, but I found it nice for accessing a month array.

          const months = ["Jan", "Feb", ...];
          
          months[0] === "Jan";
          
          const label = months[date.getMonth()];
          
      • @[email protected]
        link
        fedilink
        10•1 year ago

        Typescript :)

        • @[email protected]
          link
          fedilink
          3•1 year ago

          Yep. It’s the only reason I’m still somewhat sane.

          • @[email protected]
            link
            fedilink
            English
            2•1 year ago

            I got by without it for years, but not that I have it I have no idea how I did it back then.

      • @[email protected]
        link
        fedilink
        7•1 year ago

        By banishing the bad part of the language with linter.

        For instance, standard eslint preset has rules that enforce usage of ===, https://eslint.org/docs/latest/rules/eqeqeq

        These rules often come with project starter template

        • @[email protected]
          link
          fedilink
          English
          4•1 year ago

          And typescript is basically just a linter on steroids

      • darcy
        link
        fedilink
        7•1 year ago

        almost forced to for web front end. why you would use it anywhere else, however, i will never know

        • Turun
          link
          fedilink
          4•1 year ago

          The same reason people drive their car to buy groceries.

          You bought it for something where it was the only option, driving 30km to work everyday. But ever since you got it, the trip to the super market is kinda too hot in the summer and too cold in the winter and what if you spontaneously need to buy more than expected?

          People learn it for front end dev, and then they use what they know for back end too.

      • @[email protected]
        link
        fedilink
        2•
        edit-2
        1 year ago

        Ikr? English is hard /s

Programmer [email protected]

[email protected]

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: [email protected]

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
  • 727 users / day
  • 4.36K users / week
  • 8.34K users / month
  • 17.3K users / 6 months
  • 23.2K subscribers
  • 1.4K Posts
  • 50.6K Comments
  • Modlog
  • mods:
  • Feyter
  • adr1an
  • @[email protected]
  • Pierre-Yves Lapersonne
  • BE: 0.19.3
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org