4,687 karma · joined Dec 4, 2021 (4y ago) · 1,693 submissions
comment 4y ago · link · parent
The only way around this, would be if disks incorporated some kind of internal backup power system, which kicks in and flushes its internal buffers in case of a power loss.
However, even that doesn't really solve the problem, it just moves it somewhere else...because the internal backup power is just another system that can fail.
comment 4y ago · link · parent
What cannot continue is economic growth, for the simple reasons that the planets (and its biospheres) resources are finite.
What will continue however, is technological growth, as in technology will grow ever more complex, and solve more difficult tasks. Techn development is not inherently tied to economic growth.
comment 4y ago · link · parent
Every single technical book I own is full of markers, annotations and references between pages in the same book and to other books, as well as notes written down and jammed between the pages.
btw. this is why it really annoys me when publishers print textbooks with insufficient whitespace around the text columns. Where the hell am I supposed to write then? :D
comment 4y ago · link · parent
This isn't me ranting against systems with new ideas about file system layout, this is just me being pragmatic: When it works on all my work-, private- and production-machines, I see no reason to run an extra binary in front of all my shellscripts.
comment 4y ago · link · parent
It is a really good oboarding vehicle. Pair an Experienced Dev and a new hire, and let the former guide the latter through the codebase. It also works great for implementing changes involving very complex parts of the codebase, usually the kind that interact with many different subsystems, which can get really tricky toget a good grasp on.
comment 4y ago · link · parent
Don't get me wrong, I have nothing against fun and creative projects. If someone wants to script something complicated in bash for the lulz, the challenge, to learn something, or just to show off bash-skills, I'm all for it.
What I am against, is when I get asked to debug a 2000 LOC system used in production that was thrown together in bash, waste 2 days on it, only to end up doing what should have been done in the first place, and rewrite the damn thing in 200 lines of Python or 400 lines of Go.
It can, and should, be used to automate some things, string some commands together, make certain tasks easier. I use and write bash scripts in my daily work, and make my life easier with it.
But there comes a point, and that is sooner rather than later, when something should no longer be written in bash, but in a language that wasn't designed primarily as a command line interpreter. Can I make large complicated systems in bash? Sure. Can I carve the handle of a hammer so that it can be used as a screwdriver? I'm sure someone more skilled in woodworking than me could do it. But sometimes the question isn't if it can be done, but if it should.
comment 4y ago · link · parent
Use #!/usr/bin/env bash instead of #!/bin/bash.
The former searches the user's PATH to find the bash binary.
The latter assumes it is always installed to /bin/ which can cause issues.
And the former assumes that `env` is installed in `/usr/bin`, so I am trading one assumption for another.comment 4y ago · link · parent
This. We are constantly presented with new and shiny things. And then, barely a year later, there is the next ideal technology. And the next, and the next, and the next.
We have seen this with everyhing: Languages, coding standards, paradigms, editors, organisational methodology, interview methodology, frameworks, databases, security, design basics,...the list is endless.
But here is some truth:
C is still written. As is pure JS. Imperative/Prodecural code never went away. Websites on servers we can physically touch are still deployed. People still write working implementations for almost everything under the sun from scratch. Information-Dense, slim, efficient interfaces that get jobs done are still there. As are monolithic architectures. Good 'ol RDBMS still work great. bash is still the dominant shell. grep/cut/awk are still great for analysing logs. Water still flows downhill.
"new" and "better" are 2 different words, with different meanings. Something that's new could be better. But he fact that it's new, in itself, doesn't automagically make it better. And even if its better in one scenario, its doesn't have to be better in all scenarios.
comment 4y ago · link · parent
True, but sometimes there is no way around this, because redacting part of the text visually, so that it is clear where and how much was redacted, may be a requirement.
If there is no such requirement, one can always just replace the part of text like so:
This is the original text that I am going to redact now.
This is [REDACTED] now.comment 4y ago · link · parent
Wanna redact text?
Put a solid bar over it. There, done. No takesies-backsies from that one.
comment 4y ago · link · parent
They can be that.
They can also be syntactic sugar obscuring a construct that would be much more readable if it were written as some nested loops and if statements.
Problem with all things that fall under the category of syntactic sugar: The small gain in readbility in some cases is more than offset by the LOSS of readbility when they are overused.
Just as an Example: Do I think Decorators are neat? Sure. When they are used in moderation, they absolutely are. However, when codebases start to have decorators everywhere, use multiple Decorators on functions, with some Decs with Args thrown in for good measure, things start to get tricky. And latest when they are used to do something completely different from their original intent (act as syntactic sugar for wrapper functions), what began as a nice idea, can quickly escalate into a debugging nightmare.
IMO, Language design needs to be much more careful about what is added to a language than what is left out.
comment 4y ago · link · parent
Sorry but did I miss something?
When exactly did "this saves 2 lines in the code!" become reason enough to introduce new syntactic elements?
comment 4y ago · link · parent
Which is exactly the problem. Yes, some people will use it judiciously.
Other people will just use it wherever possible. Yet others will mix it with the alternative style willy-nilly. Some won't use it at all. And as you so correctly point out, some people will try to be too clever with it.
The result is the exact opposite of what was originally intended by syntactic sugar: Instead of making code easier to read, it becomes harder.
The only way to , at least partially, prevent that, is for languages to be restrictive in their syntax. Yes, that may be more verbose at times. But I consider that a small price to pay for consistency.
comment 4y ago · link · parent
I am merely pointing out that, once the law permits doing so, actually not storing something is quite easy.
comment 4y ago · link · parent
That way, it would be clear for users that they are not "opening a document" but "execute a program".
There simply is no need to conflate documents and programs.
comment 4y ago · link · parent
https://www.allyourbasearebelongtous.com/
:D
comment 4y ago · link · parent
"simple" has to imply neither "primitive" nor "bad workmanship". Bauhaus takes this principle, and expresses it in architectural and industrial design.
This is a timeless truth, that can be seen in everything humans create, from art, architecture, writing, up to and including software.