Mono appears to be dead. I enjoy making life hard so I dont use windows. I am trying to learn very simple c# but am having trouble gettung visual studio to run anything on linux (debian/mint). It wont even run with dotnet in the terminal either. I dont really like all the features in vs either, i just want simple.

For reference im learning with the yellow book by rob miles. I want to learn the old way, not using a bunch of shiny helping tools (i never feel i really learn with those and it stunts my growth).

  • atzanteol@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    6
    ·
    15 hours ago

    Plus I felt python was too new and would skip a lot of core programming skills id just like to know

    Python was first released in the '90s. It’s older than C#.

    That said I consider Python to be a garbage language. “Easy” to use for trivial things, a pain in the ass if you have more than 500 lines of code. The lack of strict typing makes even the most trivial of refactoring an all day task.

      • atzanteol@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        3
        ·
        13 hours ago

        Kinda… You mean mypy? I’m using that and the experience is not great… It’s okay for your own code but a ton of libraries are just 🤷 about types. Especially return types which is infuriating. What do you get from that call? Who TF knows - go read stack overflow and hope there’s an example giving you some info.

        • PhilipTheBucket@piefed.social
          link
          fedilink
          English
          arrow-up
          0
          ·
          13 hours ago

          IDK, I just have never really had this become a serious issue for me. I get what you mean, some actions are a little bit of a pain in the neck because people are often sloppy about typing, but literally the only time I can remember it being an issue at all has been when numpy is involved and so I have to figure out if something is a native Python thing or a numpy-fied custom structure.

          I mean there’s just not that many types. Generally something is a list, a number, a map, or a string, and it’s pretty obvious which. Maybe there are OOP domain things where a lot of variables are objects of some kind of class (sort of more of a C++ type of program structure), and so it starts to become really critical to have strong type tools, I’m just saying I haven’t really encountered too much trouble with it. I’m not saying it’s imaginary, you may be right in your experience, I’m just saying I’ve worked on projects way bigger than a few hundred lines and never really had too much of an issue with it in practice in my experience.

          • atzanteol@sh.itjust.works
            link
            fedilink
            English
            arrow-up
            2
            ·
            12 hours ago

            Maybe there are OOP domain things where a lot of variables are objects of some kind of class (sort of more of a C++ type of program structure),

            Complex data structures are not “more of a C++ type of program structure”. And if you’re using dict for complex datatypes I weep for your source code. Even C has a struct for representing records of data.

            • PhilipTheBucket@piefed.social
              link
              fedilink
              English
              arrow-up
              1
              ·
              10 hours ago

              Complex data structures are not “more of a C++ type of program structure”.

              Oh, they are not at all. Equating complex data structures with user-defined data structures (in the form of classes and fields and whatnot), and using the latter as the primary method of storing and working with data (so that you’re constantly having to bring into your mental scope a bunch of different classes and how they need to interact), is 100% a C++ type of program structure. It’s pretty unusual in my experience in Python. Or, I mean, it’s perfectly common, but it’s not primary in the same universal way that it is in C++ and derivatives. It gets to exist as its own useful thing without being the only way. That’s what I am trying to say.

              • atzanteol@sh.itjust.works
                link
                fedilink
                English
                arrow-up
                2
                ·
                10 hours ago

                Equating complex data structures with user-defined data structures (in the form of classes and fields and whatnot), and using the latter as the primary method of storing and working with data (so that you’re constantly having to bring into your mental scope a bunch of different classes and how they need to interact), is 100% a C++ type of program structure.

                What does that even mean?

                struct User {
                    active: bool,
                    username: String,
                    email: String,
                    sign_in_count: u64,
                }
                

                How do you define that in Python? Just a dict[str, Any]?

                • PhilipTheBucket@piefed.social
                  link
                  fedilink
                  English
                  arrow-up
                  1
                  ·
                  10 hours ago

                  You define it in exactly the same way you just did. Completely fine, you have to do it for lots of things. It’s nice that Python can do that too.

                  Now, I’ll grab a random snippet of code from some random file from my source dir:

                          existing_bookmarks = db.session.execute(
                              text('SELECT post_reply_id FROM "post_reply_bookmark" WHERE user_id = :user_id'),
                              {"user_id": user_id}).scalars()
                          reply = PostReply.query.filter(PostReply.id.in_(existing_bookmarks), PostReply.deleted == False).first()
                          if reply:
                              data = {"comment_id": reply.id, "save": True}
                              with pytest.raises(Exception) as ex:
                                  put_reply_save(auth, data)
                              assert str(ex.value) == 'This comment has already been bookmarked.'
                  

                  You can see some classes in use, which again is fine. But you also see inline instantiation of some reply JSON, a database returning a list of post_reply_id values without needing a special interface definition for returning multiple values, lots and lots of cognitive and computational load per line of code that’s being saved because the language features are saving people the heavy lifting of depending on user-defined classes for everything. It means you don’t have as many adventures through the code where you’re trying to modify a user-defined interface class, you don’t need as much strong typing, that kind of thing.

                  I would bet heavily that a lot of the things that are happening in that short little space of code, would need specific classes to get them done if the same project were getting implemented in some C+±derived language. Maybe not, I just grabbed a random segment of code instead of trying especially hard to find my perfect example to prove my point.

                  It is fine, there are significant weaknesses to Python too, I’m not trying to say “yay python it’s better for everything,” anything like that. I’m just saying that if you don’t get familiar with at least some language that does things more that way, and instead get solely accustomed to just user-defined classes or templates for every information exchange or functional definition, then you’ll be missing out on a good paradigm for thinking about programming. That’s all.

                  • atzanteol@sh.itjust.works
                    link
                    fedilink
                    English
                    arrow-up
                    2
                    ·
                    9 hours ago

                    FWIW Here’s similar go code (converted by a llm).

                    func TestReplyAlreadyBookmarked(t *testing.T) {
                        var reply PostReply
                        err := db.Raw(`
                            SELECT pr.* FROM post_replies pr 
                            WHERE pr.id IN (
                                SELECT post_reply_id FROM post_reply_bookmark WHERE user_id = ?
                            ) AND pr.deleted = false 
                            LIMIT 1
                        `, userID).First(&reply).Error
                        
                        if err == nil {
                            err := putReplySave(auth, map[string]interface{}{
                                "comment_id": reply.ID,
                                "save":       true,
                            })
                            
                            assert.Error(t, err)
                            assert.Equal(t, "This comment has already been bookmarked.", err.Error())
                        }
                    }
                    

                    You can create in-line data structures AND be a properly typed language.

                  • atzanteol@sh.itjust.works
                    link
                    fedilink
                    English
                    arrow-up
                    1
                    arrow-down
                    2
                    ·
                    10 hours ago

                    You define it in exactly the same way you just did. Completely fine, you have to do it for lots of things. It’s nice that Python can do that too.

                    “It’s nice that Python can do that too.”

                    Ugh.

                    Never argue with a pythonista.