[-] nous@programming.dev 9 points 11 months ago

I personally hate global menu bars. They do not work with focus follows mouse. The way menus currently work is fine for me and I would not want to lose that to, IMO, a much worst system. Any global menu implementation would need to be able to be disabled and better to have it off by default. And I would rather see effort in developing other features personally - though mostly as I would never use this feature.

[-] nous@programming.dev 9 points 2 years ago

That argument falls apart because state schools exist and 93% of children already attend. Which means private schools are not very popular despite their tax exempt status. So it is not encouraging many people to attend them and it is not like not going to a private school is not investing in your child's education since a free alternative that is not a complete shit hole exists. Turns out well funded public services can be a good thing and we don't need to privatize everything to see the best results.

In reality this seems more like a tax on rich parents who are the only ones that can afford expensive private schools in the first place all to hopefully better fund the free for everyone else state schools that most people already use.

[-] nous@programming.dev 9 points 2 years ago

It’s a zero cost bool!

It really is not. Dynamic dispatch has a cost on every access due to it being a pointer. Instead if doing a bool check you are needing to read a pointer to figure out which function to call. I doubt this is any faster than just having the bool check and I doubt that the bool check is slowing anything down by a noticeable amount. All of this is probably not worth the complexity, especially without benchmark results as I can see this actually slowing down the code overall.

There is also a increased binary size due to there needing to be two versions of the code block - if you have that in every function that would be a dramatic increase in the binary size. This means more data needs to be loaded into memory at startup and I don't know if the branch prediction in your CPU worth with vtables?

Maybe if you already need dynamic dispatch for something it might be worth it. But most of the time I would avoid it if possible which means this pattern has a very limited usecase that you cannot use over the whole program? What is wrong with the standard logging crates in rust? I would expect them to be good enough even for game dev.

[-] nous@programming.dev 9 points 2 years ago

rust-analyzer I believe will compile all the deps the first time it runs. This will take some time but after that it should be fast. If you run a cargo clean that will wipe everything and you will have to wait again. So dont do that. clean should be something you run sparingly not before every compile.

[-] nous@programming.dev 9 points 2 years ago

The problem with bash scripts is they tend to explode in unexpected ways when thing don't go as intended. This could be one of the command you run returning some expected or not output which might work now but might not in the future. Best to program bash defensively.

[-] nous@programming.dev 9 points 2 years ago

Remove the loop and sleep from the script you created so it just runs and exits.

Then create a file at /etc/systemd/system/battery-alarm.service with the following:

[Unit]
Description="Sound alarm when battery is low"

[Service]
ExecStart=/usr/local/bin/battery-alarm.sh # point this to your script

Then create a file at /etc/systemd/system/battery-alarm.timer with the following:

[Unit]
Description="Run battery-alarm.service every 2 mins"

[Timer]
OnUnitActiveSec=2m
Unit=battery-alarm.service

[Install]
WantedBy=multi-user.target

Then sudo systemctl enable --now helloworld.timer to start and enable the timer on boot.

This will be a little more robust then your current script. It works without the user needing to log in. And there is nothing to get killed so will always trigger. The current script will just silently stop working if it ever gets killed or crashes.

[-] nous@programming.dev 9 points 2 years ago

I hate it when people put commands in screen shots. Means you cannot just copy-paste from them.

[-] nous@programming.dev 9 points 2 years ago

People that were running ad blockers were not seeing ads and business owners were not paying for those blocked ads. So I don't see why they would care at all.

[-] nous@programming.dev 9 points 2 years ago

Or like that time gitlab found out that none of its 5 backup/replications worked and lost 6 hours of data.

[-] nous@programming.dev 9 points 2 years ago

Helix was inspired by neovim. Though mostly the inbuilt LSP/tree sitter support. Its keybindings are a mix between what neovim has and kakoune, though closer to kakoune I think. The major advantage IMO that helix has over neovim is built in support for most things you need plugins for in neovim as well as sane defaults out the box. You don't need 10s of plugins and 100s of lines of config to get helix to work like a modern editor - it just does out the box. All you need to do is install the LSP server for the languages you are interested in and launch helix.

The major downside ATM is it has no plugin support at all. Which is not as bad as it sounds as it includes so much out the box that you would typically require plugins for in neovim. They are working on plugin support though so it is only a matter of time for this to be fixed. Currently I don't feel the need for any plugins when using it so IMO it is not a deal breaker for me or my workflow. But the need to manage large configs and sets of plugins had already become too cumbersome in neovim for my liking.

[-] nous@programming.dev 9 points 2 years ago* (last edited 2 years ago)

Except for kernel modules - which are stored on disk and often loaded on demand. Though most distros keep around the old kernel and kernel modules to avoid issues. You can still get issues on distro such as Arch which replace the kernel and modules on an upgrade - though there is the kernel-modules-hook package with pacman hooks to keep the old modules around until the next reboot to fix this.

If you don't have the kernel-modules-hook package installed on Arch you really should reboot shortly after an upgrade to the kernel or else new devices you plug in might not function until you do (typically USB as those tend to be what you hotplug the most).

[-] nous@programming.dev 9 points 3 years ago

Should you invest in software quality?

For 95% of companies, the answer is: No.

This is just wrong. Software quality does matter and this question makes it sound like a binary answer. But it is not. The correct question is how much should you invest.

Maybe software quality doesn't matter that much to your company, but if the cost of improving the quality is a small amount you would be stupid not to invest. But then there might be something else that would cost you a lot to improve the quality only a little bit, then it might not be worthwhile.

Everything is a trade-off, there are very few binary answers like this article they are responding to suggests.

view more: ‹ prev next ›

nous

0 post score
0 comment score
joined 3 years ago