pic credit: https://www.askaboutgames.com/career-guide-becoming-a-game-coder/

How to be a professional coder 101

Jae Huang
4 min readApr 1, 2020

--

Rather than an official tutorial of becoming a professional coder, it’s more like a recap for my learning experience from the one-year-tobe programming job. In the coming sections, I am going to talk about what I have learned from all these projects I’ve worked on in this job, all are programming related. It will comes from the easiest but most essential to more professional but just good to have. I will explain the most essential notes and talk a little about the rest, like in what scenario I learned them.

Always write a descriptive code

It’s not just for work, it basically applies to all the code that ever exists. Imaging this, when you are writing a simple calculator, it has one number that shows on screen, and the other number is from user input. The second number will add to the first number and takes the next input and on. Which one of the naming style below is more intuitive? And this is only one function with two variables. How about when it grows to dozens of functions and hundreds of variable?

# naming style 1
a = int()
while True:
b = input(“Please enter a number”)
a = a + b
# naming style 2
original_num = int()
while True:
user_num = input(“Please enter a number”)
original_num = original_num + user_num

Always comment for the code

I get the feeling of when the muse comes along, just can’t help to write the code all the way down. But when it comes to wrapping up, always don’t forget to comment the code of what your idea. Otherwise, next time when you saw these precious code, maybe after months, you would cross finger for the muse comes again. Because you might not understand what you were thinking at the time.

Use object-oriented programming

Obviously, after descriptive naming and commenting, here comes OOP. I once don’t get the idea of OOP in college. I thought copy and paste is my best friend. Anytime I want to use a function again, I just copy and paste the code again to the place I want. For a one-time code, this might work, and if you are convinced that you wont need to debug and update it ever. But when you are working on a long term project. It will be a pain in the ass for you to maintain the code. For example, if you just want update a function, you will end up in changing however the times you did the copy and paste thing.

Although it all sound cliche in the previous section, after I learned a thousands times about those principle and getting to understand them, in the long term developing process, I started to truly feel the need for these rules. So I follow more and more on those rules and not just by textbooks or taught by professors, but because I need.

Ok, now it’s more related to my current work. But it will be great if you found anything that helps you. (And gotta admit I got lazy from here. So just so quick talk for the rest.)

  • Use version control
    I use git for my version control. With Pycharm, it’s quite easy to do commit. But it’s also easy to just use the git comment. So it more important about the idea of version than the tools.
  • Read large data with pandas chunk function
    I got a project that needs to read and do the data work to a large file(about 10GB). It’s not that big to use the big data tool, but not so small to read the file directly. So I learned online that I can read it chunk by chunk with pandas read_csv — chunksize. Setting up the chunksize to the rows number you want to read in one time, then do the data wrangling work in a for loop.
data = pd.read_csv("filename.csv", chunksize=300000)
for chunk in data:
# do your work like you normally do
  • Pack code as executable file for colleagues
    Sometimes I develop a program not only for myself, but for other colleagues. They might not have Python in their computer, and it also will be troublesome for them to run it in the tool they are not familiar with. So I learned online again to pack my code along with libraries as an executable file. I use Pyinstaller here. When it’s done, it will be just one click away for my colleagues to use.
# use in terminal
# I usually use -F to make it one file, otherwise there will be a bunch of folders and files
Pyinstaller -F main.py
  • Design user interface
    After I have an executable file, the next reasonable need is to make it visible. So, interface. I use tkinter package here. It has no fancy look. But since it’s only for internal use, we are more concern about doing the work right than cool.
  • Documenting my product
    Last but not least, documenting. As much as all the engineer hate to write it, it’s the most important thing that keep all those great work keep improving. I didn’t work on it until I have a couple major update on my program released to my colleagues. It’s reminds me what I did in every version, and letting my colleagues know what I add or update in the newest version.

Since I am working solo on those project, most of those things are not demanded, but when I am coding, I always feel ‘Why don’t I use a more maintainable and sustainable way to do it!’ So I am happy to learn a lot more skills to make my work easier in the future. And hope you guys feel the same way.

--

--

Jae Huang

Data Engineer with expertise in Python. Data enthusiast.