Better HN
topnewbestaskshowjobs
Log inSign up

usrbinbash

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

Submissions

comment 1y ago · link · parent

> Your blend of comment was also directed at the likes of Google and StackOverflow.

No, it wasn't.

What such comments were directed at, and with good reason, where 'SO-"Coders"', aka. people when faced with any problem, just googled a vague description of it, copypasted the code from the highest scoring SO answer into their project, and called it a day.

SO is a valueable resource. AI Systems are a valueable resource. I use both every day, same as I almost always have one screen dedicated to some documentation page.

The problem is not using the tools available. The problem is relying 100% on these tools, with no skill or care of ones own.

comment 1y ago · link · parent

As I have said before, the fact that it is used, doesn't validate the usage. Yes, Go has recover. Yes, the stdlib uses it here and there.

Does any of that change the semantics of what a panic means, and how applications should therefore react? No. Does it make panics the equivalent of exceptions in Python semantically? Also no.

And this logic isn't limited to Go. Guess what, there are python libraries that use Exceptions for control flow. It certainly works. Does that validate using Exceptions as control flow elements? No, of course not. Why? Because that's not what an exception exists for semantically.

Panic-Recover cycles in go codebases are an antipattern, and unless I see an official statement by the people who make Go (who also write "Effective Go" btw.) saying otherwise, those are the semantics of the language.

comment 1y ago · link · parent

No it isn't. Semantics matter, and using something against the defined semantics of the language is a huge code smell.

For example, I could ignore the fact that Python has exceptions, and instead let functions return error values.

Would that work? Yes, absolutely, and I have seen Py-Codebases that do this.

Is it semantically correct? No, because in python, semantics dictate that error states are handled via exceptions, and that is the expectation everyone has when opening a python codebase.

When in Rome, do as the Romans do.

comment 1y ago · link · parent

> Can you explain why?

Because that is semantically what a panic means in Go. See the link to effective go I posted you elsewhere in this thread.

I am well aware that it can be used in other ways. Same as I can say "car" when talking about a mainline battle-tank. Sure, a car has an engine, runs on fuel and drives on land. There are similarities. The words still mean very different things.

And I am also sure there have been instances of someone using a tank to go order food at a drive-through. Doesn't mean that it is semantically correct to do so, or advisable.

comment 1y ago · link · parent

As another user has already mentioned, deferred functions run even when a panic unwinds the stack.

And semantically, a panic doesn't even need an orderly shutdown. Again: A panic should ONLY be issued if the application enters a state where continuation of normal operation is not possible, and/or may even be ill advised. "Orderly" operations are, by definition, no longer possible at this point.

comment 1y ago · link · parent

> I also like how golang docs literally describe using panics as poor man's exceptions:

And I like how https://github.com/golang/go/issues/26799 describes that use of panic in the original version of this bog entry from 2010:

quote:

However, this is a poor example and a misuse of panic and recover as exceptions. See https://golang.org/doc/effective_go.html#panic

The example will be invalid soon with the release of go 1.11 as well. The panic/recover was removed from the unmarshal code. See master's

end quote.

The blog entry was later changed because this was fixed. It now refers to marshaling which, sadly, sill uses this mechanism.

The fact that this is still in the json package is a pain point, yes. Does it validate the use of panic as a form of flow control? No. Here is what "Effective Go" has to say about the topic:

https://go.dev/doc/effective_go#panic

quote:

But what if the error is unrecoverable? Sometimes the program simply cannot continue.

For this purpose, there is a built-in function panic that in effect creates a run-time error that will stop the program (but see the next section).

end quote.

comment 1y ago · link · parent

> You can treat panics as a big deal, and not necessarily kill the whole program. It's not mutually exclusive.

Yes it is mutually exclusive. Something that doesn't kill the program, aka a recoverable ERROR CONDITION should not cause a panic, that's not what panics exist for.

Something that causes a panic without using the `panic` keyword, like an out-of-bounds read, nil-derference, etc. is indicative of a serious problem that should be fixed before the program is allowed to run again.

comment 1y ago · link · parent

> You're conflating unnecessary panics, with how to handle panics.

I don't think so. If I have to handle a panic, because otherwise my program no longer works, one of 2 things is true in the vast majority of cases:

- There is something seriously wrong with the program or its environment, causing it to panic

- There is something in the program issueing a panic when really it should return an error

In short: there should be no need to "handle panics"

Panics are irrecoverable conditions where its preferable for the program to crash rather than continue. If code panicks for any other reason, thats, in my opinion, wrong, and should be fixed. Panics are not the equivalent to exceptions, and error returns exist for a reason.

People who don't like that paradigm can always use a language that uses the exception-paradigm.

comment 1y ago · link · parent

> if a request / task panics

...and the condition why it panics is not a situation that warrants a crash, then whatever is called upon handling that request is issueing a panic when it shouldn't.

The reason why some libs do that anyway is exactly what I describe above: because in many peoples minds panic == exception.

That's a logic error in the code and should get fixed. And one of the best ways to make devs fix things, is to let their application crash when something that shouldn't happen happens anyway, because then someone will start complaining why a service is unreachable.

TL;DR:

If some condition shouldn't crash a process, it has no earthly business causing a panic.

comment 1y ago · link · parent

> Your list of additional parameters if anything supports that rather than arguing against it.

> perhaps you're trying to say that billions is obviously far too small, in which case I agree.

No, it doesn't, and I don't.

The processes that happen in a living brain don't just map to "more params". It doesn't matter how many learnable parameters you have...unless you actually change the paradigm, an LLM or similar construct is incapable of mapping a brain, period. The simple fact that the brains internal makeup is itself changeable, already prevents that.

> prediction may be a core element of our consciousness

No it isn't, and it's trivially easy to show that.

Many meditative techniques exist where people "empty their mind". They don't think or predict anything. Does that stop consiousness? Obviously not.

Can we do prediction? Sure. Is it a "core element", aka. indispensable for consciousness? No.

comment 1y ago · link · parent

> and they do an orderly shutdown. Or they should

Which is exactly what panic does.

comment 1y ago · link · parent

> In most software there's no such thing as unrecoverable panic

Webserver wants to start, binding port 443/80 isn't possible because another process holds that port.

Logging service wants to write to disk. The IO operation fails.

RDBMS want's to access the persistent storage, the syscall fails due to insufficient permissions.

How are any of those recoverable?

comment 1y ago · link · parent

> I thought that's why it's called "panic".

And you are exactly right.

The problem is: People are so used to the "exceptions" paradigm from other languages, when they see "panic-recover" many immediately think "That's the same thing!!"

It isn't, because the only VALID usecase for panics is exactly what you describe: unrecoverable error conditions where terminating the program is the best course of action.

`panic/recover` used like exceptions is an antipattern, and one of the worst code smells in a Go codebase.

comment 1y ago · link · parent

> On the contrary, we have 86B neurons in the brain

The neurons (cells) in even a fruit flies brain are orders of magnitude more complex than the "neurons" (theoretical concept) in a neural net.

> the weighting of the connections is the important thing

In a neural net, sure.

In a biological brain, many more factors are important: The existence of a pathway. Antagonistic neurotransmitters. NT re-incorporation. NT-binding sensitivity. Excitation potential. Activity of Na/K channels. Moderating enzymes.

Even what we last ate or drank, how rested, old, hydrated, we are, when our lats physical activity took place, and all the interactions prior to an input influence how we analyse and integrate it.

> but we are definitely 'running' a model with many billions of parameters to produce our output.

No, we are very definitely not. Many of our mental activities have nothing to do with state prediction at all.

We integrate information.

We exist as a conscious agent in the world. We interact, and by doing so change our own internal state alongside the information we integrate. We are able to, from this, simulate our own actions and those of other agents, and model the world around us, and then model how an interaction with that world would change the model.

We are also able to model abstract concepts both in and outside the world.

We understand what concepts, memories, states, and information mean both as abstract concepts and concrete entities in the universe.

We communicate with other agents, simultaneously changing their states and updating our modeling of their internal state (theory of the mind, I know that you know that I know, ...)

We filter, block, change, and create information.

And of course we constantly learn and change the way we do ALL OF THIS, consciously and subconsciously.

> At the very least, we are a long way from knowing for certain that we don't work in this way.

https://en.wikipedia.org/wiki/Russell%27s_teapot

comment 1y ago · link · parent

> Get an old used Thinkpad. Put Linux or one of the BSDs on it. Use low-resource options: LDXE, i3wm.

And then people use this upcycled, environmentally friendly option to connect to social media, their music provider, 2-3 streaming services, their workplace account, and various AI systems, all of which require datacenters eating up so much energy, that by now we consider building nuclear power plants just for them.

comment 1y ago · link · parent

> the point being jj is much much much much better than Git.

And I'll happily repeat: By what metric is it "better"? So far, I have heard your opinion, not metrics.

comment 1y ago · link · parent

> Just because you don't like it

Read my post again. Sympathy or lack thereof don't factor into this equation. This is about battle-testedness and features. I don't make technical decisions based on emotions.

comment 1y ago · link · parent

No I might not. In these similar situations, I will use sqlite, unless someone can point out one of the items listed above as a reason to use something else.

comment 1y ago · link · parent

"alternative" implies that this is either on a comparable level of battle-testedness and feature completeness as sqlite, or that it solves problems that sqlite has, or that is delivers substantiable, or at least noticeable advantages over sqlite.

So, which of these points apply?

comment 1y ago · link · parent

Cargo Cult Programming is as much a problem in DevOps as it is in Dev.

comment 1y ago · link · parent

I am not asking for opinions, I am asking for metrics.

10x is an arithmetic operation. Therefore, to make such an assumption, there has to be a quantity that operation can be applied to.

So, by what quantifieable metric is jj "10x better" than git?

comment 1y ago · link · parent

> But I don't have a problem with what someone else wants to run on their computer.

Neither do I. This discussion isn't about what someone else runs or doesn't run on their computers. By all means, run `jj`.

Or use `fossil`[1], which I maintain is technically superior to both `git` and `jj` (if you disagree, show me another VCS that also gives me a ticketing system, wiki, documentation system, forum and webui, all from a single executeable that allows me to set everything up with a few command line invocations ;-))

[1]: https://fossil-scm.org/home/doc/trunk/www/index.wiki

comment 1y ago · link · parent

And this assumption is based on ... what exactly?

comment 1y ago · link · parent

> Git is up there with Python packaging and regular expressions.

Probably. And neither Python Packaging nor regular expressions will be replaced by anything in the next few decades, for the same reasons why `jj` is unlikly to replace git, for the same reason why rust won't replace C, and the same reason why, 20 years from now, people will still have jobs fixing Java and PHP code.

> But it seems like bad engineering and a lack of curiosity to look at the quirks in a tool and not ask if we can do better.

No one is demanding that we stop asking. But as engineers we cannot just consider "better", we also have to consider "practical". And in practical, pragmatic considerations, "technically better" simply isn't enough to displace an entrenched tool. That is a fact, whether people like that or not.

I like the ideas of jj. I cheer the development. Will I replace my git with jj in the forseeable future? No. Why? Because pragmatic reasons.

To replace an entranched tool that does its job and has wide adoption, a new thing needs to offer absolutely astonishing advantages that become "must-have" just by the merit of their existence. And even then, the ROI of these advantages have to offset all the technical and logistic pain of switching from one to the other.

> but the UI of Git (i.e. all the commands and surrounding paraphernalia) has a lot of incidental complexity.

There is no shortage of wrappers around git abstracting the nitty gritty to nearly any level of complexity desired. I use vim-fugitive for example. GUI abstractions as well as CLI tools and TUI wrappers exist.

comment 1y ago · link · parent

> JJ works with git servers

For now. At some point, it may want to run features incompatible with git, and what happens then?

> nd people that don't understand git but do understand JJ can just run JJ.

And how many such people would you say are there? I am willing to bet that the vast majority of jj users know how to use git very well, and given the adoption of git, that is unlikely to change.

Secondly, git isn't just run by people, its run by scripts, pipelines, automated systems. git commands live in configurations, and elsewhere. Its a common language for how VCS works, not just a command line tool.

> Just because you don't run into that problem very often doesn't mean that other people, with different roles and workflows don't run into that problem more frequently.

It also doesn't mean that they do.

comment 1y ago · link · parent

> The existence of sites like ohshitgit.com is testament to that.

It's a testament to worldwide adoption first and foremost. If `jj` had the same adoption, there would probably be similar sites about it. No tool is perfect, and all have their quirks.

comment 1y ago · link · parent

> jj is better

Primarily jj is different. And a lot of the "problems" it solves barely ever come up in git. And when they come up, its usually as "difficult" as "google the solution and enter the commands". And worst case scenario, someone has to manually copy paste some files around.

If this happened every day, I'd agree that we need a different system. But it doesn't.

In short, the situations where jjs advantages can really shine, and the advantages in these situations are simply not common enough / important enough to justify the headache of switching the world over to another VCS.

In an ideal world, "the better" solution wins.

In a pragmatic world of limited resources, "better" on its own is not enough. The differential between the new and the old solution has to be large enough to offset the cost of switching, and the more entrenched the existing solution is, the higher that cost will be.

comment 1y ago · link · parent

Clicked on the Website. Greeted by the message: "Something has gone terribly wrong". It did load correctly at the second attempt, but I have to admit...well played with raising the dramatic effect webserver, well played ;-)

comment 1y ago · link · parent

I don't see how that is a problem, given how trivially easy most of these editors make it to rebind keys.

comment 1y ago · link · parent

The issue isn't about "screen vs. print", the issue is about "critical, discerning, questioning mind" vs. "mindless consumerism".

The epistemological collapse we are experiencing wasn't caused by information being online and disseminated via browsers.

It was, and is, caused by a mass of uninformed people, with strong tribal behavior, shutting out any information that doesn't fit their preconceived world views, and industries and politics designed to benefit from that behavior.

And btw. misinformation can be, and has been, spread via print [even today][1].

[1]: https://english.nv.ua/nation/russia-delivers-nine-tons-of-pr...

1
456
57