Chapter 20 Lin Shen's Code Philosophy
Chapter 20 Lin Shen's Code Philosophy
Five days to go, early morning
On the sixteenth floor of Building C in the Kexing Science Park, only the lights of the Light project team were still on.
This brightness no longer possessed the sharpness and heat of the countdown at its beginning; instead, it was a weary, barely sustained paleness.
Lin Shen submitted the last line of test cases, leaned back in his chair, and let out a long breath.
The @everyone and message recall features that he was responsible for finally passed all the checks of the automated test suite after being scrapped and restarted three times in 48 hours. The green light on the screen means that the review has been approved.
He turned his head and looked towards the office area.
Lu Chuan was already asleep, slumped over the table, a half-eaten cookie still clutched in his hand. Cheng Xiangdong leaned back in his chair, eyes half-closed, his fingers unconsciously tapping a rhythm on his knee. Only the backstage team on Wang Hao's side was still "moving"—not actually making any sounds, but a deathly silence. Six people sat around three whiteboards covered in calculations, and no one had spoken for two hours.
As it stands, the only remaining major hurdle for Light is the completion of its voice module.
This part has always been Wang Hao's responsibility, but clearly, they're stuck.
"Stop for a moment."
Chen Mo's voice suddenly rang out, not loud, but in the silence of four in the morning, it was like a pebble thrown into a deep pool.
Everyone looked up.
"Version 0.8 is packaged and will be pushed out for internal testing in one hour." Chen Mo stood in the center of the office area, holding a printed release list in his hand. "Wang Hao, what's the status of the voice module?"
Wang Hao stood up, his movements somewhat stiff. He took off his glasses, rubbed his nose vigorously, and then spoke: "The prototype ran successfully, but... the efficiency is substandard. In a simulated 2G environment, the encoding time and file size exceeded the limits. If we go live in this state, a user sending a three-second voice message might have to wait five to eight seconds to successfully send it."
He paused, a suppressed weariness in his voice: "We've tried every known optimization path, but the complexity ceiling of traditional coding schemes is there. Unless—"
"Unless the audio quality is lowered," Zhou Botao said, appearing at the conference room doorway with a teacup in his hand, "lowered to the point where 'the words are just audible,' is that it?"
Wang Hao remained silent and nodded.
The atmosphere in the office was a bit heavy.
Lowering the audio quality standard means that Light's voice function will not be fundamentally different from that of WeChat—and may even be worse.
According to Li Ting, the voice module of WeChat has been in internal testing for two weeks, giving the programmers there more time to optimize it.
"Release version 0.8 first." Zhou Botao walked in and placed his teacup on the table. "The voice module, Wang Hao's team continues to work on it. Chen Mo, at 10 a.m. today, we will re-evaluate the plan."
He glanced at the countdown on the wall: Day 5.
"Ten more days." After saying this, he turned and went back to his office.
At 5:03 AM, version 0.8 was successfully pushed out.
There were no cheers, no celebrations. Most people just mechanically refreshed the data backend, watching the user activation curve begin to slowly climb, and then—slumped back onto their desks or leaned back in their chairs, closing their eyes.
When a string that has been taut for too long is suddenly released, it doesn't bring relief, but rather a deeper kind of weariness that seeps from the very bones.
Lin Shen did not sleep.
He went to the break room, filled a cup with warm water, and leaned against the window to drink it slowly. Outside, the Shenzhen sky was changing from deep black to a murky gray-blue, and the outlines of distant buildings were gradually becoming clearer. The early morning subway hadn't started running yet; the city was still asleep.
Footsteps sounded behind me.
Chen Mo walked over, poured himself a glass of water, and stood beside him. The two looked out the window in silence. After a long while, Chen Mo finally spoke: "Version 0.8, the two features you were responsible for, you did a good job."
"Thank you, Teacher Chen."
Another silence followed.
"The team is too stressed," Lin Shen suddenly said, his voice very soft. "It's not a matter of willpower, it's the rhythm. Continuous high-pressure sprints dull people's thinking and lead to repeating ineffective attempts—just like Wang Hao's team is doing now."
Chen Mo didn't look at him, but simply took a sip of water: "What suggestions do you have?"
"I don't know," Lin Shen said honestly. "But I think we might need a... mental break. The problem with the voice module might not be with the algorithm itself, but with how we're looking at it."
He paused, then seemed to remember something: "For example, the 'long press to speak' interaction."
Chen Mo turned his head to the side: "Hmm?"
"Currently, all competing products, including WeChat, require you to click a button to start recording and then click again to stop," Lin Shen gestured with his finger on the windowpane. "But on mobile devices, the most natural action for your finger is to 'press and hold.' Long press to speak—press and hold to start recording, release to send. It's more intuitive and also 'lighter.'"
Chen Mo thought for a few seconds: "Interactive design is Li Ting's area of expertise, but you can bring up this idea."
"What I'm worried about isn't the interaction," Lin Shen put down his cup, "it's the speech encoding itself. We've been stuck in the 'how to make low-bitrate speech sound clearer' trap for too long, but perhaps... clarity isn't the only standard."
He turned around and looked at the tired figures in the office area:
"When people hear audio, what they perceive first is not the sound quality, but the emotion. When a friend chokes up, you don't need to hear every single word to know they're sad; when a boss's tone is impatient, you can sense the pressure without them raising their voice. If we can't maintain 'clarity' at low bitrates, can we prioritize maintaining 'emotion'?"
Chen Mo frowned slightly: "How do you quantify emotions?"
"Speech rate variations, energy peaks, silence intervals, rhythm patterns..." Lin Shen said, "These features are much simpler than a complete sound spectrum. We can design an algorithm to prioritize the extraction and preservation of these emotional features during encoding, while the rest are aggressively compressed or even discarded. During decoding, we prioritize ensuring the accuracy of emotional transmission, even if sound quality is sacrificed."
He paused for a moment, then uttered the word that had been swirling in his mind for a long time:
"Emotional compression."
Chen Mo remained silent for a long time.
Outside the window, the sky had brightened a bit more, and the neon signs on the distant rooftops were beginning to go out; the city was awakening.
"This approach is very risky," Chen Mo finally said, "but if the traditional path is no longer viable... taking risks may be the only way."
He looked at Lin Shen: "How confident are you right now?"
"Technically, we're about 60-70% there," Lin Shen said frankly. "But the bigger problem is that the team needs to accept this completely different way of thinking. We're so tired right now that we just want to keep following the path we've already trod, even if that path leads to a cliff."
Chen Mo nodded. He drank the last sip of water, crushed the paper cup, and threw it into the trash can.
"The version evaluation meeting is at 10 a.m.," he said. "You should organize your thoughts on 'emotional compression' and present them at the meeting. It doesn't need to be too detailed, just explain the core logic."
He paused, then added:
"Also, find some time this afternoon to give a technical presentation to the team. The topic is up to you, but don't talk about specific code—talk about your mindset, how you view problems, and use those… 'crazy' metaphors."
Lin Shen was taken aback. He knew Chen Mo approved of him, but he didn't expect Chen Mo to push him into the team. It seemed that Chen Mo was also under a lot of pressure.
"You're right, the team needs some fresh air and to see a different world. Your unique way of thinking might open a window for them."
After he finished speaking, he turned and left the tea room.
Version evaluation meeting at 10:00 AM.
Wang Hao's team's report was brief but also somber: the traditional optimization path had reached its limit, and if they wanted to launch on time, the sound quality standards had to be significantly lowered.
After listening, Zhou Botao didn't immediately respond, but instead looked at Lin Shen: "Chen Mo said you have a new idea?"
Lin Shen stood up and walked to the whiteboard. He didn't write any formulas or draw any architecture diagrams; he simply drew a crude, undulating line with a marker.
"This is the waveform of human speech." He traced the line with the tip of his pen. "Traditional encoding tries to preserve every detail of this line, attempting to 'reproduce' it as much as possible at low bit rates. But we all know that under 2G networks and with the significant differentiation among mobile phones, this is impossible."
He looked at the dozen or so people present:
"So I was thinking, what if we abandon 'reproduction' and turn to 'communication'? When it comes to human hearing, emotion takes precedence over sound quality in speech. What if we designed an algorithm that prioritizes extracting emotional features during encoding—speech rate, rhythm, stress, silence—and then uses most of the bandwidth to protect these features, compressing the rest to the extreme, or even discarding them?"
He paused:
"In this way, the voice that users hear may not be 'clear' enough, but they can clearly feel the speaker's emotions—whether they are happy, anxious, hesitant, or calm. In the context of instant messaging, sometimes 'accurate emotion' is more important than 'clear wording'."
He put down his pen:
"I call this approach 'emotional compression'."
The meeting room was silent for a few seconds.
Then Wang Hao spoke first: "How is it technically implemented? How are emotional characteristics quantified? How do we determine which frequency bands correspond to emotions and which can be discarded?"
"Emotional features can be approximated by the rate of change of speech rate, the steepness of the energy envelope, and the distribution pattern of silence intervals," Lin Shen replied. "Priority coding can be achieved by assigning different quantization precisions to different features; I can write a prototype of the specific algorithm."
"To what extent has the sound quality been sacrificed?" Li Ting asked.
"At the same bitrate, the traditional solution might score 70 points in sound quality and 60 points in emotional expression accuracy. The emotional compression solution might only score 50 points in sound quality, but its emotional expression accuracy can reach over 85 points," Lin Shen said. "We need to test which one users find more acceptable."
Zhou Botao and Chen Mo exchanged a glance.
"Wang Hao," Zhou Botao said, "what do you think?"
Wang Hao remained silent for a long time, his fingers tapping unconsciously on the table, his eyes fixed on the simple wavy line on the whiteboard.
"...It's worth a try." He finally said, his voice a little hoarse, but also carrying the affirmation of an authority in speech code research. "The traditional approach has reached its ceiling. Although this idea is risky, it is at least a new path."
"Okay." Zhou Botao made the decision. "We'll work on two parallel lines. Wang Hao's team will continue to optimize the traditional approach as a backup. Lin Shen, you'll lead the development of the 'emotion compression' prototype. Wang Hao's team will assign two people to assist you. We need to see a testable version within two days."
He looked at everyone:
"Version 0.9 must be released on time, but what we can release is not 'better voice,' but 'different voice.' We want users to feel that Light's voice has emotions."
End of the meeting.
When Lin Shen returned to his workstation, Lu Chuan approached him, his eyes filled with curiosity and a hint of worry: "Brother Shen, is emotional compression... really going to work?"
"I don't know." Lin Shen opened the editor, "but if I don't try, it definitely won't work."
He started writing code.
This time, it wasn't those scattered ideas from before, but a complete and verifiable prototype framework. He wrote for three hours, during which two engineers sent by Wang Hao joined in. The three of them sat around a whiteboard, arguing, drawing, revising, and starting over.
The prototype framework was completed at 2 PM.
Lin Shen ran a test, and the results were rough but interesting: at the same low bitrate, the emotion compression solution generated a file size that was only 65% of the traditional solution, and the encoding time was reduced by 40%. Blind testing showed that the accuracy of emotion transmission was nearly 30 percentage points higher than the traditional solution—but the sound quality score was indeed lower.
"There are costs, but there are also benefits," Wang Hao said slowly, looking at the data. "And these benefits may be exactly what users need."
Chen Mo appeared behind them unnoticed. He looked at the data for a while, then said, "Continue to refine the prototype. Also—"
He looked at Lin Shen:
"The technical sharing session will focus on three points. Have you decided on the topics?"
Lin Shen thought for a moment.
He recalled the code he had written these past few days, the modules that were constantly iterated, modified, and maintained; he recalled the way everyone on the team would frown, scratch their heads, and then suddenly have a flash of inspiration while staring at the screen; he recalled those seemingly crazy metaphors that actually pierced the core of the problem.
"I've made up my mind," he said.
"What's your name?"
"How to Maintain Your Code Like a Pet"
Chen Mo paused for a moment, then—very slightly, almost imperceptibly—twitched the corner of his mouth.
"Okay. This one."
At 3 PM, in the small conference room on the 16th floor of Building C, Kexing Science Park.
Almost everyone in the Light project team who could spare the time came. More than twenty people were crammed into the not-so-spacious conference room. Some were holding coffee, some were holding laptops, and some were simply sitting on the floor—the first collective respite after continuous high-pressure development. The air still carried the bitter smell of staying up all night, but there was also a faint, almost expectant curiosity.
Lin Shen and the others were extremely curious about this newcomer who had just joined the team but was able to solve problems like crazy.
Chen Mo leaned against the door, while Zhou Botao sat in the last row. Four members of Wang Hao's team arrived, and Li Ting also put down her requirements document. Lu Chuan squeezed to the front, clutching a notebook, his eyes unusually bright.
Lin Shen stood in front of the whiteboard, holding only a marker, not a PowerPoint presentation.
He paused for a few seconds, then spoke:
"We're not talking about algorithms, architecture, or performance optimization today." His voice was calm, even a little soft. "Let's talk about something else—how to raise a pet."
A few suppressed laughs rang out in the conference room, but mostly there was bewilderment.
"I know what you're thinking." Lin Shen turned around and drew a crooked, simple sketch on the whiteboard that looked like a dog and a cat at the same time. "Writing code is like bringing a pet home. At first, it's clean, cute, and has a clear function—like when we just finished writing a module, all the tests passed, the documentation was complete, and it looked good no matter how we looked at it."
His pen tip wrote a line next to that "pet":
Phase 1: Understanding its habits
"Every pet has its own habits. Some dogs like to chew on slippers, and some cats do parkour at four in the morning. Code is the same." Lin Shen looked at Wang Hao's team. "Why does the speech coding module cause unexpected side effects every time the parameters are adjusted? Because its 'habit' is that it is extremely sensitive to the window length of the frequency domain transformation, but has a high tolerance for the quantization step size. It took you a week to figure this out."
Wang Hao nodded, his expression complex.
"Understanding habits requires observation, recording, and patience." Lin Shen underlined "habits," explaining, "It's not about rewriting every time a problem arises. Instead, it's about recording the code's behavior under different inputs, loads, and environments, just like recording a pet's diet, bowel movements, and emotional changes. This creates its 'health record.'"
Phase Two: Regular Feeding and Grooming
"Pets need to be fed, groomed, and bathed regularly. So does code." Lin Shen drew a food bowl and a comb. "What is 'feeding'? It's continuous nutritional input—that is, keeping dependencies updated, applying security patches, and keeping up with language features. What is 'grooming'? It's code review, static analysis, and those seemingly trivial daily maintenance tasks that can detect tangles early."
He paused:
"Many people feel that these things delay the development schedule. But just like if you don't groom your cat, when it's covered in fur and in pain, you'll need to spend ten times as long taking it to the vet—code is the same. If you neglect 'grooming' for a long time, and it gets coupled into a tangled mess, the cost of refactoring will be project delays."
Someone in the back row whispered in agreement.
Phase 3: What to do if it gets sick
Lin Shen drew a small red cross on the whiteboard.
"Pets get sick. So does code." His tone became more serious. "Bugs are the symptoms of code. But how do most people deal with them? When they see a pet has diarrhea, they immediately give it antidiarrheal medication—in code terms, they find the line that's causing the error, patch it, and make the symptoms disappear."
He looked around the conference room:
"But a good veterinarian will ask: What did it eat? When did this start? How is its condition? — A good engineer should also ask: Under what conditions was this bug triggered? What is the scope of its impact? Is it a data problem, a logic problem, or an architectural flaw?"
He pointed to his head:
"Treatment only addresses the symptoms, not the root cause; the disease will recur, and each time it will be more difficult to treat. Why is our current voice module optimization getting slower and slower? Because we keep 'stopping the diarrhea' without investigating what 'bad things' it ate."
Several engineers from Wang Hao's team instinctively sat up straight.
Phase Four: Training and Communication
"Pets need training. So does code." Lin Shen drew a frisbee and a dog. "Training isn't about taming, it's about establishing a communication channel. You teach a dog the 'sit' gesture, and it responds—you define a clear interface contract for your code, and it returns the expected result."
His pen tip touched the word "communication":
"But many people treat code like a slave, using rigid constraints and complex rules to 'control' it. And the result? The code becomes rigid and fragile, and every change feels like defusing a bomb. Good code should be like a well-trained partner—you know its boundaries, it understands your intentions, and you can collaborate to complete complex tasks."
He looked at Chen Mo and Zhou Botao:
"In Light's current codebase, how many are 'partners' and how many are 'slaves'?"
No one answered, but many people lowered their heads.
Phase Five: Accepting its Imperfections
Lin Shen drew a three-legged dog and wrote next to it: "Still able to run."
"There are no perfect pets. Some dogs are born with hip problems, and some cats are just timid. The same goes for code." His voice softened. "We always want to write 'perfect' code—no warnings, ultimate performance, unparalleled scalability. But the reality is, business changes, requirements change, and the technology stack changes. What was 'perfect' yesterday may be a bottleneck today."
He paused, then uttered the most important sentence:
"Maintaining code is not about maintaining an idealized illusion, but about maintaining a real, existing life with both strengths and weaknesses."
"The idea of 'emotion compression' in the voice module is essentially to accept its 'imperfections'—to accept the fact that it cannot maintain high-fidelity sound quality at low bitrates, and then ask: What can we preserve? The result is that we can preserve something more important: emotion."
The meeting room was quiet.
Phase Six: Companionship and Bonds
Lin Shen drew a heart at the end, enclosing all the previous simple sketches inside.
"What's the deepest feeling about owning a pet? It's the bond." His gaze swept over every tired but focused face in the room. "You know its every bark, and it knows your footsteps. Code is the same. When you truly 'maintain' it long enough, you'll know every hidden injury, every condition that causes it to 'act up'; it will respond to every careful adjustment you make."
He put down the marker:
"We are not maintaining a bunch of cold strings of characters. We are maintaining a 'living organism' made up of logic, data, and countless decisions. It has a history, a personality, a growth trajectory, and the possibility of aging and disease. And we are its caretakers, doctors, trainers, and its only companions."
He paused for a long time, then said:
"So, the next time you're frustrated by a piece of difficult code, try asking yourself this: If this were a pet, how would I treat it? Would I harshly scold or patiently observe it? Do I just want it to obey, or do I want to build a deeper understanding with it?"
That concludes the sharing session.
No one applauded, but the stagnant, weary atmosphere in the conference room seemed to be gently stirred by something.
Lu Chuan lowered his head and quickly wrote in his notebook:
"Code is like a pet. Habits, feeding, illness, training, imperfections, bonds. As Shen Ge said, we are not coders, we are zookeepers."
Wang Hao rubbed his face and whispered to his team member next to him, "He mentioned 'health records'... Shouldn't we create one for the voice module?"
Li Ting closed her notebook, looked at Lin Shen, and her eyes showed a hint of surprise.
Chen Mo straightened up from the doorway, walked to the whiteboard, and looked at the pile of childish sketches and profound metaphors. He stared at them for a long time, then turned to everyone and said:
"That concludes the sharing session. Back to work."
But he paused, then added:
"Bring your 'pets' and get to work."
The crowd began to disperse.
Lin Shen wiped away the drawing on the whiteboard. When he got to the heart, he paused for a moment, then wiped it away forcefully.
Outside the window, the afternoon sun slanted in, casting bright spots of light on the conference table.
Five days to go, 3:47 PM.
The code from the Light project team is still the same code.
But some people seem to look at them differently now.
When Lin Shen returned to his workstation, Wang Hao came over.
"The prototype of emotional compression," Wang Hao said, "we need a more detailed quantification scheme for emotional characteristics. Are you free tonight? Let's work on it together."
"Yes." Lin Shen nodded.
"Also..." Wang Hao hesitated for a moment, "How exactly do we create that 'health record'?"
Lin Shen thought for a moment: "Start by recording the context of each crash. Not just the stack trace, but also the input data, memory state, and thread status at that time. It's like when a pet is sick, you record its temperature, diet, and changes in symptoms."
Wang Hao nodded, said nothing, and turned to leave.
Lu Chuan leaned closer and whispered, "Brother Shen, when you were speaking just now, a few colleagues from the testing team in the back row were snickering—but after they finished laughing, they were all taking notes."
Lin Shen smiled but didn't reply.
He opened the editor and brought up the prototype code for emotion compression.
Those variables, those functions, those logical branches—now they seemed to have acquired some kind of vague "habits." He revised a few lines of comments to make them read more like descriptions of the personality traits of a living thing.
Light seems a little different now...
PNB