2021 is over. This year, Python language made another strong attack and finally won the title of language of the year. C language also successfully surpassed java to become the second place. Java declined slightly, but it still kept the top three
Here's a trend chart of TIOBE website, Zhenlou!
Next, let's look at these languages we love and hate through more detailed data~
Data acquisition
The data acquisition part needs to extract data by parsing variables in JavaScript code
def get_pl_data(name): name_lower = [i.lower() for i in name] for i in name_lower: print("Request ", i) if i == 'c#': i = 'csharp' url = 'https://www.tiobe.com/tiobe-index/' + i res = requests.get(url).text content = BeautifulSoup(res, "html.parser") js = content.find_all('script')[9].string src_text = js2xml.parse(js) src_tree = js2xml.pretty_print(src_text) data_tree = BeautifulSoup(src_tree, 'html.parser') array_list = data_tree.find_all('array') data_list = [] for array in array_list[3:]: array_data = array.find_all('number') data_list.append({'date': array_data[0]['value'] + '-' + array_data[1]['value'] + '-' + array_data[2]['value'], 'value': array_data[3]['value']}) save_data(i, data_list)
Of course, the list of the top 50 programming languages is obtained in advance, directly through pandas's read_html method can be easily obtained
def get_pl_list(): url = 'https://www.tiobe.com/tiobe-index/' pl_df = pd.read_html(url) top_20 = pl_df[0]['Programming Language.1'].values.tolist() bottom_30 = pl_df[1]['Programming Language'].values.tolist() return top_20 + bottom_30
Finally, save it to csv
with open('pl_data.csv', 'a+', encoding='utf-8') as f: f.write('name,value,date\n') for d in data: try: row = '{},{},{}'.format(name, d['value'], d['date']) f.write(row) f.write('\n') except: raise
If nothing unexpected happens, in a few minutes, we can get the data of programming languages in recent 20 years!
Overall ranking
Let's take a look at the overall ranking of major programming languages in 2021. In fact, it can be seen from the above town building curve, but it is not particularly intuitive. Let's turn it into a histogram
It can be seen that Python performed very strongly in this year. According to the statistics of TIOBE, its search share has become the first, and the language of the year is appropriate!
Java and C, the two big men in the language industry, have been in love and killed each other for many years. Until now, they have not completely distinguished themselves.
The Go language supported by Google seems to have slowed down the pace of progress. It ranks 13th, which is not in line with its status as a favorite of heaven.
For the world's first language PHP, in this era of the rise of micro services and the prevalence of front-end and back-end separation, living is the best!
Five language indexes
Let's take a look at the ranking trend of the top five languages on the list
1.Java 2021
Java in 2021 has a feeling of winning in stability. As the most ecological language, its powerful innovation ability ensures its position in the Jianghu. If you want to say that Java is the first language at the back end of the enterprise, it is definitely java!
2021 of 2.C
C in 2021 still has a good growth. Although it performed poorly in the two months at the end of the year, it is enough to ensure the second position. I believe that this "ancient" language is still a force that can not be ignored in the future!
3.Python 2021
With the rise of artificial intelligence, Python has become a big fire. However, in 2021, this momentum has not weakened. With the characteristics of simplicity, easy to understand and smooth learning curve, Python has become the preferred language for more people.
4. 2021 of C + +
The performance of C + + this year seems not very good. Of course, it is still the leader in the embedded field. At the same time, as a superset of C language, it has a bright future.
5. 2021 of C #
C # has a very good growth in this year and has a tendency to surpass C + +. It is estimated that this is closely related to Microsoft's gradual embrace of open source. After all, Microsoft is now the largest open source organization on GitHub!
If it were you, which language would you choose to learn? If I were you, I would choose Python. After all, there is no language as concise and easy to learn as Python.
Zero experience, zero foundation, how to learn technology?
It's good to learn Python well, whether in employment or sideline, but to learn python, you still need to have a learning plan. Finally, let's share a full set of Python learning materials to help those who want to learn Python!
1, Python learning routes in all directions
All directions of Python is to sort out the commonly used technical points of Python and form a summary of knowledge points in various fields. Its purpose is that you can find corresponding learning resources according to the above knowledge points to ensure that you learn more comprehensively.
2, Python essential development tools
If a worker wants to do well, he must sharpen his tools first. The development software commonly used to learn Python is here, which saves you a lot of time.
3, Python learning video
When we watch videos, we can't just move our eyes and brain without hands. The more scientific learning method is to use them after understanding. At this time, the hand training project is very suitable.
4, Actual combat cases
Learning python is the same as learning mathematics. You can't just read books without doing problems. Looking directly at the steps and answers will make people mistakenly think they have mastered them all, but they will still be at a loss when they encounter new problems.
Therefore, in the process of learning python, you must remember to move more handwritten code. You only need to read the tutorial once or twice.
5, Real interview questions for large factories
We must learn Python in order to find a high paying job. The following interview questions are the latest interview materials from front-line Internet manufacturers such as Ali, Tencent and byte, and Ali has given authoritative answers. After brushing this set of interview materials, I believe everyone can find a satisfactory job.
This complete set of Python learning materials has been uploaded to CSDN official website. Friends can scan the official authentication QR code of CSDN below via wechat for free [100% free guaranteed].