HNHacker News
TopNewBestAskShowJobs

simplotek

1,581 karma · joined October 22, 2022

submissionscomments
simplotek··on Named Booleans prevent C++ bugs and save you time
> If the short circuit becomes critical for performance the

The point is not performance. The point is readability, and expressing things clearly and with the appropriate level of detail and leaving out nesting and scope. Safety and performance are important but secondary advantages.

simplotek··on C-rusted: The advantages of Rust, in C, without the disadvantages
> Without the disadvantages? What advantage does C hold over Rust if you value a composable language which is safe and expressive?

Having existing C codebases in production which are time-tested and stable and reliable is a huge advantage of having to rewrite them from scratch, don't you think?

Also, you can check out C code from 20 years ago and build it in your personal laptop with ease, and be able to do the exact same thing 20 years from now. Meanwhile, Rust still fails to put together a single specification, let alone a standard one, and relies on reference implementations that may or may not exist in a few years.

simplotek··on C-rusted: The advantages of Rust, in C, without the disadvantages
Code reviews don't replace automatic tests or even linters. What leads you to believe they replace memory management errors?
simplotek··on C-rusted: The advantages of Rust, in C, without the disadvantages
I agree, these ignorant Rust fanboy comments don't help Rust gain any goodwill, and even convey the idea that their vocal proponents are clueless and completely out of touch with basic industry requirements. It's unthinkable for any project to just casually drop everything and go for a complete rewrite in entirely different programming languages and tech stack. But this blend of Rust fanboys keep on insisting this is a reasonable thing (only when it's Rust, oddly) and have the gall of trying to turn things upside down and make believe that it's unreasonable to not jump head first onto a major rewrite.
simplotek··on John Carmack on Functional Programming in C++ (2018)
> C++ is not necessarily popular for its merits. Inertia has a lot to do with it.

This personal assertion says nothing about C++ other than stating you have an irrational dislike for it. There are plenty of reasons that make C++ one of the most successful programming languages in mankind's history, if not the most successful, and inertia is not it.

simplotek··on Named Booleans prevent C++ bugs and save you time
> in mine, yes definitely 100% the second code is more readable than the first

If anything, adding a nesting level for each chained predicate makes code harder to read, and needlessly so.

simplotek··on Named Booleans prevent C++ bugs and save you time
> in short circuit conditionals even more so.

I'm curious, what leads you to believe that skipping unnecessary calls to functions with side effects is something to be avoided? Do you believe that unconditionally calling code with side effects specially when you don't have to is something to be desired?

simplotek··on Named Booleans prevent C++ bugs and save you time
> Relying on short circuiting to avoid side effects or improving performance meaningfully is pretty shaky.

You've got it all backwards. Short-circuiting is not used to avoid side effects. Short-circuiting is used to avoid needless calls to any predicate, which can have and often do has side-effects, and if it doesn't have today it might have tomorrow.

If you don't call them when you don't have to, your code is in a better shape.

And let's not pretend that unconditionally macode with side effects when you don't have to is a good practice.

simplotek··on What modern utilities should be a standard part of a modern unixy distro?
> I may be a little cynical but when I read the words "modern utilities" my first associations are: (...)

I think this comment is too short-sighted and naive. In the end at best it's an apples-to-oranges comparison between what you personally like and are used to with a cherry-picked set of tools and what you personally don't like and have an axe to grind with a cherry-picked set of strawmen.

There are plenty of decades-old tools that provide colorful TUI interfaces that don't integrate with standard tools and make them hard to reuse with UNIX tooling. There are plenty of excellent non-standard tools that are quite recent and raise the bar in UX. This is not an old-vs-new comparison. This is reads like a rant directed at strawmen.

Let's face the facts: JSON is excellent as a data interchange format, and YAML is a far improvement in expressiveness over INI-type formats. Colors are important to make things human-readable, and TUI is a UX godsend in applications that involve view-heavy data presentation and ensure complex commands can be a key press away.

simplotek··on Named Booleans prevent C++ bugs and save you time
> The named booleans suggested here help adding clarity, but more often than not they'll end up being single-use (const) variables that just paraphrase their definitions.

That's ok. The worst tradeoff in the "named booleans" pattern proposed in the blog post is that it misses the whole point of chaining predicate evaluations, which is leveraging short-circuiting to prevent further predicates from being evaluated.

Chaining logical comparisons and the way they short-circuit is specially important when a predicate has preconditions and/or is expensive and/or has side-effects.

If your predicates are hard to read you don't fix that mess with "named booleans". You fix them by extracting them to a pure function like

   isNotUnknown(_someLongNamedVar) && isNotEmpty(_someLongNamedVar)
simplotek··on John Carmack on Functional Programming in C++ (2018)
> So many of the problems I see come from developers (myself included) adding new business logic to a process, or fixing a bug and not thinking through the side effects of the change

That's a great take, but I'd turn it upside down. Problems come from developers adding new features while not being mindful of the importance of helping out whoever is reading that code in the future to understand what are all the possible states.

Anyone can hack together code that's all over the place, but forcing people in the future to do shotgun surgery is as bad as adding the bugs ourselves.

simplotek··on John Carmack on Functional Programming in C++ (2018)
> The word game appears twice in all the articles, so I took this writing as a broad outlook. And C++ is not C.

C++ is indeed not C. C++ is a considerable improvement over C. You can stick with your C-style code and get the same result you'd get if you had used C, but you still have access to features that simplify a great deal your life and don't have a performance impact, like templates. With C++ you can have your C cake and eat the C++ cake too. The only drawback is compilation times, but any caching system takes care of that.

simplotek··on John Carmack on Functional Programming in C++ (2018)
> There's also almost nothing pragmatic about C++.

That's a heck of a weird take. C++'s main value proposition has always been pragmatism. In all possible and conceivable aspects of a programming language. The fact that is a (mostly) superset of C, support for OO, RAII, outstanding backwards compatibility, time-tested and future-proofed, "you pay for what you use", it targets everything and runs everywhere, it's the language of choice on most mainstream OSes and specially Windows, etc.

Why do you think people tolerate footguns and memory shenanigans? Why do you think that C++ is still one of the most popular languages ever devised and continued to hold the crown even after the C++98 cross through the desert?

C++ has been the optimal choice with regards to pragmatism at least for the past two decades. What does C++ offer other than pragmatic solutions?

simplotek··on C++23 “Pandemic Edition” is complete
> but I do use linters (like clang-tidy) that enforce a decent chunk of the guide. And reference like a style guide (or any documentation really), yes.

That's my experience as well. Clang-tidy, clang-format, cppcheck and Core Guidelines. I don't recall the last project I've worked that didn't used that combo.

simplotek··on C++23 “Pandemic Edition” is complete
> For whatever reason it's never really caught on

I don't believe this is true at all. I don't recall working on a single C++ for the last half dozen years which hasn't adopted the Core Guidelines up to the code review level.

Of course it's a blend of survivorship bias to claim that no project uses the Core Guidelines if you personally fail to consider it to start with.

simplotek··on Mozilla removes Bypass Paywalls Clean extension from its add-ons repository
> I wonder if the author writes this content for free or if they expect to be paid.

Does your personal expectation of getting your business model validated enjoy the privilege of stifling everyone else's ability to benefit from a free internet?

I mean, the internet was already around way before paywalls were invented.

And does your business model enjoy this exclusive privilege or does each and every business model have the right to strong arm everyone you deem a market to lose rights?

simplotek··on Loyal to the Company
> I agree. The only reason it’s “inhumane” to lay people off is because of our horrible safety net and ridiculous cost of education.

It goes way beyond that point. Your tenure in a company requires you to specialize and develop your skills to meet the needs of your employer. When you are fired then the employability of those skills might be none or even detrimental to finding jobs anywhere else. The longest you work for an employer, the more potential you risk losing.

Also, you will leave an employer at a different stage in your life. Your ability to allocate your time and energy to onboard onto the requirements of another company can be severely limited due to factors like your family responsibilities or even your health and energy levels. Working for a company always requires you to waste potential that could be used.

Lastly, you will make life decisions around your work. For example, you might buy a home based on factors such as where your workplace is, your job requirements, and your salary range. If you're forced to switch jobs you might be forced to sell your home at a point in time that is detrimental to your interests.

For a company, an employee is expendable. For an employee, being fired can and often has a profound detrimental impact in their life, physically, mentally, emotionally, economically, and socially as well.

A job is not a mere business deal. A job is a social contract. An employer demands employees to make life changes around them, and employees are expected to comply. It's profoundly unfair and one-sided to make believe that an employee's social responsibilities only go as far as their paycheck.

simplotek··on Spanish rail's costly blunder: New trains too large for tunnels
> France had a similar (but more easily mitigated blunder): Trains too wide for station's platforms, requiring ~1000 platforms to be "re-configured".

France's problem was entirely different. They designed a train up to spec, but it turned out that about 10-20% of train stations failed to comply with it.

simplotek··on Wikipedia’s Intentional Distortion of the History of the Holocaust
> Your use of terms like “conspiracy theory” make it seem like you’ve come to some very strong opinions about this specific debate.

Holocaust denial is a long lived conspiracy theory. There is no way of getting around that fact.

> Your original question at the top of this thread made it seem like you had a reasonable meta-question about whether it’s appropriate to “escalate” editorial conflicts to a journal (...)

There is no escalation. There's at best a blatant attempt to throw accusations in a way that prevents those attacked of defending themselves, and at worst there is libel.

Let's look at the facts: the wikipedia article on the Holocaust is clear in pointing out that the 6 million figure was actually provided by the leading Nazi official responsible for the Holocaust. The same wikipedia article then says in no unclear terms that "Historians estimates range from 4,204,000 to 7,000,000." What exactly is questionable about these facts? Nothing.

simplotek··on Wikipedia’s Intentional Distortion of the History of the Holocaust
> This seems like a strawman. The dispute in question isn't over whether 6000000 died or 6000001. It's over "4-5 million" or "6 million".

I that my statement is not easy to misunderstand, and only bad faith can lead to this sort of conclusion. Did you actually had any difficulty understanding the point I made?

> Suppose we had incontrovertible evidence that it was actually 4 mililon.

Again, this is the sort of disingenuous argument that can only originate in bad faith.

Let's put things in perspective: the wikipedia article you're supposedly discussing is already quite clear in it's section on the death toll of the Holocaust.

It states in no unclear terms that "The most commonly cited death toll is the six million given by Adolf Eichmann to SS member Wilhelm Höttl, who signed an affidavit mentioning this figure in 1945."

Afterwards, the same article points out that "Historians' estimates range from 4,204,000 to 7,000,000.[419] According to Yad Vashem, "[a]ll the serious research" confirms that between five and six million Jews were murdered."

And here you are, pushing the Holocaust denial agenda by misrepresenting what an estimate is what wikipedia actually states, and the veracity of anything that supports the idea the Holocaust happened.

simplotek··on Wikipedia’s Intentional Distortion of the History of the Holocaust
> What you said above could be applied to both sides of this debate, even in this thread. I

Not really.

One side says "there is no way to accurately tell exactly how many died in the Holocaust, but it's estimated the number can go as high as 6 million".

The other side says "the 6 million number is a lie they made up to push the idea the Holocaust happened".

Let's not pretend that attacking estimates by misrepresenting them like this is an argument made in good faith.

simplotek··on Wikipedia’s Intentional Distortion of the History of the Holocaust
> If the issue here is that Wikipedia’s editor set is being dominated by motivated nationalists, then the issue should absolutely be addressed in a non-Wikipedia forum.

This sort of whataboutisn is a blatant attempt at reframing the issue as an irrational ideological battle where one side just so happens to be winning instead of what it really is: a random guy trying to push unfounded conspiracy theories into a medium designed to express consensus supported by primary sources.

simplotek··on Wikipedia’s Intentional Distortion of the History of the Holocaust
> It gets even worse when you find that asking questions about this specific historical event can get you considered (...)

https://rationalwiki.org/wiki/Just_asking_questions

simplotek··on Wikipedia’s Intentional Distortion of the History of the Holocaust
> It's more likely that a Holocaust denier would have luck convincing someone if the commonly touted numbers are inaccurate and vociferously defended.

Why do you think Holocaust deniers are hell bent on nitpicking about these estimates? Their tactic is to use them as a wedge to push other bad faith arguments to cast doubt on all aspects of the Holocaust. Again, do you think it makes any difference if a gross estimate is 5-10% over or under? The strategy followed by Holocaust deniers is to abuse this logic to jump to conclusions like "if they are wrong about these numbers then what other lies have they been pushing?"

simplotek··on Wikipedia’s Intentional Distortion of the History of the Holocaust
> What if I don't give a shit about what you 'tolerate' or not?

In that case you should understand that no one is obligated to hear you whining about topics, specially those you're not even willing to discuss.

simplotek··on Wikipedia’s Intentional Distortion of the History of the Holocaust
> Free and open societies don't decide at all what they tolerate.

I'm sure that we don't need a debate to agree that genocide is something that's not acceptable. Do you disagree?

simplotek··on Wikipedia’s Intentional Distortion of the History of the Holocaust
> Wikipedia is vulnerable to coordinated, tendentious editing

Wikipedia is not a primary source. Wikipedia quotes primary sources. If you insist in pushing a belief that's not supported by primary sources then you are the problem, not wikipedia.

To me this article reads like someone trying to push unfounded propaganda I'm wikipedia to whitewash conspiracy theories with a veneer of authoritative source, but was stopped by their inability to present primary sources that supports his personal claim.

Once that character lost an edit war, he resorted to attack wikipedia with yet another conspiracy theory.

It's telling that the article has been framed with a conspiracy behind wikipedia while leaving the supposed sources as unquestionable.

simplotek··on Wikipedia’s Intentional Distortion of the History of the Holocaust
> Then why don't you correct the number, if it's irrelevant?

The number is not wrong. It's an estimate. Any reasonably intelligent person easily understands that the Nazis did not operated a counter which stopped the genocide when I hit 6000000. It means nothing if you say "up to 7" or "up to 6".

What makes a huge difference is the relentless effort to leverage this sort of revisionism to argue that nitpicking over estimates means the Holocaust did not happened at all.

simplotek··on Wikipedia’s Intentional Distortion of the History of the Holocaust
> What is weird is that they want to make it illegal in Canada and the US to even study or question history.

I don't believe that was ever the case. Holocaust denial is such a pervasive and murderous conspiracy theory that any free and open society cannot tolerate. But denying the Holocaust is not the same as studying it.

simplotek··on Wikipedia’s Intentional Distortion of the History of the Holocaust
> The big distortion is from 4-5 million killed to 6 million killed. More thorough review of records, and tallying up survivors, showed that fewer Jews died than first estimated. It's a weirdly touchy subject.

It's not "weirdly touchy". Holocaust denial is a relentless conspiracy theory, and those pushing antisemitism are relentlessly pushing slippery-slope arguments to push their agenda.

It's irrelevant if 6 million Jews were slaughtered by the Nazis during WW2 instead of 7 million or 5 million. The problem is how this sort of nitpicking revolving high-level gross estimates is leveraged to deny it ever exist and fuel further hatred targeting Jewish people.

← PreviousPage 12 of 26Next →