開源日報 每天推薦一個 GitHub 優質開源項目和一篇精選英文科技或編程文章原文,堅持閱讀《開源日報》,保持每日學習的好習慣。
今日推薦開源項目:《廣範圍表格 react-window》
今日推薦英文原文:《Simple but important lessons I followed when I started my career》

今日推薦開源項目:《廣範圍表格 react-window》傳送門:GitHub鏈接
推薦理由:如果你需要往你的頁面上放一個很大的表格(裡面可能有幾百個單元格),那你可能會需要一些庫來幫助你,使用了 React 的同學可能會找到 react-virtualized,不過今天的主角是它的簡化版——專註於減小體積,使 API 對於新手來說更友好,如果你能夠使用這個庫就解決問題的話,興許沒有必要去加入一個更大的包了。
今日推薦英文原文:《Simple but important lessons I followed when I started my career》作者:Najmath Ummer
原文鏈接:https://medium.com/@najmathummer/simple-but-important-lessons-which-i-followed-when-i-started-my-career-a20f3ca94391
推薦理由:作者總結出的除了寫代碼之外需要知道的一些工作中的重點

Simple but important lessons I followed when I started my career

Now it has been eight months since I started my career at Perleybrook Labs as a software engineer. My perspective about my work and field has changed a lot after I joined the workforce. Thinking back, I really wish I knew all these lessons back during my college days. Actually, I knew some of them. No. I knew most of them But I didn』t really understand the necessity of making them into practice.

I valued output more than anything. I delegated documentation to my other teammates. And I called myself a duct-tape coder!

Before joining the firm, my CTO Melson Zacharias gave me a home assignment to read up on some material. I went through the links eagerly to introduce myself to some new technologies. That』s when I got confused.
I was like, seriously?!
The material I read involved writing conventions like PEP 8, the zen of python etc. I just went through it and joined the firm. Everyone in the company told me about formatting, efficiency, documenting, variable naming and stuff. But I was mainly focusing on learning new technologies.

One day I had a chat with my colleague Sleeba Paul. He went through my GitHub repositories and asked me to explain my commit messages. He also asked me to explain programs which I wrote a long time ago. I couldn』t answer, not at one glance of the code.

He then told me a quote, which intrigued me a lot.

A piece of code shows the coder』s character.

Long story short, what are the lessons which are very important other than output?

Code Formatting

Except for the tabs which are compulsory in python, I was hesitant to format my code. To understand what I wrote I had to make it readable. But practicing 「readability counts」 was not easy for me until I learned and read code written by my colleagues.

Documenting

I always thought this was an unnecessary step in the world of coding. At college, I always skipped this part. But later on, when I went back and went through my older projects (written years ago), I understood the necessity. I myself couldn』t quite get the context at many places!

Basic writing skill plays a vital role in your programming. Code has to be well documented in order to convey what you wrote to others. And also to you after a break. This will help in making your projects maintainable.

Naming and Naming conventions

This was the most difficult one for me. Earlier, my variable naming was downright awful. Most of the variable/function/file names were single alphabets like a, b, c, x, y, z and sometimes a1,a2 etc.

Variable names, function names, class names, etc. should clearly specify what exactly they are for. And naming conventions for each language have to be followed. Period. Yeah, now my home assignments sound quite meaningful.

Commit messages

Each commit message should indicate what you have done in that commit. I was given an article that says how to write a commit message properly. A must-read.
Why would anyone follow this stuff?
If writing code was only meant to tell computers to do things, zeroes and ones would have been the best. But it is much more than that. What if you left your company or current project team and some other developer has to work on your project? What if a change has to be made in your code? Code is read much more often than it is written. So readability counts. A device without a user manual is near useless!!

These are some few simple lessons which I strongly recommend everyone to follow. Of course, even now my code is not perfect. Nevertheless, my coding style has come a long way. Coding is not like a factory, producing lots of output. It is an art which has some discipline. So next time, write code keeping in mind that your persona will be reflected through your code.
下載開源日報APP:https://openingsource.org/2579/
加入我們:https://openingsource.org/about/join/
關注我們:https://openingsource.org/about/love/