Principal Engineer for Accumulate

  • 6 Posts
  • 65 Comments
Joined 1 year ago
cake
Cake day: June 12th, 2023

help-circle
  • It’s not just about learning a language. Given two equivalent languages, writing a project using one or the other is always going to be less work and less of a maintenance burden than writing it using both. A competent manager will take that into account when deciding what tools to use. On top of that, learning a new language has a cost. Of course Rust and JavaScript are not equivalent, but which one is ‘better’ is highly subjective and dependent on how you measure ‘better’. So a manager needs to take that into account. But my fundamental point is that using two languages for a project adds overhead, and learning a language adds overhead, so unless cost (including time) is irrelevant, there must be a compelling reason to choose a dual-language solution* over a single-language solution, and to chose a solution that requires your devs to learn a new language over one that does not. Not to mention switching platforms has a massive cost if your project is already mature. Even if you’re creating a new project, if your team already knows JavaScript and doesn’t have any particular objection to Electron, there’s no compelling reason.

    If there is a good reason to learn a language then people will.

    Sure. Except in my experience interviewing candidates and from what I’ve seen online, there are a lot of developers out there who aren’t very good. I am not optimistic that the average developer will have an easy time learning a new language. If the “we” in “Is this the electron alternative we’ve been waiting for” is you and I, that’s not a problem. But if OP meant to suggest there will be a large-scale shift away from Electron, then the average developer is quite relevant.

    *As someone else pointed out, Dioxus is designed with the intent that you’ll right the frontend in Rust, so it’s not exactly dual-language like I thought.



  • I seriously doubt that a dual-language platform is ever going to supplant Electron. Electron has the major advantage that the entire app is written in one language. And according to Stack Overflow’s 2023 developer survey, 66% of devs use JavaScript, 45% use Python, 43% use TypeScript, and 12% use Rust. More devs use Java, C#, C++, PHP, and C than Rust. So 2/3 of developers wouldn’t have to learn a new language to use Electron, and only a small fraction of the remainder knows Rust.













  • I think the author’s primary point is, “Merging changes sucks, don’t make your users do that,” with a corollary: if your program loads configuration from a directory that is only populated by the user, there’s nothing to merge and thus never any merge conflicts. Case in point: /etc/polkit-1/rules.d. I can add whatever rules files I want in there and they’re never going to conflict when I update. If PolKit makes breaking changes to the format, it will log errors somewhere and I can look at those errors, look at my rules, and figure out how to fix them. That’s a hell of a lot easier than merging conflicting changes to code/configuration.


  • Additionally, switch performs extra sanity checks that checkout doesn’t, for example switch would abort operation if it would lead to loss of local changes.

    What checks? Under what situation does checkout lead to loss of changes? If I make changes and attempt to checkout a ref that would overwrite them, I get the following error:

    error: Your local changes to the following files would be overwritten by checkout:
            some/file
    Please commit your changes or stash them before you switch branches.
    Aborting
    

    To my knowledge it’s not possible to overwrite changes when switching branches/refs (git checkout <ref> without any other arguments or flags) so I guess what the author really means is, “If you use checkout incorrectly you can overwrite local changes.” As far as I can recall I’ve never accidentally git checkout <ref> <some/file> so I don’t see a reason to retrain my muscle memory. I do use git restore since it’s behavior is a lot more obvious than checkout/reset though sometimes I still use git checkout <ref> -- <some/file> because muscle memory.


    • Scenario: I’m in the middle of writing a new feature.
    • Boss, to me: “Shit broke. Go figure it out.”
    • Me, thinking: I’m in the middle of doing some complex work. If I commit/stash and close the open files, it will take a day for me to remember WTF I was doing.
    • Me: “Oh look, worktrees! I can leave my workspace intact with all the files open, pending changes, test results, terminal output, everything! And just create a new worktree to checkout the production version and debug! I’m saved!”

    Also setting up a worktree is really easy. git worktree add ../hotfix prod-branch && cd ../hotfix and get working. Though in reality it’s cd ../hotfix && git checkout prod-branch because I’ve never needed more than one secondary worktree.


  • I think the degree of footgun danger depends a lot on the language and the application. I agree that C and C++ are dangerous until you really know what you’re doing, though IMO most of the danger comes down to memory management and that’s a portable skill, once you’ve learned it. That being said, I don’t have a lot of experience with C++. C was my first language so I’m used to plain old normal boring pointers (are those “dumb pointers”?) and I’ve never understood why C++ needs 9 billion types of pointers.

    Go has one particular footgun - loop range variables. Other than that, IMO high-level, garbage collected languages don’t have major footguns like that. My first job was writing a bespoke inventory system for a manufacturing company, and I wrote it in a language I’d never used before - C#. In five years the only major issue that had was due to my inexperience with SQL and had nothing to do with C#. And though I haven’t written nearly as much code, I’d say the same about Java, Ruby, Python, and JavaScript.



  • Counterpoint: knowing a programming language doesn’t matter if you can solve problems. A competent programmer can pick up a new language and be productive within a few months. That is, a new language within the same paradigm - going from a imperative language to a functional language can be a drastic shift, but going from one imperative language to another is easy. If you can’t do that as a intermediate to senior developer, you’re not a competent programmer IMO.

    The real skills of a good programmer are things like problem solving, debugging, understanding how to write readable and maintainable code, etc. Having deep knowledge of a specific programming language or languages is helpful and enables you to work faster, but if you’re only a skilled developer in the languages you know - if you aren’t capable of pivoting those skills to another language - you aren’t a skilled developer IMO.