Father, Hacker (Information Security Professional), Open Source Software Developer, Inventor, and 3D printing enthusiast

  • 2 Posts
  • 128 Comments
Joined 1 year ago
cake
Cake day: June 23rd, 2023

help-circle
  • Oh I can explain this: You were born with a destiny that doesn’t make sense anymore because the gods had to make some changes to the timeline. Sounds simple enough but some people have actually been given theirs or someone else’s prophecy so now they have to make it happen… Somehow.

    To resolve this situation they often have to come up with clever solutions to make sure the prophecy still happens in a way that the (new) timeline can handle. Such as “experiencing plague” and “getting caught rolling with a naked woman in public”.








  • without type safety your code is no longer predictable or maintainable

    This sounds like someone who’s never worked on a large Python project with multiple developers. I’ve been doing this for almost two decades and we never encounter bugs because of mismatched types.

    For reference, the most common bugs we encounter are related to exception handling. Either the code captured the exception and didn’t do the right thing (whatever that is) in specific situations or it didn’t capture the exception in the right place so it bubbles up waaaaay too high up the chain and we end up with super annoying troubleshooting where it’s difficult to reproduce or difficult to track down.

    Also, testing is completely orthogonal to types.



  • Riskable@programming.devtoProgrammer Humor@lemmy.mlBefore and after programming
    link
    fedilink
    English
    arrow-up
    6
    arrow-down
    2
    ·
    edit-2
    14 days ago

    Yeah that’s annoying but it’s a short-term problem. Python just recently cleaned up some long-standing issues that broke backwards compatibility in packaging (for certain things). Most public modules that broke made trivial changes to fix the problems (once they learned about them) and life went on.

    However, for some fucking reason a whole bunch of dependencies related to AI are dragging their feet and taking forever to fix their shit. Insisting that everyone “just use Python 3.10” and it drives me nuts too.

    This problem started to become a real thing almost two years ago (so they had plenty of warning and time to fix things) and yet here we are with still a handful of core dependencies that won’t install for things like Stable Diffusion, Flux, and various LLM stuff because they’re dragging their feet.

    I blame corporate culture: Enterprises hate upgrading their shit and they’re as slow as glaciers sometimes. There’s probably tooling at Nvidia, for example, that needs a ton of work for Torch to work with new versions of Python and since all their documentation already was written for running on Python 3.10 (and Ubuntu 22.04 LTS) they’ve created a lot of work for themselves.

    Any day now they’ll finally finish fixing all these little dependencies and then we’ll have another two years of ease before the problem rises again with Python 3.14 and it’s massive GIL-free improvements that require big changes in code to actually take advantage of them.


  • Why? The most annoying thing that I remember about it was popular modules that hadn’t been ported yet. In essence, a temporary problem; growing pains.

    The Unicode/string/bytes changes were welcome (to me). But that might just be because I had actually encountered situations where I had to deal with seemingly endless complexity and ambiguity related to Unicode stuff and encodings. Python 3 made everything much more logical 🤷


  • Riskable@programming.devtoProgrammer Humor@lemmy.mlBefore and after programming
    link
    fedilink
    English
    arrow-up
    32
    arrow-down
    12
    ·
    edit-2
    14 days ago

    Haha: “A space breaks everything.” Fuck YES! Are you kidding me‽ It’s one of the best features!

    Why? Because it’s so easy to see. In other languages you’ve got semicolons which are surprisingly difficult to notice when they’re missing. Depending on the situation (or if you’re just new to programming) you could spend a great deal of time troubleshooting your code only to find out that you’re missing a semicolon. It’s frustrating and it makes you feel stupid which is never a good thing for people who are new programming.

    Types are in a different category altogether with seemingly infinite reasons why you’d want a feature-rich, low-level type system and also why you’d want to avoid that.

    IMHO, the point of Python is to be a simple language that’s quick to write yet also very powerful and speedy when you need it to be (by taking advantage of modules written in C or better, Rust). If it had a complex type system I think it would significantly lower the value of the language. Just like how when I see an entire code repo using Pydantic and type hints everywhere it makes the code unnecessarily complex (just use type hints where it matters 🙄).

    I’m not saying using type hints on everything is a terrible thing… I just think it makes the code harder to read which, IMHO defeats the point of using Python and adds a TON of complexity to the language.

    The promise of type hints is that they’ll enable the interpreter to significantly speed up certain things and reduce memory utilization by orders of magnitude at some point in the future. When that happens I’ll definitely be reevaluating the situation but right now there doesn’t seem to be much point.

    For reference, I’ve been coding in Python for about 18 years now and I’ve only ever encountered a bug (in production) that would’ve been prevented by type hints once. It was a long time ago, before I knew better and didn’t write unit tests.

    These days when I’m working on code that requires type hints (by policy; not actual necessity) it feels like doing situps. Like, do I really need to add a string type hint to a function called, parse_log()? LOL!






  • Learning how to ride a bike as an adult can be a bit scary and much more difficult than for a child. But it isn’t rocket science! You can do it 👍

    REI has an excellent guide on learning how to ride as an adult:

    https://www.rei.com/learn/expert-advice/how-to-learn-to-ride-a-bike-as-an-adult.html

    As an experienced street and mountain rider, I read it and it makes perfect sense. Follow their advice but also:

    • Bring a first aid kit (for the large variety of bandages) and a great big tube of Neosporin/triple antibiotic ointment. There’s a chance you’ll get a scrape on your first try. It shouldn’t be anything serious (barely any pain sort of scrape) but you don’t want an infection 👍
    • Don’t try to pedal right away! Just push with your feet on the ground and get used to balancing when coasting. Also remember: There’s a threshold where you’re going fast enough to easily balance or too slow where it’s easy to fall to one side (instead of falling though, you’re an adult and will simply place your foot down after stopping by holding the brake, right? 🤣).

    Once you get used to pedaling to keep yourself going it’ll be like a switch: Before that moment you didn’t know how to ride a bike and now you do! I’m certain it’s a great feeling because I still remember it when I learned to ride as a kid! It’ll likely become a “core memory” 😁

    Don’t stop there though! Practice balancing on your bike while moving slower and slower. Get the hang of a rapid foot-down (or dismount, haha). Eventually you can get good enough to literally stand on your bike while not moving at all and that impresses other people vastly more than any other bike trick I’ve ever performed, haha. Even super experienced, professional riders will be like, “WTF! How do you even do that‽” Hahaha

    Anyone can do it it just takes lots of practice and if you try it every single time you stop it’ll eventually come naturally. Of course, you’ll look super goofy/clumsy the first hundred times (haha) but eventually you’ll have a biking superpower 😁👍

    Edit: Once you’ve decided that biking is for you take some time to learn how to do basic bike maintenance. Even if your tires are fine deflate one and take it off then put it back on. You don’t want to be figuring out how to do that in the middle of nowhere on the side of the road (and always travel with an extra tube… That’s what tiny under-the-seat bags are for!).

    Nobody likes having to change out a tube in the middle of a trail/out on the road but is inevitable if you bike a lot. Also, if you smash your wheel hard enough it can get bent enough that you can’t ride. No big deal though! Just bend it back! I used to encounter so many people on trails carrying their bikes with bent tires and I was like, “oh! Let me fix that for you…” <WHACK! WHACK! WHACK!> against a log/curb and it would be straight enough to ride on again 😁👍