Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I remember studying the source code to the PHP Zend Engine 25 years ago, and seeing a triple C pointer for the first time (I think it was `zval***`?) I did a lot of PHP in the following years, including using PHP for a high school programming contest (but my submission was rejected because the PHP language and using it in a standalone CLI context in particular was unfamiliar to the staff). I appreciate what it enabled me to accomplish in that era.




That's hilarious considering I did my senior project in Perl.

> That's hilarious considering I did my senior project in Perl

Same. Wrote a web application using Catalyst and a client for mobile phones using J2ME.

Writing projects in obscure languages is the best way to avoid dumb professors/examiners ask you stupid questions about your codebase lol.

I remember reading the Wikipedia page of Perl the night before the oral exhibition, just to be sure and guess what... The examiner asked me about the difference between "Perl" (capitalized) and "perl" uncapitalized. Which was one of the first lines in the Wikipedia page.

The guy literally went fishing for stupid and pedantic questions to ask, on Wikipedia, the night before.


I honestly can't think up a reasonable case for a triple "naked" pointer. Nevermind performance, it's a level of implicit indirection that you simply can't reason about.

Think of what a pointer is. Picture a struct; accessing a member is dereference + offset. It makes sense, you know there's a car, and the car has a steering wheel, and the steering wheel has a horn button. Simple. A struct with one field, that field has an offset of zero - it fits our "naked pointer" case 1:1, but is more readable. The compiler will do the rest.

As my dear friend often noted, "why simple?"


Think of page tables this is essentially a table of tables of tables. I also was meh on triple pointers until I found this use case.

Yes, but the third level isn't a "triple pointer", but a pointer to the next level. A page table level isn't just a pointer-to-a-pointer but carries information. So a three-level table doesn't have `void***` in the top level, but `PageTableLevel2*`.

As colejohnson66 noted. I would use typedef table, typedef page, etc. A void* is a pointer to the void. A page table is a table of pages.



Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: