Just a basic programmer living in California

  • 2 Posts
  • 153 Comments
Joined 2 years ago
cake
Cake day: February 23rd, 2024

help-circle
  • Not OP, but I’ve been using Niri as my daily driver for almost two years (since v0.1.2). The stability and polish have really impressed me. In addition to the scrolling workflow it has some especially nice features for screen sharing & capturing, like key binds to quickly switch which window you are sharing, and customizable rules to block certain windows when showing your whole desktop.

    I do use a 40" ultrawide. Looking for options for getting the most out of an ultrawide was how I got into scrolling window managers.

    I only occasionally use my 13" laptop display. I still like scrolling because I like spatial navigation. Even if windows end up mostly or entirely off the screen I still think about my windows in terms of whether they’re left, right, up, or down from where I’m currently looking.

    I don’t like traditional tiling as much because I find squishing every window to be fully in view to be awkward; and with e.g. i3-style wms if I want to stash a window out of view, like in a tab that’s a separate metaphor I have to keep track of, with another axis where windows might be. Scrolling consistently uses on spatial metaphor, placing all windows on one 2D plane with one coordinate system.


  • Home Manager is a Nix tool for managing configuration for a single user, usually on a Linux or MacOS system, or possibly WSL. You configure installed programs, program configuration (such as dot files), and a number of other things, and you get a reproducible environment that’s easy to apply to multiple machines, or to roll back configuration, etc. I find it helpful for having a clear record of how everything is set up. It’s the sort of thing that people sometimes use GNU Stow or Ansible for, but it’s much more powerful.

    A Home Manager configuration is very similar to a NixOS configuration, except that NixOS configures the entire system instead of just configuring user level stuff. (The lines do blur in Nix because unlike traditional package managers where packages are installed at the system level, using Nix packages can be installed at the system, user, project, or shell session level.) Home Manager is often paired with NixOS. Or on Macs Home Manager is often paired with nix-darwin. As I mentioned, the Home Manager portion of my config is portable to OSes other than NixOS. In my case I’m sharing it in another Linux distro, but you can also use Home Manager to share configurations between Linux, MacOS, and WSL.



    • NixOS + Home Manager
    • Niri
    • Kitty
    • Neovim, via Neovide

    For work it’s Fedora + Home Manager because the remote admin software doesn’t support NixOS. Thankfully I’ve been able to define my dev environment almost fully in a Home Manager config that I can use at work and at home.

    I use lots of Neovim plugins. Beyond the basic LSP and completion plugins, some of my indispensables are:

    • Leap for in-buffer navigation & remote text copying
    • Oil for file management
    • Fugitive + Git Signs + gv.vim + diffview.nvim for git integration
    • nvim-surround to add/change/remove delimiters
    • vim-auto-save
    • kitty-scrollback



  • I use a chat interface as a research tool when there’s something I don’t know how to do, like write a relationship with custom conditions using sqlalchemy, or I want to clarify my understanding on something. first I do a Kagi search. If I don’t find what I’m looking for on Stack Overflow or library docs in a few minutes then I turn to the AI.

    I don’t use autocompletion - I stick with LSP completions.

    I do consider environmental damage. There are a few things I do to try to reduce damage:

    1. Search first
    2. Search my chat history for a question I’ve already asked instead of asking it again.
    3. Start a new chat thread for each question that doesn’t follow a question I’ve already asked.

    On the third point, my understanding is that when you write a message in an LLM chat all previous messages in the thread are processed by the LLM again so it has context to respond to the new message. (It’s possible some providers are caching that context instead of replaying chat history, but I’m not counting on that.) My thinking is that by starting new threads I’m saving resources that would have been used replaying a long chat history.

    I use Claude 4.5.

    I ask general questions about how to do things. It’s most helpful with languages and libraries I don’t have a lot of experience with. I usually either check docs to verify what the LLM tells me, or verify by testing. Sometimes I ask for narrowly scoped code reviews, like “does this refactored function behave equivalently to the original” or “how could I rewrite this snippet to do this other thing” (with the relevant functions and types pasted into the chat).

    My company also uses Code Rabbit AI for code reviews. It doesn’t replace human reviewers, and my employer doesn’t expect it to. But it is quite helpful, especially with languages and libraries that I don’t have a lot of experience with. But it probably consumes a lot more tokens than my chat thread research does.



  • My work is using Coderabbit, and I’ve found its feedback to be pretty helpful - especially since I’m working with a language I don’t have a whole lot of experience with (Python). I check what it tells me, but it has taught me some new things. I still want human reviews as well, but the AI can pick up on detail that is easy to skim over.

    It doesn’t cover bigger picture stuff like maintainability, architecture, test coverage. Recently I reviewed a PR that was likely AI generated; I saw a number of cases where logic duplication invited future bugs. (Stuff like duplicating access predicates across CRUD handlers for the same resource, repeating the same validation logic in multiple places.) Also magic strings instead of enums, tests of dubious value. Coderabbit did not comment on those issues.

    I’m also getting feedback from Sonarqube on the same project, which I think is static analysis. It’s much less helpful. It has less to say, and a lot of that is pointing out security issues in test code.


  • I did the swipe to complete an -ing suffix, and yes, I see the appeal!

    Entering punctuation is a bit slow using long-presses on the apostrophe key. Maybe I can get used to using the symbol layer instead.

    Oh! You can swipe from the 123 key to type a symbol from the symbol layer in one gesture! That’s great! It even works for comma! Kinda accidentally - given the comma position I’m swiping over question mark, backspace, comma which gets a net result of typing just the comma. I wish it would go back immediately to the ABC layer.

    Moving the cursor by holding and dragging from space feels better than the similar feature in gboard!

    I miss the gboard backspace feature where you can hold and drag to selectively delete.



  • Fugitive, the vim / neovim plugin. It does everything the CLI does, but uses vim interfaces very effectively to enhance the experience. For example it’s quite good for selectively staging changes from a file. I also like the option to open a buffer with the version of a file from any specified commit.

    I also tried neogit which aims to port magit to neovim. I didn’t like it as much. Partly because as far as I could tell at the time it lacked features compared to fugitive. But also because it seemed to want me to do everything through UIs in its own custom windows. Fugitive is integrated more thoroughly into vim via command mode, and special buffers.


  • I usually use git add -p to selectively stage hunks. But in git add -i I think running the patch command does the same thing to get into patch mode.

    If patch mode shows you a hunk, and you only want some of the lines you can press s to split into smaller hunks. Then you’ll be prompted whether to add each smaller hunk separately.

    If you want to stage a change that is on the same line as a change you don’t want to stage, or on an adjacent line, then you need to use e to edit the hunk. Git stages whatever changes are left when you’re done editing. The file in the working tree on disk is unchanged.



  • It’s hard to predict the future, but I can point to a couple of indexes.

    TIOBE measures language popularity according to a variety of factors. It has Java on a steady downward trend over the last couple of decades, but shows it as still very relevant. TIOBE does not show comparable growth for Golang. I don’t see much growth in the top 10 for languages that are especially suited to autoscaling. C# looks to be steady as a language in a similar niche as Java.

    OTOH another survey from devjobsscanner that looks purely at job postings shows Java openings as very steady over the last couple of years. It also shows Java as more popular than Golang.

    So I don’t know exactly what conclusion to draw from that. But learning a new language can be a helpful exercise regardless to broaden your perspective, and to keep your skills sharp.

    Personally for the purpose of producing resource-efficient binaries for scaling I prefer Rust. It’s design incorporates some correct-by-construction strategies that promote high-quality code. And it’s well-suited for compiling to WASM so you can do stuff like deploy small services to Cloudflare workers for wild scaling. But I guess Rust isn’t making a big showing in the popularity charts. And Golang is popular for its lower learning curve.


  • You have two options depending on how you set your Typescript config.

    Option 1, the default:

    declare const xs: number[]
    const x = xs[4] // inferred type is `number`
    

    Option 2, using the noUncheckedIndexedAccess setting:

    declare const xs: number[]
    const x = xs[4] // inferred type is `number | undefined`
    

    Your AI assistant appears to assume option 2. Maybe you have that option enabled in your project?

    I’m sorry you had to spend a lot of time and frustration on this problem. But fundamentally Rust and Typescript have the same limitation: neither will catch out-of-bounds access errors on variable-length collections at type-checking time. They don’t have the necessary information to do that.

    Rust can catch out-of-bounds access on a fixed-length array if you use a literal number for the index access. But Typescript can do the same thing if you use a fixed-length tuple type (e.g. [number, number] instead of number[]).



  • hallettj@leminal.spacetoLinux@lemmy.mlLinux Users- Why?
    link
    fedilink
    English
    arrow-up
    6
    ·
    5 months ago

    I also use Niri. Previously I basically used maximimized windows on dual monitors. But I really liked the idea of switching to one ultrawide display. Maximized windows wouldn’t work well in that setup. Tiling hadn’t really worked for me because you end up with a screen full of awkwardly skinny or short windows, or windows hidden away in tabs. I also didn’t like the idea of managing floating windows with… a mouse.

    So I looked for a better option. I found PaperWM, and I loved it! Exactly what I needed! But it has a number of quirks, being an extension that entirely reworks Gnome’s window management. For a long time I wished for a native scrolling wm. And then Niri came along! And it’s so polished!


  • You might be interested to learn some history of societies without state-issued currency. The book “Debt: The First 5000 years” by David Graeber has lots to say about pre-modern systems of account. I’m aware there are some criticisms of the book so I don’t want present it as absolute truth - but it is an interesting on read, and it cites lots of anthropological studies.

    One of the points of the book - and I see there are also other anthropologists who take this view - is there is no evidence that there has ever been a barter economy. Economics curriculum typically talks about prehistoric barter as an introduction; but it looks like the barter story may have been made up by Adam Smith. Smith’s “Wealth of Nations” is highly insightful, and even predicts problems with capitalism that we currently face. But he probably didn’t have the anthropological background to write authoritatively about economies of prehistoric societies.

    Graeber does claim that there have been times when barter has been a stop-gap when there is a problem with money supply. So that’s a case where something like your app might come in,

    When barter has appeared, it wasn’t as part of a purely barter economy, and money didn’t emerge from it—rather, it emerged from money. After Rome fell, for instance, Europeans used barter as a substitute for the Roman currency people had gotten used to. “In most of the cases we know about, [barter] takes place between people who are familiar with the use of money, but for one reason or another, don’t have a lot of it around.

    These were temporary situations. The fall of Rome probably seemed like the end of the world to some people at the time. But new societal structures and currencies filled the gaps.