• 0 Posts
  • 26 Comments
Joined 1 month ago
cake
Cake day: October 16th, 2025

help-circle



  • Great article.

    A lot of people are on the “composition over inheritance” bandwagon now, but I’ve honestly not seen a situation where I felt that inheritance was used and was the wrong choice. (Though most of my experience is in python where there’s no diamond problem, mixin classes are common, etc)

    What I noticed is that everyone seems to agree that inheriting implementation is useful, because you have that with traits in rust (which are agreed to be good, afaik), so in languages without traits, it seems reasonable to want to use the next best thing


  • They say that fitting different degree Polynomials robustly identifies inflexion points seeing 10, 30 and 80. I think they only went for a higher degree because it was “visually underfit” at lower degrees, ie no scientific basis.

    This is already after the dimensionality reduction which has its own arbitrary choice that affects what inflexion points you can identify.

    This definitely smells like “we threw some data into a bunch of statistical analysis without thinking about it and wrote down anything that looked publishable”









  • I mean how can you define a sensible way to subtract Infinity from an array, or add an object to a string?

    TypeError.

    There are also various sensible ways, for example if you have an array of floats, subtracting Infinity from the array could result in an array of the same length as the original, with each value being negative Infinity. But in general inhomogeneous types should not be addable without careful thought to create a type system which is consistent and coherent. That is exactly what JavaScript did not do.

    It doesn’t “handle bad code gracefully”; it handles it in a way that’s hard to reason about and hence hard to work with.

    The way JavaScript defines it is predictable

    You literally just failed to predict it, so I don’t think there’s any point continuing this conversation.


  • Operator overloading is a perfectly reasonable feature in a language to make use of and to assume works. If it is not going to behave sensibly, it should be an error, not nonsense, because having it work for strings but not other sequence types is surprising, and surprising is bad.

    As I said, the fact that you didn’t know the result means that JavaScript’s type system is opaque and hard to understand. You might have understood that there are some things you “shouldn’t do” but being hard to understand is a bad aspect of a language even if it doesn’t prevent you from writing correct, good code.

    By way of analogy, thing of a language which, like JavaScript, doesn’t require semicolons, but they are accepted. Except, if you use a semicolon after the last statement in a block, that statement never gets executed. Your reply is like saying, “just don’t use semicolons - they’re not needed” instead of acknowledging that an element of the language which is prone to causing mistakes is bad design.



  • Putin wants a Ukraine that is completely subservient to it. Ukraine wants to retain its independence and sovereignty. All the “deals” that the US talks about are ones that hand Russia its war aims: a rump Ukraine without any plausible guarantee that Russia will not resume attacks. If Russia can resume attacks at any time, it can pressure Ukraine into adopting policies favourable to Russia, instead of those in Ukraine’s best interests; in other words Ukraine will be subservient to Russia and not be sovereign.

    It’s basically as simple as that: why would Ukraine stop fighting, and even grant concessions to Russia like territory it hasn’t managed to conquer, in order to become a puppet regime of Russia, the very thing it has been trying to resist this entire time? The only reason would be if they are unable to continue fighting effectively and so have to choose between a slow, damaging defeat and a cleaner surrender. But this isn’t the case! The fight has been more or less in a stalemate for ages.

    Too many people, including in governments, do not understand (or are just unwilling to recognise) that it is about a fight for sovereignty, not a question of how much territory Russia gets in the end. If Ukraine is left unable to, for example, pursue a closer relationship with the EU because of the threat of Russian aggression, is left susceptible to Russification through Russian propaganda so that Ukrainian culture risks being snuffed out, there is no point in doing a deal.

    It’d be like if there was someone in your house who has just beaten you up and says if you ever so much as speak to Barbara again he’ll kill you, and the police come and say “look, just give him your wallet and both of you stop fighting!”



  • A language’s deficiencies are rarely obvious when everyone is writing it perfectly.

    But a coherent type system gives the programmer confidence - for free. Do you know what [1] + [2] is in JavaScript? Do you know what type it is? JavaScript teaches you that it has operator overloading for built-in types but then it behaves in such a dumb way you can’t use it.

    That’s explained by a desire to be extremely lenient, but it’s not justified by it. Programming langauges are generally not made by idiots, so every bad decision has an explanation.