4,687 karma · joined Dec 4, 2021 (4y ago) · 1,693 submissions
comment 4y ago · link · parent
And the article itself explains how the current point of view on our ancestors life style may have originated.
comment 4y ago · link · parent
Meat was not a reliable food-source for our ancestors. Hunting was dangerous and not always successful. Plants don't run, they don't fight back. Our ancestors were likely not so much "hunter-gatherers" as they were "gatherers who occasionally were lucky enough to hunt something succesfully".
Plants were always the primary food source of most omnivores. Humans are no exception to that rule.
Then why do cave paintings depict hunting scenes so often? For the same reason why action-movies are full of expensive sports cars instead of old rust buckets or hand-me-downs.
And better brains don't just make hunting easier, they can also reason better about what plants can be found where and when more efficiently, culminating in the stroke of genius that was stopping to collect plants in the wild and instead mass-growing them in the controlled circumstances of agriculture.
comment 4y ago · link · parent
So how does one write, say, the backend for a reservation system managing thousands of hotel room bookings every hour, all over the world? I'm pretty sure there will be ALOT of customers with non-ascii names, not to mention adresses and hotel names. How does one write a system like twitter, where messages in every known system of writing need to be be sent, processed, stored, delivered, commented, displayed?
And btw. network protocols and backends work with arbitrary data all the time: Audio & video streaming, networked gaming, sensor readouts, images. Even plaintext webpages are often transmitted in compressed form. So if these systems are the "realm" of arbitrary bytestreams to encode everything from classical music, over sha-hashes, to gifs of dancing dogs, they may as well encode a few hundred different systems of writing and some smiley faces.
comment 4y ago · link · parent
I am well aware, and supportive, of the need to encode the entirety of human script and written symbolics in a unified format.
And the reason why my terminal doesn't need anything beyond basic modifying diacritic marks and single-codepoint symbols (like blocks and line characters for text-user-interfaces) is because I do not use it to write prose is a variety of languages, I use it to communicate with a machine, administrating systems, designing backend software, and analysing machine-written logfiles.
comment 4y ago · link · parent
Just my 2 cents, but if ASCII includes, among other things, "characters" for linefeed, 4 unspecified "device control characters", EOT (End of Transmission), and a character to ring a bell, then I guess its okay to put some smileys and flags into Unicode.
comment 4y ago · link · parent
This is "computer language":
for i := 0; i <= x.tctl_b(); i++ {
v, e := x.getg[i].pop()
if e != nil {
log.Fatalf("%v\nloop", e)
}
}
So is this imul 8(%rsp), %rax
So is this shopt -s globstar && grep -sn '\xFF' **
Whether we translate the meaning of the above into Mandarin, English, Spanish, Japanese, Swedish, Farsi, Swhaili, Hindi, Latin, Klingon, Dothraki, Sindarin or any other spoken, written or invented language we chose to be comfortable with, makes exactly zero difference.comment 4y ago · link · parent
Same with "clean code". I think alot of people would agree that a 10000 line program where all the code lives in the main function is not "clean". But that doesn't mean this is what someone means when he says "this isn't clean code".
comment 4y ago · link · parent
My subjective experience of grapefruits is that they are yucky. That tells others that I don't like grapefruits, but it tells them nothing about the grapefruit.
It tells them nothing about, what exactly in the interplay between the chemical composition of grapefruit juice, the genetic programming behind my tastebuds, and the personal experiences which shaped my individual perception of "tastyness vs. yuckyness", makes them "yucky" for me.
comment 4y ago · link · parent
It has no intrinsic, defined meaning in the context of code.
Saying code is "clean" is like saying food is "tasty"...its a personal opinion, not a defined term.
comment 4y ago · link · parent
And how is my list "low level"? It concerns both "low level" issues like missing comments or inconsistent naming, and "high level" architectural problems, like introducing pointless abstractions.
Both are code smells , and thus a valid answer to the topic.
comment 4y ago · link · parent
A house where the floorplan is decided before the needs of the tenants are even clear, will likely have to be reshaped later. The same happens in overarchitectured codebases, eg. a dependency injection for some subsystem set up which will never have more than one type to depend on, making the code less obvious, less readable, and harder to maintain.
comment 4y ago · link · parent
Let's say the architecture of a house is beautiful, and its a marvel of structural engineering, but; If the floorplan is unintuitive, the stairwells alternate between 3 different parts of the building each floor, none of the rooms are labeled, all the access shafts are of different size, the original architect didn't even keep a copy of a blueprint, and some rooms are simply blocked off with a sign on the bricks saying "maybe need that later"...
...then the guy who has to rewire the cables in the damn thing later is gonna have a bad day, and the guy who has to pay him for all the extra hours is not going to be happy either.
comment 4y ago · link · parent
"trivially observable" is not a defined measurement however. What a piece of my code does may be perfectly obvious to me, but mystifying to someone else, or even to myself in 4 months. I am not advocating for half a page of comments before each top level definition, or trivial comments like `// this requests data from server` , but a single line of comments above each function or typedef isn't too much to ask.
> If some bug is encountered with new code, you can comment-out new code and uncomment-out old code quickly
I can also check out the commit where it was last changed, stash the info, and apply it to my dev branch. Same functionality, and less cruft in the code.
comment 4y ago · link · parent
Let's consider a really simple object graph:
A -> B
C
A holds a reference to B, C has no reference to other objects. A is responsible for Bs state. By the principles of encapsulation, B is part of As state.What if it turns out later, that C has business with B? It cannot pass a message to A, or B. So, we do this?
A -> B <- C
Wait, no, we can't do that, because then B would be part of Cs state, and we violate the encapsulation. So, we have 2 options: 1. C -> A -> B
2. C <- X -> A -> B
Either we make C the god-object for A, or we introduce an abstract object X which holds references to A and C (but not to B, because, encapsulation). Both these implementations are problematic: in 1) A now becomes part of Cs state despite C having no business with A, and in 2) we introduce another entity in the codebase that serves no purpose other than as a mediator. And of course, A needs to be changed to accomodate passing the message through to B.And now a new requirement comes along, and suddenly B needs to be able to pass a message back to C without a prior call from C. B has no reference to A, X or C (because then these would become part of its state). So now we need a mechanism for B to mutate its own state being observed by A, which then mutates its own state to relay the message up to X, which then passes a message to C.
And we haven't even started to talk about error handling yet.
Very quickly, such code becomes incredibly complex, so what often happens in the wild, is: People simply do this:
A -> B <-> C
And at that point, there is no more encapsulation to speak of. B, and by extension B is part of A's state, and B is part of Cs state.comment 4y ago · link · parent
OOP is not required for implementation hiding. It can be done entirely by convention (eg. names starting with an underscore are internal and not to be used).
Go took this a step further and simply enforces a convention at compile time: Any symbol in a package not starting with an uppercase letter, is internal and cannot be accessed by the consumer.
comment 4y ago · link · parent
Code that relies alot on pointless abstractions (aka. bad "signal to noise ratio").
Code with lots of microdependencies to perform really trivial tasks.
Code with premature "optimizations" (usually done before actual performance measurements).
Code sacrificing readability (and thus maintainability) to be overly clever or to do trivial optimizations (usually with little to no impact on overall performance).
And of course all the different ways to mess up comments, style and versioning (Yes, I consider the versioning part of the code):
* Uncommented code
* Over-Commented code
* Comment-Banners
* Commented-Out code (git exists for a reason)
* Inconsistent naming
* entirely_too_long_variable_names for things that exist for 20 LOC
* Unhelpful commit messages (my favorite: "fixed: some issues")
* Bulk-Commits that change/fix/introduce multiple features or issues at once
* Missing tags
* No semantic versioningcomment 4y ago · link · parent
The only reason why humans seem to prefer infix notation, is because it is what's being taught in school. The first mathematical expressions most people get to see is
1 + 1
There is no reason why someone who was introduced to + 1 1
at an early age would find it less "natural" than infix. I think the only reason why infix is the dominant notation is historical: Prefix notation relies on getting whitespace right as a deliminator, and that is a lot tougher to do in handwriting. Infix solved this problem by (ab)using the operator as a deliminator.comment 4y ago · link · parent
The only other things that come to mind when I think about "OOP" are:
* inheritance, which at this point even lots of proponents of OOP have stopped defending
* encapsulation, which usually gets thrown out the window at some point anyway in sizeable codebases
* design patterns, which usually lead to loads of boilerplate code, and often hide implementation behind abstractions that serve little purpose other than to satisfy a design pattern...the best examples are the countless instances of "Dependency Injection" in situations where there is no choice of types to depend on.
comment 4y ago · link · parent
The thing is, code complexity can be managed superbly without the concept of a class.
Golang doesn't have classes. C doesn't have classes. But both have structs and they have functions taking a pointer to, or a struct of type T. (what OO calls a "method" for some reason). So we can have "objects" as in, custom datatypes, and we can have functions to act on them.
And on top of that, we have modularization in libs and packages.
So, why do we need more complicated languages? "Show a locked door before you show a key" indeed.
comment 4y ago · link · parent
"UNIX and Linux System Administration Handbook"
was the starting point back then.comment 4y ago · link · parent
So is a LAMP stack on a dedicated machine.
> Plus, the more of the services you use,
The thing is, most webapps don't use a lot of services. Backend-Logic in whateverlanguage, a database, and a webserver. Maybe hooked up to some CRM system. That's it for 99/100 webservices.
Yes, the services cloud providers offer are amazing, they are complex, and it is natural for developers to be fascinated by complex things (I know it is for me). But it's important to realize when simple is simply enough.
comment 4y ago · link · parent
1. Why would "every single dev that exists" need to know this? You need a handful of people per company, depending on size maybe as few as one sysadmin and a backup guy, and you're set.
2. The alternative is that every single dev that exists needs to know about whatever the cloud-solution-du-jour may be, because suddenly the product has to be written with the architecture in mind (eg. to not get surprised by huge bills)
3. As a dev who learned all how to configure apache and nginx, manage containers, setup, harden and supervise systems (aka. "sysadmin stuff") I can say its doable, and even fun to learn.
comment 4y ago · link · parent
This.
I always wonder how much of the "clouds" success (economic, that is) would have materialized, if the marketing term never got traction, and everyone just called it what it really is: "renting someone elses hardware without physical access, and less, if any, control over how the stack works from the metal up".
In the good 'ol days, when people wanted to put a service online, they rented the racks at a colo, and either stuffed their own hardware in or, worst case, used rented hardware.
Did that require some basic familiarity with hardware? Yes it did. Did people need to know how to setup, configure and administrate a LAMP stack? Sure. Was it guarded against sudden loadspikes by god-knows-how-many layers of abstraction? Nope.
But it worked, and surprise, in 99% of cases, it was perfectly fine if a website ran at sub-optimal speed for a few hours, or went down every now and then.
And the dirty little secret is: It still does, and it still is.