Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

agnos.is Forums

  1. Home
  2. Programmer Humor
  3. Why make it complicated?

Why make it complicated?

Scheduled Pinned Locked Moved Programmer Humor
programmerhumor
116 Posts 58 Posters 164 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • hiddenlayer555@lemmy.mlH [email protected]

    Made with KolourPaint and screenshots from Kate (with the GitHub theme).

    L This user is from outside of this forum
    L This user is from outside of this forum
    [email protected]
    wrote on last edited by
    #101

    STRING A WHAT, MOTHERFUCKER

    1 Reply Last reply
    5
    • psaldorn@lemmy.worldP [email protected]

      If there's only two options you only need one keyword

      L This user is from outside of this forum
      L This user is from outside of this forum
      [email protected]
      wrote on last edited by
      #102

      Ah, but this is JS, so there are three options! And they all function entirely differently. And your assumptions don't apply, either. πŸ˜„

      1 Reply Last reply
      0
      • V [email protected]

        Probably would still use TypeScript, because I use that for work. πŸ€·β€β™‚οΈ Rust just seems like... a lot. Regarding Rust, I've seen a lot of praises and a not so insignificant amount of complaints that make me very hesitant to take the plunge. Can't remember off the top of my head what it was, specifically, but it was enough for me to write it off, that much I remember.

        P This user is from outside of this forum
        P This user is from outside of this forum
        [email protected]
        wrote on last edited by
        #103

        People really overstate it, it's not that hard. It has a reputation of being difficult because people use it for difficult, low-level tasks, OS stuff, parsers, cryptography, highly optimised serialisation, but those things would be hard in any language. For a newcomer it's, IMO, way easier than say C++, because it doesn't have a mindbogglingly huge std lib with decades of changing best practices to try to figure out. To do simpler things in it is really pretty straightforward, especially if you're already comfortable with a robust type system.

        V 1 Reply Last reply
        1
        • _ [email protected]

          Dude, even just a "FY,I, you sure about this?" would be nice. I gladly embrace python's by-all-means-shotgun-your-leg-off philosophy, but the noobs could use the help.

          lime@feddit.nuL This user is from outside of this forum
          lime@feddit.nuL This user is from outside of this forum
          [email protected]
          wrote on last edited by
          #104

          the problem is that the language doesn't and can't support one single way to use type annotations without changing fundamental functionality. you can absolutely hook up mypy to your editor for newbies, but once you get on the intermediate level, fighting with mypy takes more code than actually solving the problem.

          also there was that proposed update to mypy that was put on held when it turned out that the maintainers didn't know how annotations are used in the wild.

          _ 1 Reply Last reply
          0
          • lime@feddit.nuL [email protected]

            the problem is that the language doesn't and can't support one single way to use type annotations without changing fundamental functionality. you can absolutely hook up mypy to your editor for newbies, but once you get on the intermediate level, fighting with mypy takes more code than actually solving the problem.

            also there was that proposed update to mypy that was put on held when it turned out that the maintainers didn't know how annotations are used in the wild.

            _ This user is from outside of this forum
            _ This user is from outside of this forum
            [email protected]
            wrote on last edited by
            #105

            Oh I'm well aware. Took me a solid year to appreciate type annotations for what they are and yeah I'm happy using what we have in stdlib now and not messing with mypy tyvm. The problem is that history is lost to newcomers who have very different expectations. Modern IDE's mostly solve it though, so for all my Java peeps dipping their toes into the snake waters, listen to your ide

            lime@feddit.nuL 1 Reply Last reply
            0
            • _ [email protected]

              Oh I'm well aware. Took me a solid year to appreciate type annotations for what they are and yeah I'm happy using what we have in stdlib now and not messing with mypy tyvm. The problem is that history is lost to newcomers who have very different expectations. Modern IDE's mostly solve it though, so for all my Java peeps dipping their toes into the snake waters, listen to your ide

              lime@feddit.nuL This user is from outside of this forum
              lime@feddit.nuL This user is from outside of this forum
              [email protected]
              wrote on last edited by
              #106

              i mean, i'm all for rejiggering the internals. i've personally written at least two libraries that uses type annotations in reverse to force arguments into the correct type, and i feel like that should probably be a separate mechanism to "just call the annotation"

              _ 1 Reply Last reply
              0
              • P [email protected]

                People really overstate it, it's not that hard. It has a reputation of being difficult because people use it for difficult, low-level tasks, OS stuff, parsers, cryptography, highly optimised serialisation, but those things would be hard in any language. For a newcomer it's, IMO, way easier than say C++, because it doesn't have a mindbogglingly huge std lib with decades of changing best practices to try to figure out. To do simpler things in it is really pretty straightforward, especially if you're already comfortable with a robust type system.

                V This user is from outside of this forum
                V This user is from outside of this forum
                [email protected]
                wrote on last edited by [email protected]
                #107

                This contradicts what I've heard others say about it. I have a feeling it is quite subjective, and this might just be an anecdotal recommendation because you have an easy time with it. Maybe I will too! But maybe I won't.

                Either way, one part of me really wants to try it, but one part has very little time in life. πŸ₯²

                Also comparing it to C++ might not be the flex we think it is. πŸ˜…

                P 1 Reply Last reply
                0
                • V [email protected]

                  This contradicts what I've heard others say about it. I have a feeling it is quite subjective, and this might just be an anecdotal recommendation because you have an easy time with it. Maybe I will too! But maybe I won't.

                  Either way, one part of me really wants to try it, but one part has very little time in life. πŸ₯²

                  Also comparing it to C++ might not be the flex we think it is. πŸ˜…

                  P This user is from outside of this forum
                  P This user is from outside of this forum
                  [email protected]
                  wrote on last edited by
                  #108

                  Well sure, I guess you're right, it's definitely a bit subjective and some people have an easier time with some languages and ways of thinking than others for sure. And I didn't really mean to say that it was totally super easy, but... no kind of programming is really super easy. It is quite different and that in itself has a learning curve.

                  My recommendation is for sure anecdotal, but I think the point about it seeming more difficult than it really is because people often use it for difficult stuff is actually true.

                  V 1 Reply Last reply
                  1
                  • lime@feddit.nuL [email protected]

                    i mean, i'm all for rejiggering the internals. i've personally written at least two libraries that uses type annotations in reverse to force arguments into the correct type, and i feel like that should probably be a separate mechanism to "just call the annotation"

                    _ This user is from outside of this forum
                    _ This user is from outside of this forum
                    [email protected]
                    wrote on last edited by
                    #109

                    dataclasses do this for you at the class level. They enforce type annotations at instantiation.

                    https://docs.python.org/3/library/dataclasses.html

                    lime@feddit.nuL 1 Reply Last reply
                    0
                    • S [email protected]

                      Yeah, it's in my edit I realized the same thing. I'm thinking it doesn't actually really make sense and the real reason is more "the specific way C does it causes a lot of problems so we're not poking syntax like that with a 10 foot pole" + "it makes writing the parser easier" + maybe a bit of "it makes grepping easier"

                      hiddenlayer555@lemmy.mlH This user is from outside of this forum
                      hiddenlayer555@lemmy.mlH This user is from outside of this forum
                      [email protected]
                      wrote on last edited by [email protected]
                      #110

                      One thing that annoyed me about C# as a Java guy is that it really wants you to use camel case for function and property names, even private ones. I don't like it specifically because it's hard to differentiate between a function/property and a type.

                      But C# has quite a few keywords and seem to like adding them more than Java.

                      Maybe that's their way of ensuring keywords don't clash with stuff?

                      1 Reply Last reply
                      0
                      • P [email protected]

                        Well sure, I guess you're right, it's definitely a bit subjective and some people have an easier time with some languages and ways of thinking than others for sure. And I didn't really mean to say that it was totally super easy, but... no kind of programming is really super easy. It is quite different and that in itself has a learning curve.

                        My recommendation is for sure anecdotal, but I think the point about it seeming more difficult than it really is because people often use it for difficult stuff is actually true.

                        V This user is from outside of this forum
                        V This user is from outside of this forum
                        [email protected]
                        wrote on last edited by
                        #111

                        Take my up vote. I agree with everything in that comment. πŸ‘

                        1 Reply Last reply
                        0
                        • _ [email protected]

                          dataclasses do this for you at the class level. They enforce type annotations at instantiation.

                          https://docs.python.org/3/library/dataclasses.html

                          lime@feddit.nuL This user is from outside of this forum
                          lime@feddit.nuL This user is from outside of this forum
                          [email protected]
                          wrote on last edited by [email protected]
                          #112

                          i think we're talking about different things. you use enforce to mean "validate", i used it to mean "coerce". one of the cases was a command line argument parser that consisted of a single decorator, so you could write

                          
                          @command
                          def foo(bar: int, baz: float):
                              print(baz * 2 + bar * 3)
                          

                          and call it with $ myfile.py foo --bar 3 --baz 2.2 and it would print 13.4

                          another was about creating working protocol buffers from an excel sheet, nested types and enums and oneofs and everything. we used it to parameterize tests of our bluetooth protocol.

                          1 Reply Last reply
                          0
                          • G [email protected]

                            You're encoding more information in the typescript one. You're saying it's a string that will get updated.

                            Z This user is from outside of this forum
                            Z This user is from outside of this forum
                            [email protected]
                            wrote on last edited by
                            #113

                            Meanwhile if it's rust it's the opposite. (Variables that can change must specify that they are mutable)

                            1 Reply Last reply
                            0
                            • H [email protected]

                              That's just a comment

                              Z This user is from outside of this forum
                              Z This user is from outside of this forum
                              [email protected]
                              wrote on last edited by
                              #114

                              Looks like a snippet of C with two labels that will be referenced by a goto instruction. Very bad code tbh.

                              1 Reply Last reply
                              0
                              • N [email protected]

                                And bow to the compiler’s whims? I think not!

                                This shouldn’t compile, because .into needs the type from the left side and let needs the type from the right side.

                                H This user is from outside of this forum
                                H This user is from outside of this forum
                                [email protected]
                                wrote on last edited by
                                #115

                                If type constraints later in the function let the compiler infer the type, this syntax totally works.

                                N 1 Reply Last reply
                                1
                                • H [email protected]

                                  If type constraints later in the function let the compiler infer the type, this syntax totally works.

                                  N This user is from outside of this forum
                                  N This user is from outside of this forum
                                  [email protected]
                                  wrote on last edited by
                                  #116

                                  Like if the variable is then used in a function that only takes one type? Huh.

                                  1 Reply Last reply
                                  0
                                  Reply
                                  • Reply as topic
                                  Log in to reply
                                  • Oldest to Newest
                                  • Newest to Oldest
                                  • Most Votes


                                  • Login

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular
                                  • World
                                  • Users
                                  • Groups