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

help-circle

  • Here’s a tip on good documentation: try to write the documentation first. Use it as your planning process, to spec out exactly what you’re going to build. Show the code to people (on GitHub or on a mailing list or on lemmy or whatever), get feedback, change the documentation to clarify any misunderstandings and/or add any good ideas people suggest.

    Only after the docs are in a good state, then start writing the code.

    And any time you (or someone else) finds the documentation doesn’t match the code you wrote… that should usually be treated as a bug in the code. Don’t change the documentation, change the code to make them line up.



  • Sure we can make a different ticket for that to move this along, but we’re getting product to agree first.

    Ooof, I’m glad I never worked there.

    QA’s job should be to make sure the bugs are known/documented/prioritised. It should never be a roadblock that interrupts work while several departments argue over what to do with a ticket.

    Seriously who cares if the current ticket is left open with a “still need to do XYZ” or it gets closed and a new one is open “need to do XYZ”. Both are perfectly valid, do whichever one you think is appropriate and don’t waste anyone’s time discussing it.



  • If any of that is part of the hiring process - I don’t want the job.

    If HR is incompetent enough to consider things like relationship status or political opinions then what other bullshit policies does the company have? It’s probably the tip of the iceberg.

    By far most important thing is to have good colleagues, because without good colleagues your job will be miserable or the company will not last (or both). Made the mistake of working for a shitty job at high pay once and it was one of the worst decisions of my life.

    Don’t waste your life working for incompetent companies.

    Also, as someone who has hired programmers… if you have a public profile, and it doesn’t make you look hopelessly incompetent, then your application is going onto my shortlist.


  • Bus beats the pants off light rail in just about every respect you can think of

    Um, no. The only reason I would ever set foot on a bus is if there was no rail option.

    It’s quickly scalable up and down

    It really isn’t.

    it can be rerouted on a whim

    I was on a bus that was rerouted once - when a road closed unexpectedly. We were 10 minutes drive from home, and the new route took us 20 minutes in the opposite direction, we waited 30 minutes for a bus that could drop us off 45 minutes walk from home. Including the original bus trip it was about three hours and by the time we got home we were dangerously dehydrated (we had water with us, but not three hours worth).

    The ability to reroute buses is not a positive attribute. It sucks.

    it doesn’t require additional road or electrical infrastructure to operate

    Yeah it does. You need bus stops. Bus lanes. And these days you need totally do need electrical infrastructure — according to my city, the total cost to the tax payer for diesel vs electric works out to $70,000 per bus if it’s electric… and that includes spending a fortune on electrical infrastructure upgrades to be able to charge those huge batteries. Batteries a train doesn’t need because they would never go hours between charging the train.

    Spare parts are plentiful and the parts economy is competitive, maintenance overheads are lower, the fleet is amenable to reuse in non-PT contexts, etc.

    I don’t really see how busses are that different from trains. Pretty much the only difference is metal wheels vs rubber wheels. I would think the metal ones last longer.


    Ultimately, a bus is always slower than driving. Light rail, on the other hand, is often faster than driving.


  • Yeah I’ve given up on integration tests.

    We have a just do “smoke testing” — essentially a documented list of steps that a human follows after every major deployment. And we have various monitoring tools that do a reasonably good job detecting and reporting problems (for example, calculating how much money to charge a customer is calculated twice by separate systems, and if they disagree… an alert is triggered and a human will investigate. And if sales are lower than expected, that will be investigated too).

    Having said that, you can drastically reduce the bug surface area and reduce how often you need to do smoke tests by moving as much as possible out of the user interface layer into a functional layer that closely matches the user interface. For example if a credit card is going to be charged, the user interface is just “invoice number, amount, card detail fields, submit, cancel”. And all the submit button does is read every field (including invoice number/amount) and send it to an API endpoint.

    From there all of the possible code paths are covered by unit tests. And unit tests work really well if your code follows industry best practices (avoid side effects, have a good dependency injection system, etc).

    I generally don’t bother with smoke testing if nothing that remotely affects the UX has changed… and I keep the UX as a separate project so I can be confident the UX hasn’t changed. That code might go a year without a single code commit even on a project with a full time team of developers. Users also appreciate it when you don’t force them to learn how their app works every few months.




  • Apple Music is very good (and you don’t need an iPhone). For me at least it recommends good songs, but even better you don’t need to use those. There are extensive playlists that are manually curated by experts - for example Aussie Pub Rock is a hundred song playlist that is regularly updated by their team of editors.

    Audio quality also tends to be better on Apple Music. They encourage recording studios to produce a “Mastered for iTunes” mix and have strict quality controls as well as training for the recording studio to make sure they do a good job. You won’t find anything amateur with that label but even for professional massive artists I think they sound better there too - because Mastered for iTunes tracks are intended to be listened to with relatively neutral speakers/headphones (the only kind Apple sells) while a lot of other services have professionally mixed sound tracks designed for bass heavy speakers that so many people have nowadays out side of Apple’s walled garden. I find I often need to boost the base to get good sound from Spotify/YouTube Music/etc because they assume your speakers will do that for you.

    The difference isn’t subtle - I’m not talking about a 256 vs 320 Kbps encoding difference. The same song from a major artist (e.g. Taylor Swift) will often sound totally different on Apple Music. Wether it sounds “better” depends on your speakers, but with my speakers (which are not from Apple), they do sound better. A lot better.

    But personally I’ve gone back to just buying music. The idea that I’ll pay who knows what ever month for the rest of my life… no thanks.

    I’ll jump on YouTube occasionally to discover new music, but i’m not paying for it (Apple Music, sadly, has no free tier… but it does have a free trial).


  • The long-term popularity of any given tool for software development is proportional to how much labour arbitrage it enables.

    Right. Because if you quote $700,000 to do a job in C/C++, and someone else quotes $70,000 to do the same job in JavaScript… no prizes for correctly guessing who wins the contract.

    But that’s not the whole story. Where C really falls to shit is if you compare it to giving the JavaScript project $500,000. At that point, it’s still far cheaper than C, but you can hire a 7x larger team. Hire twice as many coders and also give them a whole bunch of support staff (planning, quality assurance, user experience design, a healthy marketing budget…)

    JavaScript is absolutely a worse language than C/C++. But if you compare Visual Studio to Visual Studio Code (with a bunch of good plugins)… then there’s no comparison VSCode is a far better IDE. And Visual Studio has been under active development since the mid 90’s. VSCode has existed less than half that long and it has already eclipsed it, despite being backed by the same company, and despite that company being pretty heavily incentivised to prioritised the older product (which they sell for a handsome profit margin, while the upstart is given away for free).

    I learned C 23 years ago and learned JavaScript 18 years ago. In my entire life, I’ve written maybe 20,000 lines of C code where I was actually paid to write that code and I couldn’t possibly estimate the number of lines of JavaScript. It’d be millions.

    I hate JavaScript. But it puts food on the table, so turn to it regularly.

    Large Language Models are a remarkable discovery that should, in the long term, tell us something interesting about the nature of text. They have some potentially productive uses. It’s destructive uses and the harm it represents, however, outweigh that usefulness by such a margin that, yes, I absolutely do think less of you for using them. (You can argue about productivity and “progress” all you like, but none of that will raise you back into my good opinion.)

    Yeah you’re way off the mark. Earlier today I added this comment to my code:

    // remove categories that have no sales

    For context… above that comment was a fifty lines of relatively complex code to extract a month of sales data from several database tables, and summarise it down to a simple set of figures which can be used to generate a PDF report for archival/potential future auditing purposes. Boring business stuff that I’d rather not work on, but it has to be done.

    The database has a bunch of categories which aren’t in use currently (e.g. seasonal products) and I’d been asked to remove them. I copy/pasted that comment from my issue tracker into the relevant function, hit enter, and got six lines of code. A simple map reduce function that I could’ve easily written in two minutes. The AI wrote it in a quarter of a second, and I spent one minute checking if it worked properly.

    That’s not a “potential” productivity boost, it’s a big one. Does that make me worse at my job? No - the opposite. I’m able to focus all of my attention on the advanced features of my project that separate it from the competition, without getting distracted much by all the boring shit that also has to be done.

    I’ve seen zero evidence of LLM authored code being destructive. Sure, it writes buggy code sometimes… but humans do that too. And anyone with experience in the industry knows it’s easier to test code you didn’t write… well guess what, these days I don’t write a lot of my code. So I’m better equiped to catch the bugs in it.


  • The name means “very bad camping ground” in the local Wiradjuri language. I don’t speak the language, but from what little I know of first nations languages I’m guessing a singular “grong” would be “bad camping ground” and duplicating it as “grong grong” makes it “very bad”.

    So yeah, intentionally displeasing. It has reliable water where two creeks join and become one larger creek, which meant it was a place you could camp if you were on your way to somewhere else and needed to stop, but otherwise it’s not somewhere you wanted to be.

    White people established a town there because it was a good place to access water for steam trains - which needed to stop every 10 to 50km to fill up their water tanks.


  • PowerShell is heads and shoulders over bash

    Sure… but that’s a low bar. Bash is basically the worst shell of them all (if you exclude the ones that are so bad nobody uses them).

    I’m a fan of fish personally. It’s both concise and feature rich. The fish language isn’t something I’d want to write a complex shell script in, but it’s a thousand times better than bash and if you’re writing something complex then I’d argue any scripting language is the wrong tool for the job. Including Power Shell. You should be using a proper programming language (such as C#).

    PowerShell is innovative, for sure. But string output/input shells scripting wasn’t broken (unless you use bash) and I’m convinced trying to fix it by replacing simple string input/output with objects was a mistake.

    I love OOP. However I also love using existing tools that work well, and none of those tools are designed to be OOP.


  • Swift is a relatively young language (ten years) and ~3 years ago a lot of things were brand new or had relatively recently been refactored. Also Apple released it to the public before it was really finished - and did the final work finishing off the language out in the open with collaboration as any well run open source project should be developed.

    For the first five years or so it was barely ready for production use in my opinion, and it sounds like tried to use it when it was ready but still had a bit of rough edges such as docuemntation.

    For example async/await was added around when you looked into it and that obviously made a lot of documentation relating to threads out of date (from memory they pretty much deleted all of it and started the long process of rewriting it, beginning with very basic docs to get broad coverage before having detailed coverage).

    And before that the unicode integration wasn’t quite right yet — they did the tough work to make this work (most of these characters are multiple bytes long):

    let greeting = "Hello, 🌍! こんにちは! 🇮🇳"
    
    for character in greeting {
        print(character)
    }
    

    And this evaluates to true even though the raw data of the two strings are totally different:

    let eAcute: Character = "\u{E9}" // é
    let combinedEAcute: Character = "\u{65}\u{301}" // e followed by  ́
    
    if eAcute == combinedEAcute {
        print("Both characters are considered equal.")
    }
    

    I hated how strings were handled in the original Swift, but it’s great now. Really hard to write documentation when fundamentals like that are changing. These days though, swift is very stable and all the recent changes have been new features that don’t affect existing code (or already written documentation). For example in 2023 they added Macros - essentially an inline function (your function won’t be compiled as an actual function - the macro code will be embedded in place where it’s “called”).

    You define a Macro like this:

    macro func assertNotNil(_ value: Any?, message: String) {
        if value == nil {
            print("Assertion failed: \(message)")
        }
    }
    

    And then if you write this code:

    assertNotNil(optionalValue, message: "optionalValue should not be nil")
    

    … it will compile as this:

    if optionalValue == nil {
        print("Assertion failed: optionalValue should not be nil")
    }
    

    Notice it doesn’t even do any string interpolation at runtime. All of that happens at compile time! Cool stuff although it’s definitely a tool you can shoot yourself in the foot with.


  • is [Swift] using fibers instead of real OS threads(?)

    There are similarities to fibres, I’d say they’re solving the same problem, but they’re not really the same thing.

    It uses libdispatch which is built on top of “real OS threads” though on some kernels (especially BSD ones) it takes advantage of non-POSIX standard OS threading features (it can run without them, but runs better with them).

    Essentially you give the dispatcher a set of tasks, and the dispatcher will execute those tasks on as many threads as makes sense for the available hardware (this is where kernel integration helps, because the number of available CPU cores depends on the current workload for all processes, not just your process, and it changes from one millisecond to the next). The general goal is to keep every CPU core fully loaded, unless QoS has been set low which would prioritise battery life (and might, for example, use “efficiency cores” or avoid “turbo boost”).

    What are these things/what is this comparing?

    It’s a simple variable assignment, such as person.name = "bob", where the compiler has recognised the value might be accessed concurrently from multiple threads and may need to pause execution for a task that is waiting for the lock to be released. But of course, since the goal is to keep the CPU core active, it doesn’t just pause the code running on that core - it’s likely to start executing something else on the same core while waiting.

    OperationQueue and DispatchQueue are basically the same, but OperationQueue has additional scheduling / dependency features which come with a slight performance overhead. If your execution tasks are slow and have minimal interaction with other threads, such as resizing half a million images, then you wouldn’t notice the performance overhead. But if you have very short operations that interact with each other (or if you just don’t need any of those management features) then DispatchQueue is the way to go.

    They’re largely the same in basic use:

    dispatchQueue.async {
       // your code here
    }
    
    operationQueue.addOperation {
     // your code here
    }
    


  • Swift. It’s an amazing language with clear but concise syntax that has every language feature you could ever want including some really nice ones that are quite rare (not unique, but certainly rare especially all in one place).

    The most unique and meaningful features are the memory manager and thread manager.

    Write a tight loop in Swift vs almost any other language, there’s a good chance Swift will use orders of magnitude less memory - because it’s better at figuring out when you’re done with a variable and don’t need that five megapixel image anymore. And it’s fast too — memory management isn’t something we rarely need to worry about in most languages but in Swift it’s more like “almost never” instead of just “rarely”.

    The threading system is so efficient that calling something on another thread is almost as fast as an ordinary function call, and the code to do it is also almost as clean as a function call, as well as all the tools you need to allow efficient (and reliable) data transfer between threads. The few mistakes you can make are usually caught by the compiler. Swift programmers use threads all the time even if they don’t really need to. It’s nothing like other languages where threads introduce unnecessary complexity/bugs or performance bottlenecks.

    Seriously look at this comparison of DispatchQueue and OperationQueue of a thread locked operation (setting a shared variable). A million operations in a bit over zero seconds vs nearly 30 seconds and the kicker is the 30 second one isn’t “slow” — a lot of thread safety management tools would be minutes if you tried to do that:

    Swift is fully open source and cross platform. But unfortunately it hasn’t taken off outside of Apple platforms, and therefore it lacks comprehensive libraries for a lot of commonplace tasks particularly when it comes to server side development or interacting with the Window Manager on Windows/Linux/Android.



  • As someone with a three year old kid in Australia, I think the government does a pretty good job at all of those things.

    For example we’ve only ever paid medical bills for things that were totally optional, and the free services were extensive (including repeated 1:1 home visits by a professional midwife - for free, and for the actual birth there was more staff attending that mum than anyone else in the hospital gets - even Intensive Care Unit patients get a lower level of care).

    Education will be free starting next year, and the optional education he’s enrolled in this year and in the last couple years have been extensively subsidised (and would be subsidised even more if our income was lower).

    Money and time are and always will be in direct opposition to each other and every parent has to make a tradeoff between the two, and not really anything the government can control. But it’s worth noting basic living expenses (like staple foods) are largely exempt from taxes, and the recent high cost of electricity, due to the ukraine war, has triggered government assistance packages to help people out (everyone, but low income people have been get even more help — we actually haven’t paid an electricity bill at all the last 8 months or so - from memory we’re about $100 in credit due to various subsidies).

    Could it be better? Sure - for example I think free education should start younger and include things like swimming lessons (enough to not drown). But I don’t really have any complaints.