Better HN
topnewbestaskshowjobs
Log inSign up

usrbinbash

4,687 karma · joined Dec 4, 2021 (4y ago) · 1,693 submissions

Submissions

comment 4y ago · link · parent

Because sadly, Buzzwords work, that's why they have been used ever since someone had the idea to climb on a stage and yell something that sounds exciting to get people to buy stuff.

comment 4y ago · link · parent

Don't need it :-) I just write my code the old fashioned way.

comment 4y ago · link · parent

> There are most often good ways to clean up in a reasonable way.

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

So its better to make the control flow explicitly complicated with a bunch of labels and resource-flags and doing so inconsistently (because everyone has a slightly different view on how to implement it), than having the compiler do it in a consistent way?

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

I will post this to the next guy who tells me that github copilot saves suuuuuch a lot of time which I, old fashioned, vim-using as I am "waste with all that typing". :D

comment 4y ago · link · parent

How does "defer" make it harder to reason about the code? Especially when the alternative is a bunch of resource-flag-tests and cleanup labels?

There is a reason why it was introduced in Go.

comment 4y ago · link · parent

> and figure out the hard way what `f` is used for.

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

My point still stands:

Transmission of predetermined information is a fully understood problem, and easy to automate.

Physical interaction with unexpected variables in changing environments, is not.

comment 4y ago · link · parent

And how does the QR code get my food from the kitchen to my table?

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

Yep. And yet many many many people are taught the holy triad of "at least one uppercase one lowercase and one special character!"

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

Depends entirely on the context, ie. what's the scope of `fullname`.

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

Why was "meetings" the first thing that popped into my mind when I read the title? Must be one of these strange psychological phenomena...

comment 4y ago · link · parent

Easily my favorite SciFi series of all time.

comment 4y ago · link · parent

Yes, and for these extra steps the money I earn is realistically not in danger of losing 20% of value overnight, can't be lost because the harddrive that held my password-safe got corrupted, the transactions are done instantaneously instead of whenever some miner feels like including them in his block, and the amount of energy required to process the payment, is probably not much more than I currently use to write and send this post.

I am okay with that.

comment 4y ago · link · parent

> Arguably mRNA vaccines are specialised nanobots.

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

> It is up to critics to provide evidence of PoS energy use being a concern

So, is there evidence, as in peer-reviewed studies, that PoS blockchains can handle the volume of transactions of traditional financial systems while requiring LESS energy?

comment 4y ago · link · parent

So if its not stored on the chain, where will it be stored, if not on central servers, where its ultimately under control of whoever owns them?

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 they don't exist.

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

Yes, but how is this different from charging a credit-card or publishing an IBAN?

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

People don't exchange public keys on the blorkchain, they use username/password to access their wallets, and these have a public key. That in itself doesn't authenticate anyone to anything, the only guarantee is that it is unique.

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

"pretty green" is not a unit of measurement.

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

Money isn't designed to do that.

Money is just an exchange token.

It has no control over what it is used for.

comment 4y ago · link · parent

PoS blorkchains do not solve the first problem completely (they still require an obscene amount of power to do something that can be done way more efficient) but implement an entirely new kind of problem: The more tokens someone already had, the higher his chances in the "stake-lottery".

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

Until the first person gets tricked into signing over his property for free...then suddenly, all these lawyers, agencies and notaries are back on the track again, because it turns out they were there for a good reason the entire time: To make sure its really really really hard to get someone to hand over his home via something like a typo or a misclick.

comment 4y ago · link · parent

> inefficiency here can actually be useful

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

> Yeah, but this actually works.

Exchanging public keys worked for decades before blorkchains were even a word.

comment 4y ago · link · parent

> It's a way to authenticate yourself without a centralized authority.

I do that without any involvement of a blorkchain on a daily basis. Everytime I use my ssh key to connect to a server that knows my public key.

comment 4y ago · link · parent

And how does a distributed Ledger solve these problems?

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?

1
464748
57