Yo whatup

  • 1 Post
  • 35 Comments
Joined 1 year ago
cake
Cake day: September 28th, 2023

help-circle

  • I poked around in the registry a bit too much awhile ago and managed to delete my only user. Oops! Completely bricked my install, couldn’t even unfuck it with safe mode shenanigans. Had enough space to clone my entire drive so I just lost a couple days of time fiddling with it, only a couple hours actually copying my shit back and forth.














  • Eh? How’s that work. I’m not going to sit here and say there isn’t too many factories in Java but as a concept it’s extremely useful. You hand off a “factory” to something which actually creates the object. This is really useful in for example serialization. How so? You could register factories (mapped to some sort of ID) which get passed the serialized data and return some sort of created object. Now the core serialization code doesn’t know nor care how exactly any particular type gets serialized. Pretty nifty huh?

    Some languages have better ways to encapsulate this functionality but that’s what the factory concept is


  • No python is statically typed. You have type hints, which makes the language tolerable but like their name implies it’s a hint at the type. You can perfectly legally pass in something completely different that doesn’t conform whatsoever.

    The primary thing static languages provide is static typing, that being the ability to determine before runtime that all the types are valid. A good example of this is how C++ programs will refuse to compile if you try to invoke a method that doesn’t exist on the type. That’s because it’s statically typed. At compile time you know that the code is wrong. Dynamic languages fundamentally don’t work like that. You cannot know until runtime if the method you called or the field you are trying to touch exists or not. Again type hints help a lot with this but that doesn’t change how the language actually operates.