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

one of the most magnificent books ever written

That's true. I feel like the important bit is covering the essentials. 2x more is not 2x better, but you need to get above a certain threshold.

Incidentally this also holds for some engineering metrics. Some error metrics stop making sense after a certain threshold. E.g. if a certain error becomes disqualifying, doubling the error changes nothing.


Some study released years ago gave a USD value for the salary that was the happiness asymptote. Recent inflation has likely demolished that number, and I think it is an important one to know. It did not speak to the case of not needing a salary at all. The ability to be idle, or seelf direct however you want is very enticing, but I could see it going badly in a number of ways.

I think I have read that, IIRC it was around 150k?

When I read it it was 75, so maybe they did do the study again.

whoo! that you could jump back up and use variables from below has been an annoyance of mine

wow. this is it!


yes, same issue in all transformer tutorials


I suspect this is because most people (including people writing these tutorials) don't have a strong grasp on this piece as well.


The 2b1b video was the first to make it click for me


You mean 3b1b (three blue one brown)?


Ah that's right, miscounted the blues


under what circumstances does (2) hold? for vanilla methods it's no problem


C++ build systems are typically based on file timestamps. Modifying a header file triggers recompilation of all translation units including that header.

There are workarounds like pimpl (aka. C style encapsulation). But this requires extra boilerplate and indirection. C++ modules might fix it at some point, but after 35 years of not having them in C++ most real life codebases aren't set up that way and may never be.


I don't think of pimpl as a tool for speeding up compilation, but for black box encapsulation.

If the compile time (when adding a method) is really an issue you can chop up and reconfigure your include files. A pain, but perhaps saves you time in the long run.

Of course (waves hands) modules will magically improve things...someday.


I think it can be both things.

Haven't you ever seen someone do

    struct Thing;
    struct OtherThing;
in lieu of just including "thing.h"? I see it frequently in real life code bases and I can't see a reason for it other than compilation time optimisation.


Sure, I do that all the time too. But you can't call a method (or look inside Thing, or pass it as an argument, only a pointer to it) without including the definition.

Hmm, there might be some interesting linker hacks to patch things up post compilation. But then you'd want some way to do the forward declaration for cases where Thing could have been passed in registers...


This is sometimes required to break dependency cycles. Also, you can use this to rearrange declarations in the same file.


Pimpl is both. I use it as black box also, but it does both things.


Adding private functions or fields requires changing the class declarations, which requires rebuilding any code that includes that class deckaration. It shouldn't be like that, especially for methods which shouldnt change anything about the class ABI.

Even worse, this dependency is transitive. Dependencies to allow defining these private methods an fields are exposed too, forcing inclusion of headers to all members of the class, even if it's only implementation details.


>>> 2. Poor encapsulation, adding private functions requires recompiling all dependents

>> under what circumstances does (2) hold?

To add a private member variable or function, you need to put it in the class definition in the header file. Then anything that includes the header needs to be recompiled.


Admittedly, adding a private member variable changes the object size and thus the ABI and thus requires recompilation of dependencies.

Thinking about that, is there any case in which private functions can end up in a vtable? In that case, it'd break ABI too.


> is there any case in which private functions can end up in a vtable?

Yes, but it generally isn't something that is done.

https://godbolt.org/z/5oPovKzoT


they don't need to be. dependents will continue functioning, because ABI hasn't changed


Now explain that to my build system.

But even if you managed to do that, first compilation is still much slower than it should be, because anlot of headers have to be included (transitively) to allow even declaring these fields and methods.


If you touch a header, even private only, includers will rebuild. Modules might fix this.


grep truly is the king of tools


these zero days are already the status quo?!


This is about synthetic training data generation as much as it is about films


What will their model generate?


cool stuff!


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

Search: