The debate over the merits of language is an eternal topic, and sometimes a accidental “clash” may even lead to a “war” between hardcore fans.

I am often asked, “Lao Liu, which is better, Java or Python? Which language should I learn?”

I was also very embarrassed and had to say:

Python is great for getting started, it looks simple, it’s great for startup teams, it’s quick to develop, quick to go live, quick to iterate. Perfect for special forces raids. Once you get to a certain size, the disadvantages of dynamic languages start to show up. It’s hard to maintain/refactor, especially since I think code written in dynamic languages tends to decay faster than static Java.

As for Java, its syntax is wordy compared with Python, and its expression power is weaker. It is developed in a strict way and has many specifications, which is suitable for large-scale coordinated operations of group armies. There are many well-known frameworks and libraries with good performance and a stable and mature system that is an excellent choice for developing large systems.

“Lao Liu,” he said, “you are playing with mud. What should I learn?”

I said, “You should focus on common problems that have nothing to do with Java, nothing to do with Python, that reflect how good a programmer is.”

If you use ehCache, memcached, redis and other open source systems, it is too heavy. The manager asks you to write a new one, which supports (key,value) storage, sets the expiration time, and automatically deletes the expired ones. Can you quickly implement a high quality version?

This involves knowledge of data structures and algorithms, as well as threads, with little relevance to the specific language.

For example, given a requirement, can you find the “concept” and design the class? Can you encapsulate and hide information, define good interfaces, and let each class have a single and accurate responsibility?

Classes are available in Python, and classes are available in Java, but none of this is language-specific. What you need to do is take your experience, do a mental exercise in your head, and then use some language tool to express them.

Some “concepts” are easy to discover, while some “concepts” have no direct correspondence with reality and need to be abstracted to find out, which tests the ability of abstraction.

Some people may say that our Web development is “database oriented” programming, are based on the database to add, delete, change and check, do not use these things you said. So if the manager gives you a project requirement, let you complete the design of the table structure to facilitate the subsequent program development, but also to consider the flexibility and scalability, can you do it?

If you find repetitive code in programming, can you find a concept (perhaps eventually expressed by a class or function) that represents this repetitive pattern, thereby greatly eliminating repetitive code?

Can you tell the difference between what’s constant and what’s changing, and tell them apart, “Find the change and encapsulate the change.”

At the end of the day, it’s essentially that abstract ability, and there are so many examples that I won’t list them all here.

To evolve and grow as a programmer, it is impossible to keep adding, deleting, and reviewing, and to keep arguing over the features of a programming language.

For technical people, there will come a time when they need to look beyond programming languages and work on design and architecture, stop arguing and start learning.


The original article was published on November 26, 2018

Author: Liu Xin

This article is from the cloud community partner “Web Project Hub”. For more information, visit “Web Project Hub”.