• 0 Posts
  • 11 Comments
Joined 1 year ago
cake
Cake day: June 14th, 2023

help-circle
  • I had a mixed experience adding types to a large enterprise Python codebase.

    I think the thing that really kills it is the (relative) lack of community support. Whereas with TS, almost every package big or small usually has types, I’ve found a lot of pip packages wouldn’t be typed out of the box, which means you gotta generate them automatically or use escape hatches like Any.

    Using escape hatches like Any basically kill the point of typing, as the static checker basically stops checking after it sees an Any. If your static checker is configured to ignore certain files because they aren’t typed yet, then any code that refers to those files also get ignored. You basically need to hit a threshold of your codebase and dependencies to get the benefits of typing. Until then, my experience was finding bugs that the type checker should’ve caught but didn’t.

    And obviously, to get the full power of types, you must buy in as a team, and that means really buy-in, without resorting to escape hatches like Any. Any reluctance, and you’re likely in for an uphill battle.

    Another thing that really hurt adoption, was that before using typing, a lot of the code just clearly broke type rules, eg a function that returns a string or a number, but the caller assumes the output is a number. Especially if it’s lower level code, those may take a nontrivial refactor to fix.

    All of this is assuming it’s trivial to enforce a static check on the codebase through CI/CD.

    This leads to my conclusion, that not being forced to use types is a BENEFIT of Python, not a downside. You are able to write code a lot faster and more expressively if you don’t need to worry about typing, for small scripts or whatnot. I think if you’re starting a project of any size and already know you want typing, consider using another language that has typing built in.






  • I just checked Airbnb prices in Austin with flexible pricing for a weekend, and the only way I could even sniff $100 a night is if I turned on “Display total price,” which factors in the cleaning fee. Turning it on rockets up the price.

    The cheapest place that gives you the whole place to yourself on Airbnb is the Holiday Inn lol.

    Which again, supports my experience of hotels being competitive. They’ve only just given you the option to turn on “Display total price,” so if you’re browsing Airbnb’s before, the price didn’t include the exorbitant cleaning fees which is how the owners hid their prices.

    Maybe worth taking a look at those receipts in your email to see if you actually paid $100 a night. If 90% of people are complaining, either your a genius or it’s actually a real issue ;)


  • True, but are Airbnb’s even cheaper than hotel rooms anymore in cities?

    Only time I’ve found that to be true is when you have a lot of people, getting a single Airbnb can be cheaper than multiple hotel rooms. Otherwise, Airbnb’s basically are similar in price or negligibly cheaper.