4,687 karma · joined Dec 4, 2021 (4y ago) · 1,693 submissions
comment 4y ago · link · parent
Yes, and if a defer keyword were to be introduced in C, all these reasonable ways could still be used by anyone who wants to, while we could let the compiler handle it when we don't want to, making the source easier to read and reason about.
comment 4y ago · link · parent
Pragmatic point of view:
In 99% of cases, the developer doesn't care what the compiler produces and doesn't have to. A mechanism providing a complex control flow in the compiler output but is incredibly easy to read and reason about in the source code is useful in the vast majority of cases.
And for the 1% of cases where the programmer actually needs to know what the compiler produces, and / or full control over the control flow, the solution is simple: don't use `defer` and there, done, full control to the developer.
So where exactly is the downside?
comment 4y ago · link · parent
In a 20 LOC function, that takes me about a second, if that long.
> aside from Notepad pretty much every editor offers some completion feature
It's still easier to type `f` than `fi` + leadkey + N or whatever the editor uses. Bonus points if the first prediction is wrong, or ambivalent.
And the more important reason is "easier to read", especially in long expressions;
for e := getFirst(); e != nil; e.Next()
is much easier to read than for currentElement := getFirst(); currentElement != nil; currentElement.Next()
Finally, not only the name itself, but also it's length should convey meaning. If I see a variable like `currentElement` in my code, I immediately know that it probably lives beyond the scope it is defined in. If I see a variable named `c` I know that it is a short lived throwaway.comment 4y ago · link · parent
How does the QR code handle a request like "do you have a baby-seat for our 2 year old?", and subsequently point me towards where said baby seat can be found and offer a solution how it gets to my table?
How does the QR code resolve the situation that another set of customers already uses said baby seat?
How does the QR code resolve the situation that we are 12 people, we all want to sit next to each other in the non-smoking area, but there are only 2 tables there each sitting 5 people?
How do I explain to the QR code that there must have been a mixup in the kitchen and what was delivered to me was not what I ordered?
How does the QR code deal with unruly customers who harass other guests?
How does the QR code deal with a requirement like checking vaccination certificates, which was implemented by law on short notice and not part of the systems original spec?
comment 4y ago · link · parent
Since most strings following these rules are hard to remember, and humans being humans, we get passwords that follow simple, predictable, and easily guessable patterns like
aAbBcCdD1234!
Follows every rule in the holy triad and is likely to be cracked in seconds from some rainbow table.comment 4y ago · link · parent
If this is a variable in a 20LOC func, f is completely sufficient, easier to type, easier to read.
In the other extreme, names can also be too meaningful: ´ThingMessageRelayAdministratorMiddlewareComposer` or `storage_access_administrator_storageshelf_listview` are jacked full of meaning, and about as useful as a hammer without a handle.
comment 4y ago · link · parent
I am okay with that.
comment 4y ago · link · parent
A nanobot is a machine that takes action. mRNA is only an information carrier, read by the cells translational machinery (the ribosomes).
The
> depending on what scale you allow
Nanomachines, as the name implies, are at the nanometer scale, so generally theterm implies machines (bots) that are at most 1-2 orders of magnitude larger than 1nm. A microcontroller that measures a few centimeters is, by definition, not a nanobot (It also isn't a robot). Even a robot that measures only 1mm is still 6 orders of magnitude above nanometer scale.
comment 4y ago · link · parent
In a distributed network? How does that handle the data loads and requirements (availability, latency, security) of services on the scale of fb or youtube?
comment 4y ago · link · parent
Remove advertising and the amount of users for most social networks drops to oblivion, because barely anyone wants to spend money every time they post a picture of their cat.
> The fact that they're processing a lot of data is in large part because they need to for advertising.
They need large amounts of storage because millions of hours of video & audio, billions of food-pictures, tens of billions of lines of text, and a megagagazillion of references on who-like-clicked-what-when, take up a lot of storage.
> and is not and should not be used to store or process data.
Well then, what should be used? What decentralized storage solution can handle something like youtube, where 500 HOURS of video were uploaded PER MINUTE in feb. 2020?
And storing is half the deal. The solution also has to have high availability, consistency, low latency, and needs to be environmentally sound.
comment 4y ago · link · parent
The webshop exposes some way of receiving value tokens, be that USD, EUR or BTC, and has some way to tell which user transferred how many tokens.
So technically there is no difference.
The difference is, I can be pretty sure that EUR won't lose 20% of their value overnight.
comment 4y ago · link · parent
How do we know who is behind a hash? Because there is a server (aka. a "centralized authority") that has that information.
So how exactly is that different from using my google account to login to some webservice?
comment 4y ago · link · parent
How "green" something is, is determined by how much resources one unit of what it does uses, compared to how much resources doing the same unit of work on an alternative system uses.
eg. a petroleum lantern produces light more efficiently than a campfire. However, neither of them is "pretty green" compared to a LED.
Compare the amount of energy per transaction required with a PoS system to the amount of energy required to do it with, say, a credit card.
comment 4y ago · link · parent
Essentially, PoS makes sure that "he who has the gold makes the rules" becomes hardwired in the system, instead of only being a side effect of it.
comment 4y ago · link · parent
comment 4y ago · link · parent
Except for the tons of CO2 that get pumped into the atmosphere in the process, or the blackouts its causes, or the fact that there are tons of more useful applications for that energy, like heating homes, running air conditioning, charging electric vehicles ...
comment 4y ago · link · parent
Monopolies like Google and Facebook exist, in no small part, because the amount of computation and data they handle is vast, and they have the data centers to deal with that.
How much data gets has to be stored on the servers of such services? Per second? I'd assume its in the range of several GiB...again per second.
Okay, so how does the blockchain compare to that? Ethereum can store data, each byte requires about 600 of its "gas" computational equivalent. A block represents 30,000,000 gas, 1 block is generated every 15sec, so we can store a grand total of about 1MiB every 300 seconds...that is, if none of the gas is used for anything other than storing data, which means, no other computations running.
So how is "blockchain technology" going to solve the problems that come from such highly centralized services exactly?