• 7 Posts
  • 86 Comments
Joined 2 years ago
cake
Cake day: September 7th, 2023

help-circle
  • The whole notion of CSDs is a blueprint example of what happens when UI designers try to think things through too hard. They come up with grand solutions to trivial problems that are so poorly thought through that they create even bigger problems.

    Realistically, nobody is going rewrite their entire application just because of what a tiny cabal of Gnome developers think. Just read this post that was linked elsewhere in this thread. At the end, Tobias is basically arguing that people should go out there and harass the developers of all Linux desktop applications (including the entire KDE project!) to follow through on this ridiculous idea:

    Thus, our goal is for as many apps as possible to have the following properites [sic]

    • No title bar
    • Native-looking close/maximize/minimize icons
    • Respects the setting for showing/hiding minimize and maximize
    • Respects the setting for buttons to be on the left/right side of the window

    Which apps are affected? Basically, all applications not using GTK3 (and a few that do use GTK3). That includes GTK2, Qt, and Electron apps.

    If that alone doesn’t alert people of how out-of-touch the Gnome developers are, then I don’t know what would.









  • It’s called tivoization and started with a device called “Tivo” which was the first of its kind to attempt this procedure.

    There are probably lots of hardware devices in your house that use GPL software but prevent you from actually modifying it because the hardware will refuse to run modified copies. If a piece of software is licensed GPLv3, it would violate the license terms to do something like this.


  • Yeah, I’ve seen a lot of those videos where they do things like {} + [], but why would anyone care what JS does in that case? Unless you’re a shit-ass programmer, you’re never going to be running code like that.

    By this same logic, memory safety issues in C/C++ aren’t a problem either, right? Just don’t corrupt memory or dereference null pointers. Only “a shit-ass programmer” would write code that does something like that.

    Real code has complexity. Variables are written to and read from all sorts of places and if you have to audit several functions deep to make sure that every variable won’t be set to some special value like that, then that’s a liability of the language that you will always have to work around carefully.



  • One principle I try to apply (when possible) comes from when I learned Haskell. Try to keep the low-level logical computations of your program pure, stateless functions. If their inputs are the same, they should always yield the same result. Then pass the results up to the higher level and perform your stateful transformations there.

    An example would be: do I/O at the high level (file, network, database I/O), and only do very simple data transformations at these levels (avoid it altogether if possible). Then do the majority of the computational logic in lower level, modular components that have no external side effects. Also, pass all the data around using read-only records (example: Python dataclasses with frozen=True) so you know that nothing is being mutated between these modules.

    This boundary generally makes it easier to test computational logic separately from stateful logic. It doesn’t work all the time, but it’s very helpful in making it easier to understand programs when you can structure programs this way.







  • Python’s type system is dramatically better than Javascript’s though. Try doing things like '' + True and Javascript will do incredibly stupid things. Python will just give you a type error. Also, look at things like == vs === in Javascript as well. That’s the biggest reason why Typescript replaced it overnight. Python has found a better balance between productivity and error safety.

    In my opinion, the biggest shortcoming of Python’s dynamic typing system is that you need to have very thorough test coverage to be sure that your code doesn’t have semantic errors (a lot more than, say, Java). It has gotten better with the introduction of type hints, those I don’t have much experience with them, so I can’t say how much.



  • Distribution usually isn’t considered a strong point for Python, though.

    It depends. If it’s a simple script with no external dependencies, then it’s very easy to distribute. But if your application has external dependencies and you are trying to install it on your host (and you aren’t using docker or similar technologies), then yes, it’s harder than just shipping an executable or .jar file. The fact that Python’s standard library is so comprehensive helps a lot in this regard, but it only works up to a certain point.