The AI Wave Tycoon's Rise
Chapter 293

Who Is NullPointer?

1,419 words•5 min read•0 views
23d ago•

Fan Xiaotian read through the not-too-long piece of code from beginning to end, then from end to beginning.

Then from beginning to end again.

He spent a full half hour on it.

Honestly, he didn't understand it.

It wasn't that the code was poorly written. Quite the opposite—it was written too elegantly.

Too elegantly to look like adaptation-layer code.

Adaptation-layer code had a characteristic.

It needed to pursue extreme performance, but that came at a cost. Sometimes, readability had to be sacrificed.

That was different from Internet programmers. To them, computational efficiency wasn't the most important thing; readability mattered more.

After all, code was written for people to read. There were so many engineers in a team—today you wrote it, tomorrow someone else did. If nobody could understand what you wrote, bugs would easily appear. As for whether your program ran a few dozen milliseconds faster or slower, that was relatively less important.

So Internet program code often didn't need extreme optimization, but its coding standards were very strict.

Hardware adaptation-layer code was different.

Readability was important too, of course, but hardware utilization was often pushed to the limit. A few milliseconds of efficiency loss could be magnified tens of thousands of times under heavy workloads, so all sorts of strange hack methods were often used.

So-called hack methods were programming slang, referring to methods that weren't very standardized but worked well.

For example, on a graphics card, the ratio between VRAM and cores should normally be calculated at runtime. But that number didn't change often, and calculating it at runtime added unnecessary overhead. So the hack method was to hardcode that ratio into the code.

That meant the code couldn't be used on other hardware at all, since the ratio was fixed, but it improved runtime efficiency.

But this

End of Chapter
Prev
NovelSummaries
Next