You Can't Learn Any Language in 15 Minutes
Last week I wrote the post Learn Python in 15 Minutes. The point of that post was to demonstrate that the basic fundamentals of the Python language are simple and easy to learn. However I will be the first to admit that you cannot learn any language in 15 minutes. You won't be anywhere near proficient at least.
Working in a particular language consists of much more than the language's syntax. Part of being fluent in a programming language consists of being familiar with certain things such as string manipulation, collections handling, familiarity with the supporting framework and libraries and available third party frameworks.
Anytime you learn a new language and you are already proficient with a different language, the question that always comes up is "I can do X thing in language Y, how do I do that in language Z?". This is similar to knowing a real language but unfamiliar with the nuances of a different culture. Don't believe me? Put someone from littletown USA and drop them off in New York City to fend for themselves. It will be a journey full of learning experiences.
Just this week I got lost in Python land. I ran into a few issues with, what should be simple, string manipulation.
I was trying to check a string for certain subvalue. The program that I was working on fetched the HTML from http://www.theverge.com and extracted all anchor tags and checked the links to see if they contained the substring "theverge.com". If they did, I added them to my list of strings so that I could later do something with them. The problem was that I didn't know how to check for a substring in Python.
In C# you can simply use the .IndexOf() or .Contains method of a string. Python is different. I researched the issue and within a minute or two I had my answer. You simply run the line
if "foo" in bar:
That's the way you check a string for a substring in Python. However, 20-30 minutes later and my code still didn't seem to work correctly. I later found out that the value I was working was a dictionary and not a string. I had assumed that I was getting a string from the API I was using.
I tried several things to check for a substring. I tried the .find method of string but that didn't work either. It wasn't until it dawned on me that I may not be working with a string after all. Once I figured out that I was working with a dictionary it was easy enough to correct my error.
I questioned the functionality of way strings work in Python. Was I working with a version that didn't accept that syntax? Was my string null and misbehaving? Point is that if I was fluent in Python I would've recognized the issue and resolved it much faster than the 20-30 minutes that it took me.
So... no, you really can't learn and be proficient in any language in 15 minutes. The only way you can do that is study, practice, practice, rinse and repeat. There is no other way around it.
What do you think you need to be considered proficient in your programming language? Please comment below and be sure to sign up for more posts like this one by entering your email below. You can also follow me on Twitter @fernandozamoraj.
Comments