开源日报 每天推荐一个 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/