• 3 Posts
  • 25 Comments
Joined 1 year ago
cake
Cake day: June 18th, 2023

help-circle
  • The whitespace doesn’t bother me at all, but holy hell! Any time I’m trying to understand a Python program/library that’s anything above a couple thousand lines of code, I instantly feel a burning hate for dynamic typing.

    I love Python for scripting- in large part because of dynamic typing. IMO it’s just not a language made for building large infrastructures.


  • Totally justifiable IMO. In my day-to-day life its much more important that my shit works when I need it to than that I get whatever potentially something-breaking latest hotfix patch for everything on my system. Put simply: My OS, and the packages I use, work. If I don’t update, I’m sure it will also keep working. When I have time for an update to break something, or want to pull in some new feature or patch, I’ll run an update.



  • For someone starting out, I would say that a major advantage of Python over any compiled language is that you can just create a file and start writing/running code. With C++ (which I’m also a heavy user of) you need to get over the hurdle of setting up a build system, which is simple enough when you know it, but can quickly be a high bar for an absolute beginner. That’s before you start looking at things like including/linking other libraries, which in Python is done with a simple import, but where you have to set up your build system properly to get things working in C++.

    Honestly, I’m still kind of confused that the beginner course at my old university still insists on giving out a pre-written makefile and vscode config files for everyone instead of spending the first week just showing people how to actually write and compile hello world using cmake. I remember my major hurdle when leaving that course was that I knew how to write basic C++, I just had no idea how to compile and link it when I could no longer use the makefile that we were explicitly told to never touch…


  • I’m not quite sure what assumptions you’re talking about, but I do want to hear what you have to say.

    What you’re answering to is about opposing external hostile forces, that wasn’t what I was talking about. I’m talking about internal criminal environments that are dispersed in the population and make a living off anything from fabricating documents or scamming people to trafficking or smuggling. Just like modern organised criminal environments, these are not groups you can “wage war” against.

    My question is related to how these will be dealt with if not by involuntary imprisonment/re-education/some other involuntary and enforced way of preventing them from exploiting society?


  • Ok, I’m only really having issue with the “which shouldn’t be hard” part. What makes you think that violent response from an anarchist society would be more effective than the police/justice system in a modern state?

    These groups exist today, and it turns out that making them crumble by arresting (or, in some countries, executing) their members is a significantly non-trivial task. That’s when you have an organised force opposing them, which doesn’t need to deal with internal disputes the way an anarchistic force would need to.


  • I’m asking: In a hypothetical anarchist society, how do you deal with organised criminal environments that live off exploiting other members of society, and who refuse to follow rules or rulings created by the consensus of those that don’t want to be exploited?

    I’m pointing out that these groups exist and have existed in more or less every society of decent size, so they must be factored in somehow. I’m also pointing out the “voluntary prison, or else you’ll be excluded from society” likely doesn’t work, as these are people that have already accepted living a life on the side of the rest of society, within their own environment.


  • So what do you do to deal with the situation we see in modern states with an actual centralised “monopoly” on violence: Organised criminal environments that live off exploiting the rest of society?

    We’re talking about people that don’t care if you shun them, because they have their own environment, with their own hierarchy and set of rules, and they’re willing to use violence to exploit the rest of society to make a living.



  • I just came back to Europe after a couple weeks in the US. The US was beautiful (travelled in the Rockies). I was surprised by the fact that I unironically would not be able to live there just because of the food. Everything was so drowned in cheese / sugar / unspecified ultraprocessed something that I had legitimate digestion issues the first week.

    • “I would like an omelette please”
    • “Yes sir, do you want eggs in that or just the cheese?”

    I had no idea I could miss just plain real bread as much as I did by the time I got back.


  • Yes, it’s a field. Specifically, a field containing human-readable information about what is going on in adjacent fields, much like a comment. I see no issue with putting such information in a json file.

    As for “you don’t comment by putting information in variables”: In Python, your objects have the __doc__ attribute, which is specifically used for this purpose.


  • My test suite takes quite a bit of time, not because the code base is huge, but because it consists of a variety of mathematical models that should work under a range of conditions.

    This makes it very quick to write a test that’s basically “check that every pair of models gives the same output for the same conditions” or “check that re-ordering the inputs in a certain way does not change the output”.

    If you have 10 models, with three inputs that can be ordered 6 ways, you now suddenly have 60 tests that take maybe 2-3 sec each.

    Scaling up: It becomes very easy to write automated testing for a lot of stuff, so even if each individual test is relatively quick, they suddenly take 10-15 min to run total.

    The test suite now is ≈2000 unit/integration tests, and I have experienced uncovering an obscure bug because a single one of them failed.


  • This is a very “yes but still no” thing in my experience. Typically, I find that if I write “naive” C++ code, where I make no effort to optimise anything, I’ll outperform python code that I’ve spent time optimising by a factor of 10-30 (given that the code is reasonably complex, this obviously isn’t true for a simple matrix-multiplication where you can use numpy). If I spend some time on optimisation, I’ll typically be outperforming python by a factor of 50+.

    In the end, I’ve found it’s mostly about what kind of data structures you’re working with, and how you’re passing them around. If you’re primarily working with arrays of some sort and doing simple math with them, using some numpy and scipy magic can get you speeds that will beat naive C++ code. On the other hand, when you have custom data structures that you want to avoid unnecessarily copying, just rewriting the exact same code in C++ and passing things by reference can give you massive speedups.

    When I choose C++ over python, it’s not only because of speed. It’s also because I want a more explicitly typed language (which is easier to maintain), overloaded functions, and to actually know the memory layout of what I’m working with to some degree.








  • thebestaquaman@lemmy.worldtoMemes@lemmy.mlPiracy
    link
    fedilink
    arrow-up
    23
    arrow-down
    1
    ·
    6 months ago

    A professor at my university tried that, but the students quite quickly made a huge fuss, got the principals office involved, and the universities lawyers informed said professor that what she was doing was illegal, and that she should stop before she got any more trouble. She stopped.


  • Drake is fucked, because Kendrick has already dropped the Mr. Morale album, where he raps about his own shortcomings and relationship issues and how he’s worked to fix them. Whatever Drake says about him, it’s something he’s already been open about working to fix.

    Drake on the other hand is just dumbly denying that he’s done stuff everyone can see that he’s done, or just not addressing what Kendrick is saying at all.