HNHacker News
TopNewBestAskShowJobs

identity0

514 karma · joined March 7, 2019

submissionscomments
identity0··on C’s Biggest Mistake (2009)
You can't do compile time bounds checking, if that's what you're implying.
identity0··on Motivation – Keli Language
And you can emulate most of C++ in C with macros. Doesn't mean you should.
identity0··on Interview with Zig language creator Andrew Kelley [video]
There are literally 100s of high level languages, for every imaginable programming paradigm. If you want to write fast code where you control memory and don't use a garbage collector, C, C++, and Rust are your only options. It's nice to see new additions to the list.
identity0··on The periodic table, colour coded by the likely origin of each element
Brown: made by monkeys on terrestrial planets
identity0··on Facebook launches its TikTok rival, Instagram Reels
Haha no. Facebook is where successful instagram features go to die.
identity0··on Implementing UFCS for C++ in Clang
It's called "uniform function call syntax" because it comes from D unifies function calling between member functions and free functions. It's not called "uniform function declaration syntax" because the declarations are obviously not unified. The fact that you have to declare functions shouldn't be relevant to the name.

And of course rust people found a way to make this all about rust. I highly doubt the Clang devs are thinking "hmm we're really close to compiling rust but we just can't figure out UFCS." And C++ is not at all a sinking island.

identity0··on The Case Against OOP Is Wildly Overstated
I never said encapsulation was easy or obvious in C, just that it's nothing new or inherently OOP-based. I also never said that you should never use inheritance, I was just quoting the author, who, in his "defence" of OOP admits that OOP's only unique feature should not be used at all.
identity0··on Inheritance in C using structure composition
I don’t know if this is actually how C++ compilers do inheritance, but reading about how GTK does object-oriented in C[1] taught me a lot about what (might be) happening behind the scenes in C++.

1: https://www.linuxtopia.org/online_books/gui_toolkit_guides/g...

identity0··on Views on Error Handling
For the third case it’s better to just abort. Tell the user to get more RAM or something. What are you supposed to do when you’re out of memory? Catch the exception? Then what?

Related, I always find it funny when C programmers write `if (malloced == NULL) return NULL;` Either you’re going to forget that this can happen and dereference null (in which case it’s just better to abort the program immediately) or the caller will check this and then close the program. If it doesn’t, the next malloc will be null anyways, and the problem repeats. Just call abort().

identity0··on Views on Error Handling
The obvious solution (in C++) is not to use exceptions at all, but make your own `error` and `expected<T>` class, and just add [[nodiscard]] to them. All the benefits of Go-style errors, you’ll never forget to check the error, and there is very little runtime overhead. If you pass the error as an out parameter then there is zero runtime overhead on success.
identity0··on Facebook readies global launch of its TikTok competitor
If you used it you would know. It’s fucking terrifying. I used to use it and hours would just disappear without even noticing. It also destroys your attention span. It turns out than if you spend two hours watching some novel thing every 15 seconds, it becomes much harder to focus on a task or watch a movie, where you need to follow a cohesive plan for two hours.
identity0··on Decentraleyes – Local CDN Emulation
I’m pretty sure it works with ublock origin and umatrix. If the JS is blocked it won’t run. Not sure about NoScript though.
identity0··on Java Optimized Processor (2005)
Why do we optimize our CPUs to fit our programming languages instead of desigining our languages around our CPUs?
identity0··on Json-Base – Database built as JSON files
What are you talking about? They have tests right here: https://github.com/Devs-Garden/jsonbase/blob/master/test.js

Just uncomment the tests you want to run! Easier than using a testing library IMO.

identity0··on India bans TikTok, WeChat, and dozens of other Chinese apps
Yes you can. I tolerate cats but I also tolerate cat haters. If people wanted to ban cats, I can disagree with them, but I wouldn’t be opposed to tolerating them, hearing their opinions, and giving them a forum to talk. Tolerance does not mean endorsement or acceptance.
identity0··on Deep Chernoff Faces
So? That just means that two variables are closely related. You have to be very blind and ignorant to take the implication that white people are less happy, or something. Is it racist to take a photo of a sad white person?
identity0··on Deep Chernoff Faces
You have to be joking. This is obviously one programmer's experiment on some esoteric data visualization mode that nobody ever used. The author even says in a footnote that:

> "One of my favorite¹ concepts for multi-dimensional data visualization is the Chernoff Face"

> 1: "Favorite" might be code for "useless," going with the theme of this blog"

Don't act like this project will have actual real world uses and ramifications. No, it won't literally teach people to associate good or bad qualities with facial features, because nobody will ever use it for practical purposes. No, there's no liability to promote prejudice, this is just some programmers ML side-project.

> How is that not objectifying?

It literally is. The generated faces are mathematical objects. They're not real people.

identity0··on A/B Street: A simulation game to fix Seattle's traffic
That article you posted is just stupid. Yes, maybe now people won't be pressing buttons, but COVID won't be around forever. In a few months/years/whatever the pedestrian button will still be around, people will still press them, and they will still be a valid solution to traffic. The article also says:

> These buttons have long been decried and criticized by advocates for walking, anyway. The buttons’ purpose is less to keep people safe than to reinforce the primacy of cars on the street by forcing people who want to cross a street to “beg” for a walk signal.

This makes it sound like buttons are some kind of implement of the bourgeoise, used to "reinforce the primacy of cars" and keep the pedestrians powerless. In reality, whether pedestrians like it or not, cars are primary. The roads literally exist for cars. As a pedestrian, I would do the very difficult task of pressing a button, if it meant that as a driver I could have less traffic and hit less red lights.

identity0··on Saying thanks: testing a new Reactions feature
I think that's the great thing about SO. It's a repository of common questions, yet also manages to be great for asking questions as well.

A lot of people in this thread seem to hate SO, and I disagree with them. If I ask a question on SO, no matter how obscure of a library or language I'm using, I'll get a response back within a day. And if my question gets flagged for being a duplicate, then I've just been redirected to more resources to solving my problem. It may not be warm and welcoming, but it's very helpful.

To be useful, SO doesn't need to be welcoming at all. It needs to be exclusive. If it wasn't elitist, it would be filled with Java programmers pasting 400 lines of code with little explanation. The elitism has caused me to write better questions and to really think about the hypothetical person answering my question. Elitism and helpfulness go hand in hand. If you want to see the horrors of a non-elitist Q&A forum, go check out the Unity forums or any popular Github repository.

identity0··on A little bit of plain JavaScript can do a lot
It’s a little funny seeing vue/angular/react/whatever people discover vanilla JS. I thought classList, innerHTML, and querySelectorAll were all extremely common knowledge.
identity0··on RSS Box – RSS for websites that do not support RSS
Well if the feed doesn’t contain older entries, it’s impossible without something like the Wayback machine (and I doubt they store rss feeds)
identity0··on Micromort
Relativity. If they could add that way, you would get 300 megameters/s, which is breaking the speed of light.
identity0··on Zoom to bring end-to-end encryption to all users, including non-paying
> Why care about privacy in one area when this completely unrelated area does it worse?
identity0··on How the most popular Chrome extensions affect browser performance
In my experience, PB pretty much does nothing. UBO already blocks trackers and social media buttons, and if it doesn’t, you can turn on those filters. PB doesn’t even block the trackers until it “learns” that they are trackers, it just avoids sending cookies (which doesn’t stop facebook from fingerprinting you.) The best method would probably turning off 3rd party scripts and iframes in UBO, but that does mean you have to un-break a lot of sites. An extension like cookie autodelete would also do much more than PB, since, if you have no cookies, they can’t be sent.

Edit: I realized that I sound like I’m bashing PB too much. PB is definitely better than nothing, and doesn’t break any sites, but there are better things you can do which make PB obsolete.

identity0··on C implementation of Tic-Tac-Toe in a single call to printf
No it doesn’t. It has finite instructions for the loop body, and then one jump instruction for the loop.
identity0··on C implementation of Tic-Tac-Toe in a single call to printf
Would you say that an infinite loop has infinite lines of code?
identity0··on I was blackmailed – any YouTuber could be next
>Is there a legitimate, distinct, unique use case for physical cash to weight against its use as an enabler for virtually all crimes?

Just because something enables crimes doesn't mean it needs to be stopped. Even though many don't use bitcoin, the ideas that bitcoin (and physical cash) represent outweigh their capabilities for committing crimes.

identity0··on BlizzCon 2020 Cancelled
It is, and it’s pretty funny
identity0··on Quines: self-replicating programs (2005)
Not cheating as in “it might not work,” cheating as in “it trivializes the exercise.” The point of making a quine is a programming challenge. If python had a function called “quine()”, I would still call it cheating even if it worked 100% of the time.
identity0··on Quines: self-replicating programs (2005)
I mean, obviously. I would say it counts as cheating though. It’s on the same level as opening the source code file and printing it out.
← PreviousPage 3 of 4Next →