• 0 Posts
  • 19 Comments
Joined 3 years ago
cake
Cake day: June 19th, 2023

help-circle
  • 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.


  • 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.


  • abhibeckert@lemmy.worldtoProgramming@programming.dev...
    link
    fedilink
    arrow-up
    2
    arrow-down
    3
    ·
    edit-2
    2 years ago

    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.


  • abhibeckert@lemmy.worldtoProgramming@programming.dev...
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    2 years ago

    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
    }
    

  • abhibeckert@lemmy.worldtoProgramming@programming.dev...
    link
    fedilink
    arrow-up
    23
    arrow-down
    5
    ·
    2 years ago

    What? That’s not what happened at all.

    JavaScript was built entirely by Netscape from the ground up with no external involvement, and that was totally their “initial plan”. It shipped in testing (under the name “LiveScript”) within months of Netscape 1.0.

    And then Sun Microsystems paid Netscape a lot of money to rename it to JavaScript and pretend it was related to Java, even though it had nothing at all to do with Java.


  • abhibeckert@lemmy.worldtoProgramming@programming.dev...
    link
    fedilink
    arrow-up
    21
    arrow-down
    3
    ·
    edit-2
    2 years ago

    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 (these two comparisons are both done in Swift, which has several different ways you can deal with thread safety):

    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.



  • those projects shouldn’t really exist

    You think web browsers should not exist? How do you write Google Chrome, and all of it’s dependencies, in one page of code?

    I think you’re miss-understanding the article. Joel didn’t say you should never rewrite an individual component in your code, he was saying you should never throw out an entire project (all of the components) and start from scratch.

    He also wasn’t talking about “multiple people and man-years of work”. He was talking much larger projects. How many people have contributed Chrome? Not just direct contributions writing lines of code, but indirect contributions such as reporting bugs or writing documentation on how it works?

    If Google were to start over, all of that would be thrown out. It just can’t be done.

    All you can really do is what Microsoft did with IE / Edge. Edge was a fork of Chromium which was a fork of WebKit which was a fork of KTHML which was a fork of the KDE HTML Widget. Which dates back to 1996. Internet Explorer started in 1995. Microsoft didn’t start Edge from scratch, they basically shifted their team of developers over to another project that was the same age.

    The smaller the project, the easier it is to do a full rewrite but realistically it’s almost never a good idea unless your product is very young.



  • With context switching - I use a hybrid of GTD, instead a single system for all your tasks I have a separate GTD for each project.

    Part of the reason I do that is privacy. If I’m hit by a bus, all my projects won’t die with me. They’ll just be handed over to someone else… and it would really help if that other person has access to all my notes. But I don’t want them to have access to literally all my notes, just the ones relevant to them.

    I’ve never been hit by a bus, but I have occasionally decided to stop managing a project before it’s finished. And being able to simply hand everything over to another person has allowed me to do that in situations where I would have otherwise been compelled to keep working on something I don’t want to work on. For me, the ability to hand off a project easily is critical.

    Just try to use Joplin or Obsidian with tasks plugin for that.

    Those are far too restrictive. Outlines are a great tool, but they are not the right tool for every job. The best thing about GTD is flexibility - you can do whatever works for you and the project at hand.

    Personally I use a folder. Sometimes that’s a digital folder on a cloud service, or sometimes it’s a dead-tree folder.





  • they can’t fire you for wearing shorts.

    True, but they can disrespect you for failing to fit in with the corporate culture. Honestly, I’d rather be fired.

    There are plenty of workplaces where you can wear “whatever you want”, and I’m happy to work at one of those… But the clothes you choose to wear still has consequences. I can totally turn up to work in a full suit/tie/etc if I want. But I’d stick out like a sore thumb.


  • Look in a big box clothing store and you’ll see that the women’s section is almost always 2 to nearly 3x larger

    What do they sell in the men’s section? Genuinely curious because as a man I never shop for clothes…

    Years ago, I found a brand and model (yes, they have a model number) of pants that fit well and have lots of pockets. I have them in long/short, and black/blue/tan. I wear a uniform shirt at work (it’s totally optional, but about half the staff wear them and I find they puts me in “work mode” mentally). My partner buys my shirts, because she tolerates me owning half a dozen pairs of the same pants but will not tolerate it for shirts.

    My fashion choices are my shoes, my watch, my glasses, my phone, and my haircut. All four are the same every day but every six months or so I change one. That’s enough for me. I think it’s incredibly freeing to not have to worry about what I look like every day.