Bringing Inspiration To Those At Cocos
2022.07.18 by Luke
Interviews

The number of lines of code contributed in 8 years has exceeded 500,000. How can a programmer from operations and maintenance grow into the head of the Cocos editor?

As a veteran employee at Cocos, he’s had quite an adventure getting here. From a no-salary front-end internship, a green programmer, and now a technical lead. This transformation shows a lot of inspiration to those who come into the company fresh from university.

And even though he looks young, he is already a super dad with two kids. He is the spotlight of this article, Cocos editor technology lead, vsj.

Shyly smiles while working hard in front of the camera

No salary, just looking for a front-end internship

In 2012, vsj graduated college with a network management major. Like all graduates with this major, he started in the operations and maintenance department. Soon, he found he had no interest in this type of job. After careful consideration, he decided to give up operation and maintenance and moved to the front-end.

Without any front-end work experience, he bought a train ticket to Fuzhou and knocked on the door of Sina’s local offices.

"Hello! I don't want a salary. Can you allow me to work here!"

His look and determination moved the leaders at the time. He was set up as a front-end intern. But maybe after he studied too hard, perhaps due to his talent, he left the internship in less than three months.

After the internship, vsj joined Xiamen 4399 and engaged in the front-end development of web pages.

Office area on the fourth floor of 4399 where vsj worked

Graduates of the same age may have received better salary packages, but he was starting from scratch, so he was given a lot less.

" I was young and ignorant. I just had food to eat. "

Meeting leaders had me start my 8 years of Cocos

In those days, after work, vsj often participated in technology-sharing meetings in Xiamen. At a front-end technology dinner organized by Guiyi, the front-end group leader in Xiamen, vsj met his first Cocos member - now Cocos co-founder & CTO Lin Shun.

At that time, Lin Shun was looking for front-end technical experts worldwide, specializing in the group moderators of various technical forums in the front-end or asking them to help introduce him to one. At this dinner, Lin Shun met vsj for the first time.

"My first impression of vsj was that he has a very typical technical temperament, giving me a very cordial and trustworthy feeling. Although I chatted a lot with him then, he was still a little shy, but he communicated technical knowledge quite well. The problem was a big issue as he was interested in the engine after the conversation and was not afraid to challenge high-complexity front-end projects."

Such talents were the ones Lin Shun was looking for at that time. At the invitation of Lin Shun, vsj joined Cocos, and in the days to come, supported the core development of the Cocos editor.

Lin Shun is on the far left, vsj on the far right

Developers who are not familiar with this field may think that making an editor isn’t much work because there are a lot of editors on the Internet to try out. Most are built by a few people or even a person using other engines. But it is easy to pile up some features to meet their own needs. But to make a great editor, the more you add, the development difficulty will rise exponentially, especially when you need stability, continuous optimization iterations, and achieve production and commercialization.

"The editor contains a variety of operational code, with a huge amount of JS and TS, and the scripting language to work on. A little movement can easily cause various problems, so we have been racking our brains to find a way to balance development speed and stability."

When vsj first came to the company, the Cocos team was less than ten people. Now, the Cocos team is growing, and vsj has also grown from an entry-level engine research and development to the technical lead for the editor.

He laughed when I asked him, "Why don't you make a good front-end anymore and now work on the Cocos Creator editor?"

"What is a good front-end? Aren't we still doing front-end? The editor is more difficult. How can a serious web page stand up to what we have built? It's difficult, there is a lot of code, and it's more interesting to do."

One of the editor's most difficult parts is managing and maintaining a large amount of code, which is not even adding the engine itself. The engine function is updated very quickly, and so it’s a place where it quickly can become unstable.

Suppose the difficulty of the engine is the depth of technology. In that case, the editor's difficulty is in managing large projects, and it is difficult to maintain a large number of high-speed iteration modules (especially in JS) that stay stable and compatible.

"The editor is already doing whatever it takes to isolate modules. For example, everyone complains that they can't directly get the engine object for modification. I hope to obtain a relatively independent and stable operating environment, not a hodgepodge of objects put together.”

At the same time, the editor is also constantly exploring the web front-end field, such as WebComponent UI components, WeakRef management resources, etc., trying to use some new features to solve some complex problems. Another difficulty in editor development is extending the editor in an easy-to-use way. Now, this part is continuously being worked on.

"Because each developer has a different technical background, it is definitely meaningless to learn how to write the editor alone. So our follow-up ideas will be developing some UI frameworks by ourselves so that developers can participate more easily. On the one hand, it continues to simplify the current ipc call structure to reduce everyone's development burden."

Continuous evolution

In 2016, Cocos Creator 1.0 was officially released, and the editor was in charge of several members, including vsj.

Cocos Creator 1.0 editor interface

In 2021, Cocos Creator 3.0 was released with a new all-in-one editor, giving developers a more lightweight and easy-to-use development experience.

Cocos Creator new editor interface

"Actually, in the beginning, I just wanted to write a new editor framework for the 3D team at that time, but everyone found that this framework was easier to use than 2.x. So I followed the redesign, planned the entire editor's structure, and gradually integrated the essence into Cocos Creator."

There are few editor team members, and the 2.x editor must be maintained. The workload can be challenging. Jare, the product director of Cocos engine, also expressed high recognition of vsj's technical knowledge.

"Since 2018, vsj led the team to rewrite almost every line of code and built the new Cocos Creator 3D editor. It is not easy to complete a major revision. After continuous optimization, to 3.0 when it was released, it has far surpassed 2.x in terms of performance and experience, proving that it is still technically reliable."

“From the 2.x editor to the 3.x editor, although it was hard work, we did it very happily because of his work. During the development process, when we found a problem, he wanted to solve the problem. In the process of finding a solution to problems, he had lots of ideas."

In Cocos Creator 2.x, plugins were thrown into the engine and run directly, lacking design and specifications. In 3.x, the editor team has added a more powerful plugin mechanism. The plugin system is completely modularized and refers to vscode, allowing the plugins to be more standardized.

In addition, it also solves some of the interaction problems of 2.x. For example, in 2.x, there was a problem that messages were sent and not returned. The editor team has made an asynchronous message queue management. For developers, the new editor experience has dramatically improved.

Raising the technical vision of the engine team

The volume of 3D projects needing completion is much more significant by nature. From 2D to 3D, the challenges to the editor are even more significant, and the requirements for the technology stack are also increasing.

"When I first entered Cocos, I didn't understand rendering at all. I had a lot of fun learning 2D rendering, and then I learned the editor framework. These things are very challenging and interesting for me. "

"The idea is knowing, building, and getting good results, which is a very happy thing.”

vsj's pursuit of technical knowledge has also driven the entire team. Editor team members, including vsj, have been actively walking on the road of learning new technologies, which has raised the technical vision of the entire team.

vsj participates in the salon for technical sharing

"I used to be a web front-end, and the life cycle of web products was generally short, but at Cocos, I can continue to polish a product, and the experience feels great. "

Today, in addition to writing code, as the person in charge, it is also necessary to manage the team well. The professional side and management side must be worked on simultaneously. It's not always possible to focus on just writing code all the time. However, he also has his own way of allocating his time.

When performing tasks such as designing mechanisms and frameworks, he has to immerse himself in writing code. In contrast, when the process has been finalized, and he just needs to fill in the code, he can skillfully switch between sub screens in his brain, processing work messages while filling in the code.

In the past eight years, there will inevitably be differences of opinion on the project. Still, the extremely friendly discussion atmosphere of the engine group has allowed vsj to gain a lot of valuable experience.

"When there is a disagreement, there is a hot fight. This is the best opportunity to diss the boss publicly. " vsj said jokingly.

Team building near Guanyin Mountain

When I asked him about his experience facing failure, he said, "There is no absolute failure. It’s just a trial of a technical solution. There may indeed be some ideas and ideas that are not right, and that is not a setback. I just like a challenge."

"If the challenge fails repeatedly, do you still want to accept the challenge?" "I care more about the process, as long as the process is happy. "

The other side of the workaholic is a super dad

Today is the 3018th day that vsj joined Cocos. For more than eight years, he has been doing what he likes: being a ruthless code farmer.
In addition to career development, vsj completed two personal milestones at Cocos, getting married and having children.

Now that he has a pair of lovely children, he lives close to the company. After eating the loving breakfast cooked by my wife in the morning, he just has to go downstairs and wander to the company for a few minutes, which is just too cool.

The cutest overseer: let me see if my dad's code has bugs.

“It doesn't matter how you balance family and career. I make my favorite programming career during work hours and play with cute babies after getting off work. Both are my loves."

As a superior and a colleague for more than seven years, Jare concluded that vsj has several major labels: workaholic, learner, and a good job interviewer.”

From a green programmer, growing independently, to being an editor technology leader, this transformation is very inspirational.