Hacker News new | past | comments | ask | show | jobs | submit | cjensen's comments login

You're being confused by one of the parts of C that is difficult for beginners to wrap their heads around, and is a trap from the unwary.

In C, there are arrays. If you use the identifier that names the array as a parameter to a function, it gets quietly converted to a pointer to the first item of the array and all array size information is lost.

So you can obtain the array size, but only if you are dealing with the identifier that directly names the array. If you attempt the same technique on a pointer to the array, bad things will happen.


> If you attempt the same technique on a pointer to the array, bad things will happen.

Technically a pointer to the array will work as expected (i.e. void f(int (*x)[5])).


I don't understand. In the Meta the answer is used as an example of something that never gets deleted by the system. I don't see any anger about it -- just a discussion of a defect in the Stack Overflow system where unhelpful answers never get pruned.

And I’m curious how else SO should handle poor answers like that. Are they just supposed to leave bad answers like that up? Especially when OP admits they don’t actually understand the topic well and isn’t interested in fixing it?

Correct them?

An incorrect answer can be useful, because it often illustrates common confusions and naive mistakes that people are prone to making;

If it's corrected with an explanation as to why it doesn't work, a good wrong answer can be more educational than the answer that actually solves the problem.


There are tons of answers on that question already. Correcting it would just be duplicating one of the others…

He basically answered that the correct way to find the length of an array in c is to use c++ not c. I don't think there is any way to correct that answer, and responding to a question of how do i do X in C with "use C++ instead", is kind of obnoxious.

I think what people are getting bent out of shape about is the answer isn’t incorrect, but it defies their sense of order because it’s a cpp answer without a cpp tag.

In this case it seems to help about 50% of the people that see it?

Possibly more, since the downvoters are probably just triggered.


Meanwhile on some other programming forum, you ask a question about C, you only get answers about C++. SO is right to put minimal effort into preventing that happening. But they put maximal effort into it instead.

In Audubon's time, the only way to accurately paint a bird in detail was to shoot it, examine it, then paint it. It's also why so many of his paintings are of birds in unnatural positions.

Even today, museums and universities sometimes pay for non-rare birds to be collected by shotgun. Collections are needed for certain types of comparative analysis when trying to sus out whether two birds are different species or just variety within a species.


By "Ruse," they mean the law's ruse of claiming to only regulate the conduct of design, when in actual fact the law clearly intends to regulate speech. It's a "ruse" to try to avoid a court noticing that the law obviously violates the First Amendment.


Sometimes I think rvalue-references were a bad idea. Sure they improve efficiency for people using objects directly instead of through a pointer, but the amount of mental model added worries me that the average coder will have no real clue what rvalue references are. People really overestimate how much most coders understand.


Agree. Let's introduce xvalue, glvalue and prvalue to language spec. Let's define special cases for "auto". Then add some more ( decltype(auto) ). Let's add && overloading. Since it does not work automatically anyway, add move and forward. Now let's blame programmer for calling or not calling move or forward in specific place, because obviously when implementing algorithm the implicit lexical lifetimes of temporaries are what every programmer should focus his attention on.


They are quite complex and with a lot of ugly corners. I cannot but think that there must be a better solution.

The problem is that smarter and better programmes than me couldn't find one that would fit cleanly in the existing language after almost a decade of trying (boost had library based move emulation at the turn of the millennium, and the same authors came up with universal refs).


The generated C++ interfaces to gRPC are also filled with an incredible amount of indirection and unnecessary concepts. I'd say it's a "bad at writing complex things simply" culture rather than being Java-specific.


Autogenerated code in general tends to be unreadable. It's not easy and/or not a priority.


I don't know, but a hypothetical 'implicit' would mean converting all unmarked constructors into explicit constructors... which would have broken a lot of existing code.


There are many birds which are blue, but none of them have blue pigments [1]. It's a light-scattering effect.

[1] https://blog.education.nationalgeographic.org/2016/05/09/the...


Important bit from the article:

When white light strikes a blue feather, the keratin pattern causes red and yellow wavelengths to cancel each other out, while blue wavelengths of light reinforce and amplify one another and reflect back to the beholder’s eye … [D]ifferent shapes and sizes of these air pockets and keratin make different shades of blue.”


All color is a light scattering effect.. this article makes zero sense to me..



The best explanation I’ve read is Feynman’s delightful QED.


Haha OK, some avian plumage enthusiasts might find that a bit of a detour though!


Be aware that this is not a TV. The PVM Series of monitors are professional video monitors that are not offered for sale to mere consumers. This is the kind of thing that would be installed in the control room of a TV station to display the station's final output.

20 years ago the small video company I worked for had a $30K Sony PVM monitor that was probably only 30-35 inches. So the $40K price in 1990 doesn't surprise me in the slightest.

The only thing interesting about this is "biggest CRT ever made" because it shows the limits of CRT technology.


The assumption that it will wash away in the rain rather than find its way into cracks and pits in the rock is an awfully big bet to make vs permanent damage to history.


If this could "damage history" then we're way overdue putting the stones into a safe indoor storage facility.


It survived 4500 years, it’ll survive a bit of cornflour


Cool. So you'd be fine with me coming over and spray painting something of my choice on your house, assuming I assured you (with absolutely no supporting evidence) that it would go away over some unspecified period of time?

I do not think so.

Anyone who's been around small children knows that some food dyes do NOT disappear when washed, even with detergent.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: