1. 6

    I think there are two primary reasons to learn and use a language, library, paradigm, etc.

    The first and most common is that it’s where the job market is. This might be why one chooses to learn JavaScript for example, particularly early in their career. Anecdotally, PHP roles in my city seem to be just about the worst paying, and if memory serves the Stack Overflow survey backs this up.

    The second is for enjoyment and/or intellectual intrigue. I don’t think this can apply to such a middle of the road, thoroughly mainstream language, though perhaps I’m wrong.

    I don’t mean to be rude to anyone who does like PHP by the way, I’d just advise against learning it in favour of almost any alternative for either of the above reasons.

    1. 34

      I had to stop coding right before going to bed because of this. Instead of falling asleep, my mind would start spinning incoherently, thinking in terms of programming constructs (loops, arrays, structs, etc.) about random or even undefined stuff, resulting in complete nonsense but mentally exhausting.

      1. 12

        I dreamt about 68k assembly once. Figured that probably wasn’t healthy.

        1. 4

          Only once? I might have gone off the deep end.

          1. 3

            Just be thankful it wasn’t x86 assembly!

            1. 3

              I said dream, not nightmare.

              1. 2

                Don’t you mean unreal mode?

                being chased by segment descriptors

                only got flat 24bit addresses, got to calculate the right segment bases and offsets, faster than the pursuer

          2. 6

            One of my most vivid dreams ever was once when I had a bad fever and dreamed about implementing Puyo Puyo as a derived mode of M-x tetris in Emacs Lisp.

            1. 19

              When I was especially sleep-deprived (and also on call) in the few months after my first daughter was born, I distinctly remember waking up to crying, absolutely convinced that I could solve the problem by scaling up another few instances behind the load balancer.

              1. 4

                Oh my god.

                1. 2

                  Wow that’s exactly what tetris syndrome is about. Thanks for sharing!

              2. 5

                Even if I turn off all electronics two hours before bed, this still happens to me. My brain just won’t shut up.

                “What if I do it this way? What if I do it that way? What was the name of that one song? Oh, I could do it this other way! Bagels!”

                1. 4

                  even undefined stuff

                  Last thing you want when trying to go to sleep is for your whole brain to say “Undefined is not a function” and shut down completely

                  1. 4

                    Tony Hoare has a lot to answer for.

                  2. 2

                    Different but related: I’ve found out (the hard way) that I need to stop coding one hour before sleeping. If I go to bed less than one hour after coding, I spend the remaining of the said hour not being able to sleep.

                    1. 1

                      I know this all too well. Never heard of the tetris syndrome before. I need to investigate this now right before going to bed.

                    1. 2

                      Why would one use this over FairEmail?

                      1. 7

                        UX. I’ve tried FairEmail and everything about the interface just felt wrong. I can’t point at exactly what. Just everything.

                        1. 4

                          K9 is fully open source. You can download the code, edit it, and recompile it yourself, no sweat.

                          K9 has had an awful lot of bugs ironed out of it over the last N years, and there are config workarounds for weird email servers. Many people never encounter a weird email server, or don’t recognize it as an issue.

                          1. 3

                            I don’t like FairEmail’s “pro” feature system. Besides the interface being worse for me than K-9 (personal preference there), I have K-9 setup to only notify when I receive email from a contact. That keeps my distractions low while getting good prioritization. The last time I tried FairEmail trying to setup something similar was more involved and required the “pro” features.

                            1. 1

                              I assume its because it’s one of the few Android Email clients with PGP encryption

                            1. 14

                              This was an absolutely brilliant article! It was fantastically well researched and written someone with expert knowledge of the domain. I’m learning so much from reading it.

                              The argument about representing JSON objects in SQL were not persuasive to me. I do not really understand why this would be desirable. I see the SQL approach as a more static-typed one, where you would process JSON objects and ensure they fit a predefined structure before inserting them into SQL. For a more dynamic approach where you just thrown JSON objects into a database you have MongoDB. On that note I think the lack of union types in SQL is a feature more than a limitation, isn’t it?

                              Excellent point about JOIN syntax being verbose, and the lack of sugar or any way to metaprogram and define new syntax. The query language could be so much more expressive and easy to use.

                              It totals ~16kloc and was mostly written by a single person. Materialize adds support for SQL and various data sources. To date, that has taken ~128kloc (not including dependencies) and I estimate ~15-20 engineer-years

                              I think these line counts say a lot! The extra work trying to fulfill all the criteria of the SQL standard isn’t necessary work for the implementation of a database system. A more compact language specification would enable implementations to be shorter and enable people to learn it much more easily.

                              The overall vibe of the NoSQL years was “relations bad, objects good”.

                              The whole attitude of the NoSQL movement put me off it a lot. Lacking types and structure never sounded like an improvement to me - more like people just wanted to skip the boring work of declaring tables and such. But this work is a foundation for things to work smoothly so I think the more dynamic approach will often bite you in the end. But then the author explains more about GraphQL and honestly it sold me on GraphQL, I would be very open to using that in future rather than SQL after reading this.

                              Strategies for actually getting people to use the thing are much harder.

                              This is a frustrating part about innovation in programming but honestly I believe that the ideas he has presented represent too significant an improvement that they are just too good for people not to start using.

                              1. 7

                                If you have data encoded in a JSON format, it often falls naturally into sets of values with named fields (that’s the beauty of the relational model) so you can convert it into a SQL database more or less painlessly.

                                On the other hand, if you want to store actual JSON in a SQL database, perhaps to run analytical queries on things like “how often is ‘breakfast’ used as a key rather than as a value”, it’s much more difficult, because “a JSON value” is not a thing with a fixed representation. A JSON number might be stored as eight bytes, but a JSON string could be any length, never mind objects or lists. You could create a bunch of SQL tables for each possible kind of JSON value (numbers, strings, booleans, objects, lists) but if a particular object’s key’s value can be a number or a string, how do you write that foreign key constraint?

                                Sure, most applications don’t need to query JSON in those ways, but since the relational model is supposed to be able to represent any kind of data, the fact that SQL falls flat on its face when you try to represent one of the most common data formats of the 21st century is a little embarrassing.

                                That’s what the post means by “union types”. Not in the C/C++ sense of type-punning, but in the sense of “a single data type with a fixed number of variants”.

                                1. 4

                                  A JSON number might be stored as eight bytes

                                  Sorry to nitpick, but a JSON number can be of any length. I think what you were thinking of was JavaScript, in which numbers are represented as 64-bit values.

                                  1. 1

                                    No, the json standard provides for a maximum number of digits in numbers. Yes I know this because of a bug from where I assumed json numbers could be any length.

                                    Edit: I stand corrected - I’m certain I saw something in the standard about a limit (I was surprised) but it seems there isn’t. That said various implementations are allowed to limit the length they process. https://datatracker.ietf.org/doc/html/rfc7159#section-6

                                    1. 5

                                      Which standard? ECMA-404 doesn’t appear to have a length limitation on numbers. RFC 8259 says something much more specific:

                                      This specification allows implementations to set limits on the range and precision of numbers accepted. Since software that implements IEEE 754 binary64 (double precision) numbers [IEEE754] is generally available and widely used, good interoperability can be achieved by implementations that expect no more precision or range than these provide, in the sense that implementations will approximate JSON numbers within the expected precision. A JSON number such as 1E400 or 3.141592653589793238462643383279 may indicate potential interoperability problems, since it suggests that the software that created it expects receiving software to have greater capabilities for numeric magnitude and precision than is widely available.

                                      In fewer words, long numbers are syntactically legal but might be incorrectly interpreted depending on which implementation is decoding.

                                      1. 1

                                        The ECMA-303 standard doesn’t talk about any numerical limits at all, and RFC7159 talks about implementation-specific limitations which a) is kinda obvious, because RAM isn’t unlimited in the real world and b) doesn’t buy you anything if you are implementing a library that needs to deal with JSON as it exists in the wild.

                                        So yes, JSON numbers can be of unlimited magnitude and precision and any correct parsing library better deals with this.

                                  2. 5

                                    Lacking types and structure never sounded like an improvement to me - more like people just wanted to skip the boring work of declaring tables and such.

                                    To some degree it’s the same as the arguments in favor of dynamically-typed languages. Just s/tables/variable types/, etc.

                                    Also, remember the recent post which included corbin (?)s quote about “you can’t extend your type system across the network” — that was about RPC but it applies to distributed systems as well, and the big win of NoSQL originally was horizontal scaling, i.e. distributing the database across servers.

                                    [imaginary “has worked at Couchbase for ten years doing document-db stuff” hat]

                                    1. 3

                                      The whole attitude of the NoSQL movement put me off it a lot. Lacking types and structure never sounded like an improvement to me - more like people just wanted to skip the boring work of declaring tables and such.

                                      I always thought that NoSQL came about because people didn’t feel like dealing with schema migrations. I’ve certainly dreaded any sort of schema migration that did more than just add or remove columns. But I never actually tried using NoSQL “databases” so I can’t speak about whether or not they actually help.

                                      1. 13

                                        In practice you still need to do migrations, in the form of deploying your code to write the new column in a backwards compatible way and then later removing that backwards compatible layer. The intermediate deployments that allow for the new and old code to live side by side, as well as a safe rollback, are required whether you use sql or not. The only difference is that you don’t have to actually run a schema migration. A downside of this is that it’s much easier to miss what actually turns out to be schema change in a code review, since there are not explicit “migration” files to look for.

                                        1. 10

                                          This! you’re basically sweeping dirt under the carpet. One day you’re going to have to deal with it..

                                        2. 11

                                          In my experience this leads to data inconsistencies and the need to code defensively or otherwise maintain additional application code.

                                          1. 9

                                            Not if you’re hopping jobs every 1-2 years. If you’re out the door quickly enough, you can honestly claim you’ve never run into any long-term maintainability issues with your choice of technologies.

                                          2. 3

                                            I always thought that NoSQL came about because people didn’t feel like dealing with schema migrations.

                                            I think that’s unlikely, most NoSQL people probably have no idea what schema migrations are.

                                        1. 11

                                          My number one worry with encrypted email is that I will lose access to it permanently.

                                          My number two worry with encrypted email is that nobody uses it so there’s no point.

                                          My number three worry is traffic analysis, but it’s a long way behind one and two.

                                          1. 8

                                            I’ve created so many public keys over the years because some thing (like the Ubuntu CoC or “signed” commits in GitHub) requires it and I’ve lost access to literally every one of them, mostly because I use a public key about once every five years. I would literally never set up email encryption because of your reason number one.

                                            1. 16

                                              What doesn’t help is the relative opaqueness of how gpg and its “keyring” works. With ssh it’s easy: I just have a ~/.ssh/id_ed25519 and ~/.ssh/id_ed25519.pub file, and public keys for verification are in ~/.ssh/authorized_keys. That’s pretty much all there’s to it.

                                              I’ve never lost access to a ssh key or been confused how this works. With gpg it’s so much harder.

                                              1. 5

                                                I agree with this so, so much. SSH is almost trivial to understand, and there are even concrete benefits to setting it up and using it!

                                                1. 10

                                                  It’s simple to use for simple cases but a bunch of things are complicated with SSH, for example:

                                                  • If a key is compromised, how do I revoke access to it from all of the machines that have it in their authorised-keys file?
                                                  • If I want to have one key per machine, how do I add that key to all of the machines I want it to access?
                                                  • How do I enforce regular key rollover?

                                                  You can do these things with PKI but now your key management is both complicated and very different from ‘normal’ SSH.

                                                  SSH is also solving a much simpler problem because it only needs to support the online use case. If I connect to a machine with SSH and it rejects my key, I know immediately and it’s my problem. The protocol is interactive and will try any keys I let it, so I can do key rollover by generating a new key, allowing SSH to use both, and eventually replacing the public key on every machine I connect to with the new one. If I send an encrypted email with the wrong key, the recipient gets nonsense.

                                                  The offline design is the root cause of a lot of the problems with email. It was designed for a world where the network was somewhat ad-hoc and most machines were disconnected. When my father’s company first got Interne email, they ran an internal mail server with a backup MX provided by their ISP. When someone sent an email, it would go to their ISP, when they dialed in (with a modem, which they did every couple of hours) the backup MX would forward email to them and they’d send outgoing mail, which would go via the same multi-hop relaying process. Now, email servers are assumed to be online all of the time and it would be completely fine to report to the sender’s mail client if the recipient’s mail server is not reachable and ask them to try again later. If you define a protocol around that assumption from the start, it’s completely fine to build an end-to-end key-exchange protocol in and a huge number of the problems with encrypted email go away.

                                                2. 1

                                                  With SSH however, it’s trivial to create a new key, and get it installed on the new server. Because SSH keys don’t worry about a decentralized “web of trust” in way OpenPGP does, there is no historical or technological baggage to require you carrying around your SSH keypair. I’ve been through so many SSH keys over the years on personal and corporate systems, yet never once has it ever bothered me.

                                                3. 8

                                                  This is one reason I started signing every email I send years ago and also how sign every git commit. It forces my key to be a core part of my workflow

                                                  1. 3

                                                    Similarly, I also use gpg to encrypt documents, and to encrypt passwords in pass. You’ll also rarely need to interact with it for Arch packages. Can’t beat its ubiquity.

                                                  2. 2

                                                    If you want you can make a “master” key that you keep in one place permanently and at backup locations, and then sign stuff with subkeys signed by the master key. That way you will never lose anything if you lose a subkey but not the masterkey. Not a great solution but still helpful

                                                1. 4

                                                  My email is hosted with Migadu. I sync emails down to my NAS periodically with offlineimap after which they’re backed up in Backblaze via Duplicity.

                                                  I like this approach because I can swap out my domain name provider, email host, backup provider, with minimal impact upon any of the other services.

                                                  1. 32

                                                    When an error in your code base can take down millions of users who depend upon it for vital work you should

                                                    1. Have good CI
                                                    2. Have extensive tests
                                                    3. Make small changes at a time
                                                    4. Have at least one set of extra eyes looking at your changes
                                                    1. 15
                                                      1. Make use of language features that push you towards correctness, for example static typing.
                                                      1. 8

                                                        I find it shocking how many people love “dynamic languages”

                                                        1. 7

                                                          I don’t. There’s a lot of neat tricks you can do at runtime in these systems that would require 10x more work to do at build time, because our build tools are awful and far too difficult to work with. Problem is that we only have the build-time understanding of things while we’re actually programming.

                                                          Don’t get me wrong, I disagree with taking this side of the trade-off and I don’t think it’s worth it. But I also realise this is basically a value judgement. I have a lot of experience and would expect people to give my opinions weight, but I can’t prove it, and other rational people who are definitely no dumber than me feel the opposite, and I have to give their opinions weight too.

                                                          If our tooling was better (including the languages themselves), a lot of the frustrations that lead people to build wacky stuff that only really works in loose languages would go away.

                                                          1. 7

                                                            I don’t, because I used to be one of those people. Strong type systems are great if the type system can express the properties that I want to enforce. They’re an impediment otherwise. Most of the popular statically typed languages only let me express fairly trivial properties. To give a simple example: how many mainstream languages let me express, in the type system, the idea that I give a function a pointer to an object and it may not mutate any object that it reaches at an arbitrary depth of indirection from that pointer, but it can mutate other objects?

                                                            Static dispatch also often makes some optimisations and even features difficult. For example, in Cocoa there is an idiom called Key-Value Coding, which provides a uniform way of accessing properties of object trees, independent of how they are stored. The generic code in NSObject can use reflection to allow these to read and write instance variables or call methods. More interestingly, this is coupled with a pattern called Key-Value Observing, where you can register for notifications of changes before and after they take place on a given object. NSObject can implement this by method swizzling, which is possible only because of dynamic dispatch.

                                                            If your language has a rich structural and algebraic type system then you can do a lot of these things and still get the benefits of a static type checking.

                                                            1. 2

                                                              Regarding your example, honestly I am not 100% sure that I grasp what you are saying.

                                                              In something like C++ you can define a constant object and then explicitly define mutating parts of it. But I don’t think that quite covers it.

                                                              I have enjoyed some use of Haskell a few years back and was able to grasp at least some of it. But it gets complicated very fast.

                                                              But usually I am using languages such as c# and typescript. The former is getting a lot of nice features and the latter has managed to model a lot of JavaScript behaviour.

                                                              But I have no problem admitting that type systems are restrictive in their expressibility. But usually I can work within it without too many issues. I would love to see the features of Haskell and idris, and others become widely available - but the current languages don’t seem interested in that wider adoption.

                                                              1. 3

                                                                Regarding your example, honestly I am not 100% sure that I grasp what you are saying.

                                                                In something like C++ you can define a constant object and then explicitly define mutating parts of it. But I don’t think that quite covers it.

                                                                I don’t want an immutable object, I want an immutable view of an object graph. In C++ (ignoring the fact that you can cast it away) a const pointer or reference to an object can give you an immutable view of a single object, but if I give you a const std::vector<Foo*>&, then you are protected from modifying the elements by the fact that the object provides const overloads of operator[] and friends that return const references, but the programmer of std::vector had to do that. If I create a struct Foo { Bar *b ; ... } and pass you a const Foo* then you can mutate the Bar that you can reach via the b field. I don’t have anything in the type system that lets me exclude interior mutability.

                                                                This is something that languages like Pony and Verona support via viewpoint adaptation: if you have a capability that does not allow mutation then any capability that you load via it will also lack mutation ability.

                                                                But usually I am using languages such as c# and typescript. The former is getting a lot of nice features and the latter has managed to model a lot of JavaScript behaviour.

                                                                Typescript is a dynamic language, with some optional progressive typing, but it tries really hard to pretend to be a statically typed language with type inference and an algebraic and structural type system. If more static languages were like that then I think there would be far fewer fans of dynamic languages. For what it’s worth, we’re aiming to make the programmer experience for Verona very close to TypeScript (though with AoT compilation and with a static type system that does enough of the nice things that TypeScript does that it feels like a dynamically typed language).

                                                                1. 1

                                                                  I really like the sounds of Verona.

                                                              2. 1

                                                                Strong type systems are great if the type system can express the properties that I want to enforce. They’re an impediment otherwise.

                                                                It’s not all-or-nothing. Type systems prevent certain classes of errors. Tests can help manage other classes of errors. There’s no magic bullet that catches all errors. That doesn’t mean we shouldn’t use these easily-accessible, industry-proven techniques.

                                                                Now, static typing itself has many other benefits than just correctness–documentation, tooling, runtime efficiency, enforcing clear contracts between modules being just a few. And yes, they do actually reduce bugs. This is proven.

                                                              3. 4

                                                                We have somewhat believable evidence that CI, testing, small increments, and review helps with defect reduction (sure, that’s not the same thing as defect consequence reduction, but maybe a good enough proxy?)

                                                                I have yet to see believable evidence that static languages do the same. Real evidence, not just “I feel my defects go down” – because I feel that too, but I know I’m a bad judge of such things.

                                                                1. 1

                                                                  There are a few articles to this effect about migrations from JavaScript to TypeScript. If memory serves they’re tracking the number of runtime errors in production, or bugs discovered, or something else tangible.

                                                                  1. 1

                                                                    That sounds like the sort of setup that’d be plagued by confounders, and perhaps in particular selection bias. That said, I’d be happy to follow any more explicit references you have to that type of article. It used to be an issue close to my heart!

                                                                    1. 1

                                                                      I remember this one popping up on Reddit once or twice.

                                                                      AirBNB claimed that 38% of their postmortem-analysed bugs would have been avoidable with TypeScript/static typing.

                                                                  2. 1

                                                                    Shrug, so don’t use them. They’re not for everyone or every use case. Nobody’s got a gun to your head. I find it baffling how many people like liquorice.

                                                                    1. 1

                                                                      Don’t worry, I don’t. I can still dislike the thing.

                                                                2. 6

                                                                  And if you have millions of users, you also have millions of user’s data. Allowing unilateral code changes isn’t being a good steward of that data, either from a reliability or security perspective.

                                                                1. 1

                                                                  Link dead for me, can’t resolve host. Anyone else?

                                                                  1. 52

                                                                    The question is, what is the alternative? I see two main funding models:

                                                                    Paywalls. You pay with your money.

                                                                    Ads. You pay with your attention.

                                                                    It’s also possible to fund projects through donations, or as hobbies, but producing most of what there is to read requires more money.

                                                                    Has capitalism really progressed so far that we can no longer even conceive of collective funding models? No wonder people put up with privatised prisons, schools and healthcare systems.

                                                                    Yes I am suggesting software/news/services could be funded from taxes. Content that is a necessary part of our social infrastructure should be. Content that serves only a luxury/entertainment purpose could be covered by art grants to supplement the models the author listed.

                                                                    Increasingly we require certain software and internet services to function in society, we should view this as basic infrastructure.

                                                                    1. 9

                                                                      Let us be distinct about funding infrastructure maintenance compared with funding software development or other artistic production. Then, indeed, infrastructure could be maintained through taxes in a non-controversial application of socialist logic. However, the design of that infrastructure will be by committees and incumbent power structures. Similarly, art grants could be extended to software authors, with all of the controversy over ownership and licensing that would result.

                                                                      But for infrastructure, there’s at least one additional option, which is perhaps more communist than socialist: the cooperative. The Bittorrent network is a popular example; folks each contribute a small amount of bandwidth and disk space, and create a vast content-distribution network which becomes faster and more available as content keys become hotter.

                                                                      1. 4

                                                                        However, the design of that infrastructure will be by committees and incumbent power structures.

                                                                        Socialism is all about upsetting the incumbent power structure and putting the people in charge. In recent conceptions this has included nationalising utilities and putting them under the control of a board of stakeholders including service users, workers, and government (Labour party, 2019). There’s also the municipal socialism model where this is devolved to a local level (and quite a few essential services are delivered by municipally owned organisations, some of which are even meaningfully democratic).

                                                                        Sure, there will still be committees, but there’s no reason that they have to be more onerous than they are in capitalist organisations. There’s nothing stopping a small group from doing its own thing and then trying to persuade the world to adopt it, indeed, if you don’t need to devote less of your time to wage labour you have more capacity to do such things and if the stakeholders don’t need surveillance capitalism then there should be less of an incentive mismatch.

                                                                        Small aside: Lots of socialist parties support the co-operative movement. The Labour party in the UK has been in electoral coalition with the co-operative party for decades.

                                                                        1. 2

                                                                          For an implementation that’s a lot closer in spirit to what you describe, see freenet.

                                                                        2. 8

                                                                          I’ve noticed a similar phenomenon when discussing English football (soccer) in the aftermath of the attempt to form a breakaway league. (If you aren’t following it, the short version is that some historically profitable clubs tried to start a new league from which they cannot be relegated to guarantee their income, where the “they” in “their” is the owners who treat it as a business rather than the cultural entity it is.)

                                                                          Any ideas that in any way restrict the freedom of the owners of these clubs - culture and wider society be damned - are out of the question.

                                                                          We are now so deeply within this economic orthodoxy that we can no longer conceive of ideas that don’t neatly fit within it.

                                                                          1. 7

                                                                            Has capitalism really progressed so far that we can no longer even conceive of collective funding models? No wonder people put up with privatised prisons, schools and healthcare systems.

                                                                            Yes I am suggesting software/news/services could be funded from taxes. Content that is a necessary part of our social infrastructure should be. Content that serves only a luxury/entertainment purpose could be covered by art grants to supplement the models the author listed.

                                                                            We could fund things that way, and maybe we should fund things that way. But we aren’t funding things that way, which means that for right now there are only a handful of practical funding models that work, and none of them are good.

                                                                            1. 5

                                                                              Paywalls. You pay with your money.

                                                                              These are annoying indeed but there are plenty of websites where you pay for content but can freely share a number of articles each month or so with non-subscribers, like LWN or The Correspondent. There are plenty of people paying them. And no ads!

                                                                              Ads. You pay with your attention.

                                                                              Like others say, this completely bypasses the deeply invasive ways ads on the internet track you. See also this other post showing how Facebook doesn’t even want to expose this to users because they’re too ashamed of it.

                                                                              It also ignores the “user experience” of ads, which is often terrible - making your machine slow, hijacking your attention with big boxes that you have to click away etc. I don’t mind a well-designed ad here and there like you used to have in magazines, but the current ad experience is just hellish.

                                                                              1. 5

                                                                                It also ignores the “user experience” of ads, which is often terrible - making your machine slow

                                                                                Indeed we collectively pay for ads through bandwidth and power consumption. Why is this never factored in?

                                                                                1. 4

                                                                                  The Cost of Mobile Ads on 50 News Websites estimated ads are >50% of mobile data usage.

                                                                                2. 4

                                                                                  Ads. You pay with your attention.

                                                                                  Like others say, this completely bypasses the deeply invasive ways ads on the internet track you.

                                                                                  It’s not just the tracking. Ads are intentionally manipulative. A lot of the techniques in modern advertising date back to the propaganda techniques from the early 20th century and have been progressively refined. There are benign ads, which try to inform customers and rely on the fact that the product serves a real need and is better than the competition for a specific use, but they’re in the minority. The vast majority are using psychological tricks to try to manipulate people into spending money.

                                                                                  If your motivation for working on ads is rooted in the idea that there’s a lot of wealth disparity and so a lot of people who couldn’t afford paywalled content, maybe you shouldn’t work in an industry that’s predicated on finding the most vulnerable people in society and taking money from them?

                                                                                3. 3

                                                                                  Can you give more detail on how you would have government funding of media without government control of the media? Maybe a dedicated tax, the way the BBC is authorized to collect an annual fee from anyone in the UK who owns a television?

                                                                                  Maybe it’s better to have a media landscape beholden to a government which we (in the US) mostly elect than one beholden to a few giant ad companies, but not that much better.

                                                                                  1. 2

                                                                                    Here are some options:

                                                                                    1. Make them financially independent by giving investments or a trust fund rather than recurring grants (this is how The Guardian (partially) funds itself, and how many universities and charities in the USA are funded)
                                                                                    2. Encourage individuals to do the funding (this is how lots of public broadcasting in the USA is funded now, especially in the US. Possibly increase minimum wage or issue vouchers to get more funding from poorer people)
                                                                                    3. Get a more trustworthy government (Proportional representation, better parties, funding reform, gerrymandering, etc, etc)

                                                                                    I’d also argue that the existing corporate media in the USA is beholden to government, or at the very least has a deeply untrustworthy relationship with it. The corporate media are well known for uncritically repeating lies fed to them by intelligence officers (Glenn Greenwald and others have written about this often) and political journalists are dependent on “access” to government ministers and officials for their stories, which requires them to be chummy with the people they are supposedly holding to account.

                                                                                  2. 2

                                                                                    I once asked an economist doing monetary policy studies for African nations how she thought the world could work without currency (a la Star Trek, or similar) and she legit could not concieve of such a thing, said it was impossible.

                                                                                    1. 1

                                                                                      Well, she would’ve probably thought of something like the Economic Calculation Problem and decided it wasn’t worth her time to solve…

                                                                                      1. 1

                                                                                        You have the same failure of imagination. Conceivably, a post-scarcity world where you have a matter replicator at home and you can just walk up to it and say what you want and it gets fabricated for you on the fly would conceivably not need a market, hence its absence in Star Trek TNG for example.

                                                                                        It’s ridiculously far-fetched, but it’s just an exercise in imagination. We’re as a society so fixated on current economics and politicization, we can’t even conceive of different systems. Is what we have now the end state? If so, we’ve stopped dreaming and evolving.

                                                                                        1. 3

                                                                                          I was going to make some joke about fully-automated luxury communism or the like but thought we were talking from within the bounds of possibility.

                                                                                  1. 10

                                                                                    The arresting thing on this article (I largely disagree with, though understand and appreciate, the author’s argument) is the first comment:

                                                                                    Advertising is bad because it’s fundamentally about influencing people to do things they wouldn’t do otherwise

                                                                                    The same can be said about schools, parenting, democracy, and having arguments on tech blog discussion threads.

                                                                                    1. 7

                                                                                      The motivation is what’s relevant.

                                                                                      In that sense, as much as they annoy me, religious preachers are less annoying than advertisers.

                                                                                      And you’ve touched upon it but it’s even more questionable when applied to democracy/politics. To call that a grey area would be an understatement.

                                                                                      1. 4

                                                                                        In civilised countries there are at least laws governing standards for adverts. You can’t claim your chocolate bar or miracle drug will cure a disease without proof.

                                                                                        Religious preachers have no such limitations.

                                                                                        1. 3

                                                                                          In the UK, there are a lot of restrictions on where those laws apply. Getting them enforced for anything online is really hard, especially given that the ad may show up only for a small number of people and may be paid for by someone in a different country.

                                                                                          1. 2

                                                                                            I’m pretty sure warm beer discounts the UK from the “civilised” qualifier anyway :-P

                                                                                            1. 1

                                                                                              Taste buds stop responding when they get cold. If your beer is so bad that you have to deaden your tastebuds to be able to stomach it, then you might consider trying better beer. The US started chilling beer during prohibition for precisely this reason: it was so bad that you couldn’t drink it at room temperature and had to chill it so that you couldn’t taste it as much.

                                                                                              1. 1

                                                                                                (a) You couldn’t pay me to drink American ‘beer’.

                                                                                                (b) I agree completely with your hypothesis, because as we all know, ice cream is tasteless. /s

                                                                                    1. 5

                                                                                      Oof visiting https://ema.srid.ca/ in firefox with noscript does not inspire confidence.

                                                                                      I’ve looked at a bunch of static site generators and I’m coming around to the point of view that it is a rite of passage to write your own. That way you know the code and can extend it in whichever way you please.

                                                                                      1. 3

                                                                                        Oof visiting https://ema.srid.ca/ in firefox with noscript does not inspire confidence.

                                                                                        This is not Ema’s fault, which doesn’t dictate how you render your HTML or CSS; your site can be as simple as a single index.html containing nothing but <b>Hello</b>.

                                                                                        It is just that the website’s code lazily (out of convenience) uses the twind JS shim for applying Tailwind styles by using the helper. I’d like to create a new project that creates type-safe Haskell wrapper for Tailwind, as well as acts as a “compiler” that produces the final CSS asset based on the usage in generated HTML, similar to how windicss’s compiler does it.

                                                                                        1. 1

                                                                                          My site (https://samhh.com) is currently written in Gatsby, which made sense at the time as I’m most familiar with TypeScript and React. I’ve had a look at rewriting it in Hugo, and it mostly works now locally, but there are almost as many gotchas and questionable design decisions which is disappointing.

                                                                                        1. 6

                                                                                          It is exactly how much time it takes with Haskell if you are surrounded by other engineers who use it 2, but if an engineer learns Haskell on their own, they usually get stuck.

                                                                                          This is how I feel about a ton of things in computing. It’s also why SO is so popular, I think. Very often I “get” everything (to the extent I need to), but I have one specific question, or one error message, that I need resolved before I can feel productive. Or I have built up a personal mental model and I want to run it by someone to make sure it is correct (enough).

                                                                                          There’s nothing quite like having access to someone who knows more than you to accelerate learning.

                                                                                          1. 4

                                                                                            Heads up for anyone trying to learn anything FP-related, I found the FP Slack super useful for this when learning Haskell.

                                                                                            1. 3

                                                                                              There’s access to the knowledge but there’s also a lot of culture in programming languages that you learn much more quickly by contact. All of the “best practise” cargo cult stuff that you only learn by questions answered by “we usually solve that by…” and “don’t use feature X” and “everybody uses ____ library”

                                                                                            1. 27

                                                                                              I have tried and failed several times over the years to pick up Haskell. It wasn’t until last year when I started using the Haskell Language Server with VS Code that it all finally clicked! Compared to just using :t in ghci, HLS massively accelerated my ability to tinker with the language. I can hover to see the type (and the specialized type) of anything! Type holes! Instant error messages when something is wrong! I don’t need to constantly :load my modules when making changes! It’s fantastic!

                                                                                              The other thing that helped was reading through the page on Haskell denotational semantics.

                                                                                              1. 3

                                                                                                Yes, HLS is great. Type on mouse-over (or type-at-point in emacs land) & immediate error messages make for a really powerful combination when writing Haskell.

                                                                                                1. 1

                                                                                                  Sounds like what I had with Emacs, until they decided to break all existing tooling in favour of LSP/HIE…

                                                                                                  1. 7

                                                                                                    HLS adheres to the LSP protocol so you should have no problems getting it set up on Emacs.

                                                                                                    It’s at the point now on Neovim that I can just add a single line of configuration to enable interoperation with a new language server.

                                                                                                1. 1

                                                                                                  honestly stuff like this is one reason why I eventually stopped using linux on my desktop. I wanted new software but I didn’t want to install arch (I know about flatpak/appimage but that didn’t solve everything for me because reasons).

                                                                                                  1. 7

                                                                                                    Curious why you’d rather leave the ecosystem rather than run Arch, Debian Testing, or another distro with focus on freshness?

                                                                                                    I mean, do what you like of course. Just curious since you called it out.

                                                                                                    1. 3
                                                                                                      • arch: don’t want to have to subscribe to a mailing list in case of breaking changes
                                                                                                      • debian testing and other distros: not as well supported for me as ubuntu, sure i could download and build source for the stuff I use but I really couldn’t be bothered
                                                                                                      1. 8

                                                                                                        I use and love Arch but it still bugs me that Gentoo (not known for being the easiest of distros to use) gets eselect news read and automated warnings about important changes, and the official Arch answer is still “It broke? You should have checked the website before you updated”.

                                                                                                        1. 4

                                                                                                          I’m on the announce mail list, but even then, I don’t always check email before upgrading.

                                                                                                          Instead, I deal with it when it happens. Having busybox and pacman-static installed, breakage would have to be very bad to not be quickly fixable.

                                                                                                          Sure, I used Gentoo unstable for some 15 years before adopting arch as my main system, so my pov might be a little abnormal.

                                                                                                          1. 2

                                                                                                            But what is the envisioned functionality here? Do you just want something like pacnews to list out arch-announce or are you after something integrated with pacman? The former can be done by the week, but pacman is not really Arch specific and it doesn’t make sense to support something like that upstream.

                                                                                                          2. 5

                                                                                                            YMMV but I’ve had less breakage with Arch than I’ve had with Ubuntu, macOS, or Windows. I think it’s because the rolling release model prevents issues from clustering into large, hard-to-debug groups as you have with most other distros and OS’.

                                                                                                            1. 1

                                                                                                              arch: don’t want to have to subscribe to a mailing list in case of breaking changes

                                                                                                              What’s wrong with following the low-traffic announce mail lists of projects you depend on?

                                                                                                              1. 3

                                                                                                                What’s wrong with following the low-traffic announce mail lists of projects you depend on?

                                                                                                                I’d rather just use my pc without doing that.

                                                                                                          3. 1

                                                                                                            I’m curious as to what your using how and how does it solve stuff like this for you?

                                                                                                            1. 1

                                                                                                              I switched back to windows

                                                                                                              every app i need only comes in one form, exe’s with manual or automatic updates

                                                                                                              also warzone runs on it which is nice/not nice for my productivity

                                                                                                          1. 1

                                                                                                            I’ve made some contributions to projects that don’t yet adhere to the XDG specification, a pet peeve of mine.

                                                                                                            I’ve migrated my project bangin to sourcehut, and have become a paid user. I’m doing so principally to limit GitHub’s hegemony but have been pleasantly surprised by a few things including the build system.

                                                                                                            I’ve got Element (Matrix client) running locally so that I can potentially contribute to it.

                                                                                                            I’ve also got aerc, an email client, running off of a dev build with a few of my own print statements inserted to try and debug an obscure bug that I and someone else have noticed.

                                                                                                            I love contributing to open source but I don’t love JavaScript or Go. I’m hoping to find some Haskell projects to contribute towards.

                                                                                                            1. 10

                                                                                                              This reminds me of the long and repetitive text editing tasks that got easier when I had learned vim well enough. I had less resistance to begin. Teammates do tend to view the results or the process as wizardry.

                                                                                                              1. 6

                                                                                                                Great example. In my experience it also reminds me of learning Haskell (or another pure functional lang) in that it’s frustrating at first but if you just stick with it it gets much, much easier and makes a great addition to your skill set. Also similar is the Rust borrow checker, though that is less frustrating.

                                                                                                                1. 5

                                                                                                                  I can relate to both of these. Another that comes to mind is Linux, and perhaps particularly in terms of how it appears to the casual observer the usage of a TWM and a terminal-centric workflow.

                                                                                                                  Oh, and touch typing on a keyboard without printed keys. I learned to type properly last year after two decades of hunt-and-peck typing, and now - paired with the above - my partner often tells me I look like a wizard.

                                                                                                                  But it’s just a case of lots and lots and lots of repetition.

                                                                                                                  1. 1

                                                                                                                    Now get yourself some Linear A keycaps and really look like a wizard!

                                                                                                                    1. 1

                                                                                                                      I have runes on mine. Which in addition is 40% ortho. It feels exactly the same to use it among people.

                                                                                                              1. 2

                                                                                                                First things first, static typing eliminates the need for things like testing what happens in the case of bad inputs. You can leverage the type system to encode invariants and make certain classes of bugs impossible. Make use of it. Learn to love the compiler.

                                                                                                                We unit test whatever can be purely unit tested where there’s value. This is aided by pushing effects and any type unsafeties to the edge of the application. TDD for the sake of it isn’t helpful in my view. This is with Jest, which I don’t love or hate. I’d recommend fast-check for integrating property-based tests, they’re still not very common but they do catch bugs your manual test cases will miss. They can also be documentative in expressing the anticipated properties of your functions.

                                                                                                                We don’t bother with component tests or anything like Storybook. I consider this a blind spot; there was talk of a more company-wide approach but that seems to have stalled, so we may revisit it as a team.

                                                                                                                We’ve got some integration tests written with react-testing-library. It’s a bit fiddly to write but they provide a high degree of confidence that the page-level components work properly. In an ideal world for me we’d have a more robust effect mocking system (a la the typeclass approach in PureScript), but manual API mocks work fine.

                                                                                                                There are some E2E tests incl/ snapshots written by QA as well. Ideally these would be written by frontend devs so there’s less friction but we can’t really justify moving away from what we have now (Java-based).

                                                                                                                I personally write tests at the end instead preferring type-driven development. I’d probably be test-driven in a dynamically-typed language.

                                                                                                                1. 2

                                                                                                                  First things first, static typing eliminates the need for things like testing what happens in the case of bad inputs. You can leverage the type system to encode invariants and make certain classes of bugs impossible. Make use of it. Learn to love the compiler.

                                                                                                                  Absolutely agree, but it’s important to keep in mind that Typescript (and I believe several other typed compile to js options) have intentionally allowed areas of unsoundness into their type systems in order to provide js compatibility in various places. That doesn’t invalidate this point, but it does mean you have to understand where there could still be runtime type errors that the language doesn’t prevent, and know when/how to test against them. It isn’t just a case of “I use types, so I don’t need to test.”

                                                                                                                  1. 2

                                                                                                                    Absolutely.

                                                                                                                    In the case of TypeScript, strict everything including newer features like no unchecked indexed access significantly reduces the scope of unsafety in well written code. Encoding errors in Either as opposed to throwing is helpful for ensuring the unhappy path is cared for. Then the largest challenge is socially enforcing care with poorly typed APIs and foreign data.

                                                                                                                    It’s doable, but if the team were willing to use a stricter language I’d be all for it.

                                                                                                                1. 2

                                                                                                                  Between 1998 (when a friend that was doing his MSc with the Haskell team) and 2020 I tried three times to seriously learn Haskell. I failed. I do understand the benefits of knowing about it, but all three efforts depressed me a lot.

                                                                                                                  That being said, I am not advising anyone against learning it.

                                                                                                                  1. 4

                                                                                                                    i’ve tried and failed 3 times in 3 years, and the 4th time it clicked :)

                                                                                                                    1. 4

                                                                                                                      I failed twice before succeeding. It is very normal. For me, https://haskellbook.com did the trick. It is slow and involves a lot of exercises, but it actually made it pretty easy in the end.

                                                                                                                      Also, I joined a company with some Haskell devs who helped me stay motivated. I think instead you can just join the FP slack or discord to get help.

                                                                                                                      1. 2

                                                                                                                        Seconding the FP Slack, it’s a really friendly place with a bunch of different communities. The fp-ts author hangs out there for example.

                                                                                                                      2. 3

                                                                                                                        Come to the #haskell IRC channel and ask questions? I’ve seen many people succeed in learning Haskell that way! It worked for me!

                                                                                                                      1. 10

                                                                                                                        Not quite what you’re asking for, but Fastmail is an email service that offers the multiple addresses thing as a feature out of the box. foo@myname.example.com goes to the same inbox as myname@example.com. Just required a couple of DNS entries.

                                                                                                                          1. 1

                                                                                                                            TIL and I have been using fastmail for 5 years.. Thanks for sharing!

                                                                                                                          2. 3

                                                                                                                            Also Migadu!

                                                                                                                          1. 73

                                                                                                                            Honestly, for a general-purpose laptop recommendation, it’s hard to recommend anything but the new ARM MacBooks. […] I just hate the cult of personality around built around a ThinkPad that only exists as a shadow in a cave.

                                                                                                                            Do you want to tell him or shall I?

                                                                                                                            1. 17

                                                                                                                              Tell me about what?

                                                                                                                              My recommendations are tempered by things like Mac OS (every OS sucks in its own unique ways), but they’re the fastest laptops you can get, get actual all-day battery life without ceremony, are lightweight, and have good build quality. This is based around actually using one as my everyday laptop - Apple really has made significant improvements. Unless someone has other requirements (i.e pen, x86 virt, etc.), they’re good all-around.

                                                                                                                              1. 52

                                                                                                                                The quote is just kind of funny to read since Apple products have been almost synonymous with fanboyism and cultish followings for decades, while the thinkpad crowd has levied that exact same criticism.

                                                                                                                                I mean personally I don’t actually disagree with you, I think Apple makes good hardware and “thinkpad people” have gotten just as bad as “apple people” in terms of misguided brand loyalty. It’s just funny because what was quoted feels like very much a role reversal in a very long standing trend.

                                                                                                                                1. 27

                                                                                                                                  Maybe it’s just my circles but I don’t see Apple fanboyism as much as I see “anti-Apple” fanboyism.

                                                                                                                                  1. 46

                                                                                                                                    That’s because you hang out on sites like Lobsters.

                                                                                                                                    1. 5

                                                                                                                                      Honestly, the “Apple fanboys” are nowadays mostly one of those things that “everybody knows” despite not really bring true. Sure, you can find the occasional example, but you’re more likely to find a handful of mildly positive comments about Apple and then a hundred-comment subthread shitting on both Apple and “all these fanboys posting in here”. And basically any thread about laptops will have multiple subthreads of people loudly proclaiming and getting upvoted and lots of supportive replies for saying Apple is evil, Apple’s hardware and software are shit, everybody should run out and switch to Thinkpads.

                                                                                                                                      Which is just kind of amusing, really.

                                                                                                                                  2. 16

                                                                                                                                    The quote is just kind of funny to read since Apple products have been almost synonymous with fanboyism and cultish followings for decades

                                                                                                                                    Yes, and I think the M1 is a prime example of the hype, further boosted by Apple’s following. The M1 is a very impressive chip. But if you were only reading the orange site and some threads here, it is many generations ahead of the competition, while in reality the gap between recent AMD APUs and the M1 is not very large. And a substantial amount of the efficiency and performance gap would be closed if AMD could actually use 5nm production capacity.

                                                                                                                                    From the article:

                                                                                                                                    Honestly, for a general-purpose laptop recommendation, it’s hard to recommend anything but the new ARM MacBooks.

                                                                                                                                    Let’s take a more balanced view. The M1 Macs are great if you want to run macOS. ThinkPads (and some other models) are great if you want to run Windows or Linux.

                                                                                                                                    1. 13

                                                                                                                                      Do the competitors run fanless?

                                                                                                                                      I’m happy with my desktop so I don’t have a stake in this game, but what would appeal to me about the M1 non-Pro Macbook is the fanless heat dissipation with comparable performance.

                                                                                                                                      1. 7

                                                                                                                                        I mean are there actually laptops that are running super long like the M1? Even back with the Air for me Macs having reliable long batteries was a huge selling point compared to every other laptop (I know they throttle like crazy to do this, but at least the battery works better than other laptops I have owned) . I think Apple deserves loads of praise for shopping laptops that don’t require you to carry your charger around (for decent time frames relative to competition until maybe super recently)

                                                                                                                                        Full disclaimer: despite really wanting an M1’s hardware I’m an Ubuntu user so…

                                                                                                                                      2. 5

                                                                                                                                        I don’t have any brand loyalty towards thinkpads per se but rather the active community of modifications and upgrades. There are things like the nitropad (from nitrokey) that is preinstalled with HEADs and has some minor modifications or refurbishing as well as many other companies are selling second hand thinkpads in this way, but I think nothing beats xyte.ch (where I got my most recent laptop).

                                                                                                                                        The guy is an actual expert and will help you chose the modifications you want (for me I wanted to remove bluetooth, microphone, put an atheros wifi so I can use linux-libre, change the CPU to be more powerful, also the monitor changed to 4k and there were other options also.. like maybe putting an FPGA like fomu in the internal USB of the bluetooth or choices around the hard drives and ports you want) after choosing my mods and sending him 700$ he spent a month doing all my requested changes, flashing libreboot/HEADs and then fedexed it to me with priority.

                                                                                                                                        This was my best online shopping experience in my life and I think this kind of stuff will never exist for apple laptops.

                                                                                                                                        1. 3

                                                                                                                                          Hmm fanboyism. Must fight… urge to explain… why PCs are better than laptops. :-p

                                                                                                                                          1. 1

                                                                                                                                            Oh, I know all about the dumb fanboy shit. I’ve at least outlined my reasoning as pragmatic instead of dogmatic, I hope.

                                                                                                                                        2. 12

                                                                                                                                          I just really like running Linux. Natively, not in a VM. I have a recent P14s running Void Linux with sway/wayland and all the hardware works. I know there’s been some effort to get Linux working on the new M1 chips/hardware, but I know it’s going to be mostly out-of-the-box for modern Dell/Thinkpad/HP laptops.

                                                                                                                                          With Microsoft likely jumping ship over to ARM, I’m really hoping Linux doesn’t get completely left behind as a desktop (laptop) OS.

                                                                                                                                          1. 8

                                                                                                                                            It seems like some people mistake the appreciation of quality Apple hardware for a cult.

                                                                                                                                            1. 18

                                                                                                                                              It may seem like that, but isn’t. Of the two Macs I currently own, one is in for repair (T2 crashed, now won’t boot at all) and one has been (CPU would detect under voltage and switch off with only one USB device plugged in). Of the ~80 Macs I’ve ever deployed (all since 2004), five have failed within two years and a further three have had user-replaceable parts DOA. This doesn’t seem like a great strike rate.

                                                                                                                                              BTW I’ve been lucky and never had any of the recall-issue problems nor a butterfly keyboard failure.

                                                                                                                                              1. 2

                                                                                                                                                While I strongly prefer my Dell Precision (5520), I haven’t really had the same experiences as you.

                                                                                                                                                I have a work laptop which is a MacBook and gets a bit toasty - but I use it every day and have not had any issues so far.

                                                                                                                                                My own laptop was a 2011 MacBook Pro and it took spilling a glass of wine on it to kill it, prior to that there were no problems. Once I did break the keyboard by trying to clean it and had to get it repaired. Maybe it was getting slow and there was some pitting on the aluminium where my hands laid (since I used it every day for 6 years). It died in 2017.

                                                                                                                                                Those are the two MacBooks I owned

                                                                                                                                              2. 9

                                                                                                                                                There might be some selection bias at work, but I have been following Louis Rossmann’s youtube channel and I absolutely do not associate Apple with good quality.

                                                                                                                                                1. 6

                                                                                                                                                  Louis Rossman has a vested interest in repairable laptops as he runs a repair shop and Apple is actively hostile to third-party repairs.

                                                                                                                                                  Not saying what Apple does is good for the consumer (though it’s often why resale value of their laptops is high)- but I would assume that Louis is the epitome of a biased source.

                                                                                                                                                2. 5

                                                                                                                                                  I have used MacBooks from 2007-2020. I had two MacBooks with failing memory, one immediately after purchase, one 1-2 months after purchase. I also had a MacBook Air (pre-butterfly) with a failing key. I had a butterfly MacBook Pro with keys that would often get stuck.

                                                                                                                                                  The quality of average is very average. I think the number of problems I had with MacBooks is very average for laptops. However, Apple offers really great service (at least here in Western European countries), which made these hardware issues relatively painless to deal with.

                                                                                                                                                  1. 5

                                                                                                                                                    Apple doesn’t merely make good hardware, it makes Apple hardware, in that its hardware is often different from the mainstream. Butterfly keyboards, for example, or some of their odder mouse designs. it’s possible to appreciate good hardware without thinking Apple’s specific choices are worth buying, even if you concede they’re good implementations of those choices you dislike.