"Is That Really All It Takes?
— Three Surprising Points for Experienced Programmers Encountering Python"

My career as an engineer began with COBOL85 and Assembly. After a long hiatus of 15 years, I returned to the IT industry and focused on streamlining operations using Excel VBA to make tasks "easy." However, as times changed, my workplace eventually prohibited the use of VBA and shifted toward recommending RPA.
Yet, upon implementing RPA, I was confronted with a harsh reality: the accuracy of the OCR actions was extremely low. Frequent recognition errors meant the results were far from ideal. This led me to a question: "Could I develop my own AI-OCR?" Discovering that Python was the key to this solution, I have once again stepped back into the world of coding.
Having experience with legacy languages and VBA, I would like to share three specific points that moved me when I first ran Python.
1. The Unique Syntax of the range Function: The "+1" Rule
The first thing that surprised me was how to write the range() function when I wanted to loop a specific number of times. To repeat a process from 1 to 10, one's intuition suggests writing (1, 10), but in Python, you must write range(1, 11), adding "1" to the ending value. While the rule of ending "before the specified value" was initially confusing, I eventually began to see the logic of the subtraction: "11 - 1 = 10 times."
2. The Shock of No "End" Statements: Structure Defined by Constraints
Python lacks the END keywords found in COBOL and VBA, as well as the curly braces { } used in other languages to define the end of a process. Instead, the code structure is determined by indentation and the number of spaces. At first, I felt uneasy, wondering, "Will this really work?" However, thanks to this rule, the code is forced into a readable and organized format regardless of who writes it. This decisiveness was truly surprising.
3. The Speed of Replacing Loops with the sum Function
Consider the task of "adding numbers from 1 to 10." Normally, one would imagine code that iterates through a for loop to increment a variable. In Python, however, this is completed in a single line: sum(range(1, 11)). I am convinced that this speed—focusing not on "how to process" but on "what you want to achieve"—will be a powerful weapon in pursuing automation and AI development.
Conclusion
Considering where I started with Assembly, the brevity of this language is incredible. Although I began learning Python to overcome the barrier of low OCR accuracy, the inherent rationality of the language has reignited my own motivation.

Comments