<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hacker News: pingyong</title><link>https://news.ycombinator.com/user?id=pingyong</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Sat, 25 Apr 2026 17:26:00 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=pingyong" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by pingyong in "A gentle introduction to pointers using C (2019)"]]></title><description><![CDATA[
<p>>When you explain floating point numbers you also put them into boxes?<p>That makes no sense. If I was explaining floating point numbers with boxes, for whatever reason, I'd put the values inside the boxes, yes. The analogy just doesn't work here, but the analogy for memory makes perfect sense.<p>>This is an unnecessary recursivity.<p>No, it's not. Think of a linked list for example. Traversing it makes perfect sense with my analogy: You open the first box, look at the number that's inside, open the box corresponding to that number, look at what number is inside that box, open the next corresponding box, etc. - it all makes immediate and intuitive sense.<p>If you just start with "open box x" (because x you somehow already know magically because it's already in a register), you haven't really explained much.<p>Or think of pointers to pointers. With my analogy: Easy! It's just another box which contains the value of the next box. If this concept isn't explained, a pointer to a pointer makes no sense because the pointer value has no corresponding box, hence no address.</p>
]]></description><pubDate>Wed, 17 Jun 2020 13:17:55 +0000</pubDate><link>https://news.ycombinator.com/item?id=23550981</link><dc:creator>pingyong</dc:creator><comments>https://news.ycombinator.com/item?id=23550981</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=23550981</guid></item><item><title><![CDATA[New comment by pingyong in "On Coding, Ego and Attention"]]></title><description><![CDATA[
<p>>There's something in here that's specific to SWE. I don't know exactly what it is but, I think we should figure it out.<p>It's changing requirements. When you build a house, people don't come in 6 months later and ask you if you could make one small change by placing some jet engines on the walls so the house can fly somewhere else during the summer. It's just a small change, right?<p>The problem is that in code, it often <i>is</i> a small change. Or at least, it <i>is</i> possible to make one quick adjustment to satisfy this new use-case. But often, these small changes are also a hack which doesn't fit into the previous overall design and which would've been implemented in a completely different way had the requirement been designed for in the first place. Now, one of these "small changes" don't tend to kill the product, but years or even decades do. That's why refactoring exists in software engineering, but not really in home building. Well, in some sense it does exist by renovating. But nobody thinks it's a good idea to completely renovate a house 25 times around an architecture that just doesn't work anymore for what it's being used for.<p>If you build a piece of software for exactly one well specified use case and only use it for that, it'll probably run really well forever. But (almost) nobody does that.</p>
]]></description><pubDate>Wed, 17 Jun 2020 12:54:13 +0000</pubDate><link>https://news.ycombinator.com/item?id=23550769</link><dc:creator>pingyong</dc:creator><comments>https://news.ycombinator.com/item?id=23550769</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=23550769</guid></item><item><title><![CDATA[New comment by pingyong in "A gentle introduction to pointers using C (2019)"]]></title><description><![CDATA[
<p>Because usually if I want to store something I put it inside the box? Not sure how that is contrived.</p>
]]></description><pubDate>Wed, 17 Jun 2020 12:09:48 +0000</pubDate><link>https://news.ycombinator.com/item?id=23550406</link><dc:creator>pingyong</dc:creator><comments>https://news.ycombinator.com/item?id=23550406</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=23550406</guid></item><item><title><![CDATA[New comment by pingyong in "A gentle introduction to pointers using C (2019)"]]></title><description><![CDATA[
<p>I've always explained it to people like this: Imagine a big cabinet, like a bunch of safe-deposit boxes in a bank. Each box has an unique number written on it, and the boxes are simply numbered 0 to 99. Now when you open a box, you find a piece of paper in it with a number between 0 to 99. It tells you which box to open next - so it points to another box. That's a pointer.<p>Seems to work pretty well, at least for conveying the basic idea of pointers and dereferencing.</p>
]]></description><pubDate>Wed, 17 Jun 2020 11:24:39 +0000</pubDate><link>https://news.ycombinator.com/item?id=23550150</link><dc:creator>pingyong</dc:creator><comments>https://news.ycombinator.com/item?id=23550150</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=23550150</guid></item><item><title><![CDATA[New comment by pingyong in "Canada extends financial aid for millions for two more months"]]></title><description><![CDATA[
<p>>Defaults aren't permitted.<p>So, what happens if a bank goes bankrupt?</p>
]]></description><pubDate>Wed, 17 Jun 2020 10:14:40 +0000</pubDate><link>https://news.ycombinator.com/item?id=23549757</link><dc:creator>pingyong</dc:creator><comments>https://news.ycombinator.com/item?id=23549757</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=23549757</guid></item><item><title><![CDATA[New comment by pingyong in "Canada extends financial aid for millions for two more months"]]></title><description><![CDATA[
<p>The housing market will never, ever crash again in any western country unless there's an economic turn that is incomparable to even what a 10 times more deadly COVID-19 could do.</p>
]]></description><pubDate>Wed, 17 Jun 2020 10:02:44 +0000</pubDate><link>https://news.ycombinator.com/item?id=23549680</link><dc:creator>pingyong</dc:creator><comments>https://news.ycombinator.com/item?id=23549680</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=23549680</guid></item><item><title><![CDATA[New comment by pingyong in "Forced social isolation causes neural craving similar to hunger"]]></title><description><![CDATA[
<p>I've been almost completely alone for about 3 months now, at least physically. And honestly... I couldn't feel much happier in that regard. It's been great. Maybe I'm broken or something.</p>
]]></description><pubDate>Tue, 09 Jun 2020 06:40:18 +0000</pubDate><link>https://news.ycombinator.com/item?id=23464310</link><dc:creator>pingyong</dc:creator><comments>https://news.ycombinator.com/item?id=23464310</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=23464310</guid></item><item><title><![CDATA[New comment by pingyong in "A Defer Statement for C"]]></title><description><![CDATA[
<p>>You'd have to define an empty class with a destructor, then instantiate the class at the appropriate place in your code. The point of Boost.ScopeExit is to handle that boilerplate for you.<p>I would argue that every time you want to execute something on scope exit, that essentially models a resource or lock of some kind. Which means the constructor wouldn't be empty (it would acquire the resource), and writing the class wouldn't really be "boilerplate", it would be clean design.<p>>This strikes me as hijacking a memory-management facility, using it for a different purpose than its intent. That's bad for readability. I'd prefer either ScopeExit or the dummy object pattern I described.<p>I think it is much better for readability, because it usually models the thing you want to do much more precisely. Although it is a shame that only unique_ptr is standard and not unique_handle, but you could write that yourself relatively quickly. This case doesn't just model that you want to execute something at the end of a scope, but that you have a handle to a resource that you can std::move around and that will get destroyed at the appropriate time (if you model your data correctly).</p>
]]></description><pubDate>Thu, 19 Mar 2020 11:11:13 +0000</pubDate><link>https://news.ycombinator.com/item?id=22626367</link><dc:creator>pingyong</dc:creator><comments>https://news.ycombinator.com/item?id=22626367</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22626367</guid></item><item><title><![CDATA[New comment by pingyong in "A Defer Statement for C"]]></title><description><![CDATA[
<p>Because the C++ compiler accepts an absolutely insane variety of code styles. I say this as someone who mainly writes C++. If I write my own project, or a project where I only have to work with a small number of people all of whom I know have extensive C++ experience, or a project that is so large that I can afford to consistently rewrite parts, educate contributors and maintain style guides, I choose C++. But anything that doesn't hit these bells, I'd rather use C (or something else). People mixing completely different styles in C++ is a nightmare.</p>
]]></description><pubDate>Thu, 19 Mar 2020 11:04:57 +0000</pubDate><link>https://news.ycombinator.com/item?id=22626340</link><dc:creator>pingyong</dc:creator><comments>https://news.ycombinator.com/item?id=22626340</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22626340</guid></item><item><title><![CDATA[New comment by pingyong in "1% rule"]]></title><description><![CDATA[
<p>Well it can't really get much higher than 95% of the time!</p>
]]></description><pubDate>Thu, 19 Mar 2020 10:42:08 +0000</pubDate><link>https://news.ycombinator.com/item?id=22626227</link><dc:creator>pingyong</dc:creator><comments>https://news.ycombinator.com/item?id=22626227</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22626227</guid></item><item><title><![CDATA[New comment by pingyong in "Giving Americans Money to Offset Coronavirus Impact Gains Support in Congress"]]></title><description><![CDATA[
<p>Some absolutely will. That's not really what I'm trying to argue against, people who would become homeless or starve should absolutely be helped.<p>However, a lot of people seem to be under the impression that this would boost the economy (because the idea is that almost everyone gets money so they can spend it instead of specifically helping with rent or food), which I don't think it will currently, or at least it won't in a meaningful way that helps the businesses who need it.</p>
]]></description><pubDate>Tue, 17 Mar 2020 15:00:05 +0000</pubDate><link>https://news.ycombinator.com/item?id=22605466</link><dc:creator>pingyong</dc:creator><comments>https://news.ycombinator.com/item?id=22605466</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22605466</guid></item><item><title><![CDATA[New comment by pingyong in "Giving Americans Money to Offset Coronavirus Impact Gains Support in Congress"]]></title><description><![CDATA[
<p>Hmm. A lot of businesses will get into big trouble over the coming weeks and potentially months. Bars, event organizers, even shopping malls. They're all going to go down to almost zero profit for a while.<p>The problem is if you just give people money right now, they literally can't spend it on those things because they are or will be closed during that time. Money isn't the reason they're not going, Corona is.<p>The money would be spent on things that are doing well now anyway (rent, food and netflix/videogames/etc.).<p>Maybe right now the focus should be on not making people homeless, but then giving people money after the crisis so they can spend it in the industries that are suffering right now.</p>
]]></description><pubDate>Tue, 17 Mar 2020 14:43:09 +0000</pubDate><link>https://news.ycombinator.com/item?id=22605237</link><dc:creator>pingyong</dc:creator><comments>https://news.ycombinator.com/item?id=22605237</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22605237</guid></item><item><title><![CDATA[New comment by pingyong in "One Word Broke C"]]></title><description><![CDATA[
<p>I'm not entirely sure how that is an example I asked for. In this case, it seems like the compiler in both cases was able to see that the loop always terminates, either by hitting 0 directly, or by wrapping around and then hitting 0, or by simply assuming integer underflow to be UB.</p>
]]></description><pubDate>Tue, 17 Mar 2020 09:31:03 +0000</pubDate><link>https://news.ycombinator.com/item?id=22603180</link><dc:creator>pingyong</dc:creator><comments>https://news.ycombinator.com/item?id=22603180</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22603180</guid></item><item><title><![CDATA[New comment by pingyong in "One Word Broke C"]]></title><description><![CDATA[
<p>My point is that if a loop<p>- doesn't terminate, doesn't have side effects -> optimization doesn't matter<p>- doesn't terminate, has side effects -> optimization isn't valid<p>- does terminate, doesn't has side effects -> optimization would be valid, but why would such a loop exist? One example that was brought up was generic code, but I'm not entirely convinced yet.</p>
]]></description><pubDate>Mon, 16 Mar 2020 16:16:21 +0000</pubDate><link>https://news.ycombinator.com/item?id=22593920</link><dc:creator>pingyong</dc:creator><comments>https://news.ycombinator.com/item?id=22593920</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22593920</guid></item><item><title><![CDATA[New comment by pingyong in "Microsoft unveils full Xbox Series X specs with 1TB expansion cards"]]></title><description><![CDATA[
<p>They did that last gen already, PS4 and XB1 are just PC laptop hardware.</p>
]]></description><pubDate>Mon, 16 Mar 2020 15:40:12 +0000</pubDate><link>https://news.ycombinator.com/item?id=22593606</link><dc:creator>pingyong</dc:creator><comments>https://news.ycombinator.com/item?id=22593606</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22593606</guid></item><item><title><![CDATA[New comment by pingyong in "One Word Broke C"]]></title><description><![CDATA[
<p>So, generic code with a loop, which, depending on parameters, sometimes has side effects and sometimes doesn't, and in the case that it doesn't have side effects it is still not easy to recognize if the loop terminates?<p>I suppose that is possible, although I'm having a hard time coming up with any reasonable examples.</p>
]]></description><pubDate>Mon, 16 Mar 2020 15:38:03 +0000</pubDate><link>https://news.ycombinator.com/item?id=22593589</link><dc:creator>pingyong</dc:creator><comments>https://news.ycombinator.com/item?id=22593589</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22593589</guid></item><item><title><![CDATA[New comment by pingyong in "Hard Truths for New Software Developers"]]></title><description><![CDATA[
<p>>You'll often be stuck with code that you know is flawed, that you want to fix, but the organisation won't give you time to fix it until it's too late.<p>This has unfortunately been my experience as well. Although in some sense I can understand it now. When only ~10k normal people per year use something, the chances of one of them trying to kill it are apparently pretty low. Although I'm still convinced at some point it is going to happen.</p>
]]></description><pubDate>Mon, 16 Mar 2020 15:25:33 +0000</pubDate><link>https://news.ycombinator.com/item?id=22593483</link><dc:creator>pingyong</dc:creator><comments>https://news.ycombinator.com/item?id=22593483</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22593483</guid></item><item><title><![CDATA[New comment by pingyong in "One Word Broke C"]]></title><description><![CDATA[
<p>What point is there in deleting side-effect free loops though? Literally the only use for those is to trap the control flow.</p>
]]></description><pubDate>Mon, 16 Mar 2020 13:15:17 +0000</pubDate><link>https://news.ycombinator.com/item?id=22592361</link><dc:creator>pingyong</dc:creator><comments>https://news.ycombinator.com/item?id=22592361</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22592361</guid></item><item><title><![CDATA[New comment by pingyong in "One Word Broke C"]]></title><description><![CDATA[
<p>Okay and which optimization does this allow for? What's the difference in the emitted binary?</p>
]]></description><pubDate>Mon, 16 Mar 2020 12:26:09 +0000</pubDate><link>https://news.ycombinator.com/item?id=22592050</link><dc:creator>pingyong</dc:creator><comments>https://news.ycombinator.com/item?id=22592050</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22592050</guid></item><item><title><![CDATA[New comment by pingyong in "One Word Broke C"]]></title><description><![CDATA[
<p>Is there even a case where the compiler can optimize a terminating loop better when it is allowed to assume that it will terminate at some point?</p>
]]></description><pubDate>Mon, 16 Mar 2020 11:28:58 +0000</pubDate><link>https://news.ycombinator.com/item?id=22591769</link><dc:creator>pingyong</dc:creator><comments>https://news.ycombinator.com/item?id=22591769</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22591769</guid></item></channel></rss>