For what purposes is Python used? Hernan Soulages, a pragmatic programmer. Data used by Python

If you are looking for an answer to the question: “Which programming language to choose first,” then in about 90% of all cases you will be offered Python - as the easiest language to learn. And it is obvious that a certain number of people who have not learned programming before will choose Python because of these recommendations. And here we have a problem, which will be discussed below. Of course, with a description of how I got to this life.

About Me

Even during my student years, I realized that my specialty was not as rosy as it seemed to me at 18 years old. So I started thinking about how to earn adequate money. And after listening to stories about how my cousin received crazy money at that time in 1C, I also decided to connect my life with IT.

Initially, these were template sites using website builders and WordPress, then I got involved in SEO, and at one point I came across Habr, after which I decided to become a full-fledged programmer. I didn’t have higher mathematics, so I decided to choose a field where it was not required - web development.

I had an obvious question: which language to choose - php/python/ruby. Having seen enough articles on Habré, I read some hate towards php after watching a couple of motivational videos from Yandex. I chose Python. I hope you know the advantages of language, so I won’t talk about it.

Primary language training

I combined language learning with my main job, so I read books, watched tutorials, and worked on small projects in the evening. In general, in a year I

1) Studied books:

  • Mark Lutz - Learning Python
  • Mark Lutz - Python Programming
  • Chad Fowler – Programmer Fanatic
  • Bill Lubanovich - Simple Python
2) Studied a lot of videos from Ukrainian/Bourgeois authors on Django
3) Completed a course from codeacademy
4) Mastered PyCharm

Your first project

Then I had the idea of ​​a small service on a very specific topic, which I decided to create in order to consolidate my knowledge of Python + Django.

In creating the site I

1) Studied books:

  • John Duckett - HTML and CSS. Website development and design
  • David Flanagan - JavaScript. Detailed Guide
  • Ben Forta - Learn SQL on your own.
2) I studied the Django documentation for my tasks
3) I studied the deployment of projects on Django Gunicorn + nginx + centOS

My first normal project

After the first adequate website failed, I decided to create something worthwhile, chose an idea, chose an implementation scheme, and completed it in the evenings in 3 months.

The project has shown its viability (to this day it brings me some money, which I am incredibly happy about). And I decided to pump it up better.

After reading the book “Percival H. - Test-Driven Development with Python,” I decided to write tests first based on Django components, then looked up the Selenium documentation, and already made external tests.

I want to be cool

Having opened vacancies for Python-Django developers, I looked at what else is usually required in such vacancies:
  • Django Rest Framework
  • Celery
  • Tornado/Twisted/asyncio (Choose one)
  • Class-based view Django
  • Angular/React (Choose one)
Spent 3 months getting to know/trying these things. I also picked up the Python standard library + external parsing library beautifulSoup.

You can't work without C/C++

There is an opinion that without knowledge of C/C++, a programmer cannot call himself a programmer. So when I had free time, I got acquainted with the books:
  • Brian Kernighan – C Programming Language
  • Stanley B Lippman - C++ programming language. Basic course
I read the books, tinkered with the code, looked at the compilation, looked at the code examples. In general, now I didn't big eyes when mentioning links, pointers, sorting, OOP and a bunch of different arrays with at different speeds processing an element depending on its position.

I'm ready to fight!

And here we come to the very important point. Having spent a total of 2 years learning all the elements of web programming that I mentioned above. I considered myself ready enough to apply for a position as a Python web developer. Of course, I didn’t know some things very well, some superficially, and some I didn’t know at all (for example, Flask), but the general understanding and skills were quite good.

And here the problems with Python began, which people most often do not focus on. Namely, on the business demand for junior/pre-middle level Python developers.

I entered the market with this question.

Although at first glance it seems that there are quite a lot of vacancies in Python, when the specifics begin, everything changes dramatically.

1. Immediately there is a large screening of vacancies where Python is exclusively an auxiliary language. Most often these are positions of Java developers, System Administrators,QA-Automation. Also, there is now a large dropout in Data Learning, which requires a math education + the R language. With Python alone you won’t be able to find this vacancy.

2. It turned out that in my city there are no vacancies for Python, literally none at all. Having expanded the search throughout the area, I also received an unsatisfactory result. A couple of vacancies in PHP, where Python was a plus. When I opened the filter for the last 3 years, I also discovered that there were no vacancies for Python at all. Those. businesses in the provinces most often choose simpler and more popular technologies than Python.

3. Having opened Python vacancies in a general search engine, I discovered the following trends:

  • 90%+ of vacancies are located in Moscow or St. Petersburg
  • 90%+ of vacancies require middle+ / senior level
  • ~100% vacancies for junior positions in Moscow or St. Petersburg (most often from giants)
In other words, the situation has turned out that if you do not live in Moscow, St. Petersburg and are not going to go to “conquer” them, then you have practically no place to get your first job.

Of course, there are a couple of places where Python is still used, for example, in Kazan. But most often this is one company, where the vacancies are also very middle+ / senior.

4. The option of searching for remote work at the current level also showed that employers are not ready to take such a risk. Little experience + remote work = this is some kind of fantasy.
Nevertheless, I was still able to find a couple of options, but already during the initial interview it became clear that this was nonsense like: “You work for us for three months, and if the client pays for your work, we will pay you too.” Not the best option.

5. I spoke with a couple of HR from large companies, they expressed this trend. “We usually hire people with at least a year of experience in Python, plus experience in another language (3+ years). Most often php/Java." In other words, they didn't consider hiring someone with just Python at all.

6. After talking with guys from specialized forums, it became clear that this is enough typical situation. From their stories, it became clear that people, after a futile search, either went to work on php/1c, or somehow climbed through upwork/own project/test automation.
But again, from case to case.

In general, it turned out that Python is excellent language, which allows you to create powerful projects. And it just so happens that their concentration is in the capitals. And since these are complex projects, then employees are required at the middle+ level. Is a person who has just learned Python ready to get such a vacancy? Difficult!

But there is another way!

IN currently in my city alone there are 24 vacancies for php various levels(ranging from small companies that need to maintain a current website, to e-commerce giants that offer serial expansion functionality). And about the same number of vacancies for 1C. And in about half of these vacancies they are ready to hire a person who at least knows something about programming. Most likely, these are not the most best places, but this is already the first job after which you will officially become an experienced programmer for HR.

So in the end

It turns out that you can learn the cool programming language Python and stay on the street. Or you can learn the “hated” php/1c and get a job. The quality of this work, of course, leaves many questions - but this is already experience.

As for me, in my conditions (not going to Moscow/St. Petersburg), I actually spent time learning a language that is now in demand exclusively in my own projects. I was unable to find work locally or remotely. Now I’m moving towards php, since it simply has work.

Therefore, if you do not live in Moscow, St. Petersburg, or are not a student at a technical university, then I would not advise you to teach Python first tongue. Pay attention to PHP - there are always places for it, there is work, there is experience. And the further path of development is already yours.

P.S. As my friend told me, the situation is almost the same in Ruby. But here I can no longer speak with confidence.

Sometimes I get various ideas for self-development. These are completely different thoughts about what I should master, what I should learn, what I should understand. And at one of these moments, I thought about learning programming. I started with Pascal language, relevant at that time, and now, having already studied about 3 languages, I began to think, is it worth learning Python?

From this article you will learn:

I, Gridin Semyon, welcome all readers of my blog kip-world. Have you been thinking about starting to learn programming for a long time? Maybe you are thinking about how to choose a programming language to begin with?

Or perhaps you're just afraid to start? Or are you just a person who accidentally stumbled upon my article? In any case, here you will find answers to some of your questions!

In any of the above cases, I want to ask you the most important question: What problems will you solve using this or that language?

I have compiled a small “micro-article” for you to think about.

Is it worth learning Python?

I think it’s no secret to anyone that literally 5-6 years ago, the first language to study programming in any school was Pascal. Pascal is a wonderful language of its era, but, unfortunately or fortunately, it has outlived its usefulness and is now the first programming language smart choice for every beginning programmer!

You may now be asking yourself, “Why is it worth learning Python as your first programming language?” There is no mystery in this, just as there is no riddle.

Benefits of the Python Programming Language

Firstly, it is important to know that given language programming is now in demand in many enterprises, especially in Moscow and St. Petersburg. So if you are lucky enough to live in these cities, then with this language you can look for a very interesting and highly paid job.

Secondly, This developing language programming, various changes occur every two to three years, and this is a very good indicator for a programming language.

Fourthly, many support scripting language programming. You can communicate with the outside world through external inputs and outputs.

Programmers simply adore this language for its brevity and simplicity of code. Where in JavaScript or C++ you will need to write two or three pages, in Python you can do it in just one!

And also very important feature Python language is that it is used for Web development. Moreover, it is not used as an ordinary language, but performs one of interesting features. Python for web development is used in cases where other languages ​​fail! This is a very interesting and curious fact. In this area, the language has its own, personal niche!

Let's summarize briefly:

  • Python is a complete and feature-rich programming language
  • This language is used in most various fields, including web programming
  • This is an ideal language to start your development as a programmer because it is clear and easy to use.
  • Is the favorite language of many professional programmers

And if anyone still has questions: “Is it worth learning Python?”, “Is this language suitable for beginners?”, “Having learned this language, will I be able to get a job?” Good work? My answer: “Definitely yes! Learn this language, regardless of whether you are a beginner programmer or an experienced one. It will definitely be useful to you and will help you in your activities!”

On this note, I have to say goodbye to you. Subscribe to my blog, tell your friends about it - there will be a lot of interesting and important information here!

P.S. Which language do you think is best to start with? Maybe someone gave you other advice? I would be very glad to have an outside opinion in the comments!

Python is a widely used, high-level programming language that was named after the famous British comedy television show " Monty Python's Flying Circus" The Python language is simple in structure, yet incredibly flexible and powerful. Considering that Python code Easy to read and without being too strict in its syntax, it is considered by many to be the best introductory programming language.

Python - description of the language given in Foundation describes Python:

Python is an interpreted, interactive, object-oriented programming language. It includes modules, exceptions, dynamic typing, high-level dynamic types data and classes. Python combines excellent performance with clear syntax. It provides interfaces to many system calls and libraries, as well as various window systems, and is extensible with C and C++. Python is used as an extension language for applications that need software interface. Finally, Python is a cross-platform language: it runs on many versions of Unix, Macs, and computers running MS-DOS, Windows, Windows NT, and OS/2.

Which programming language should you learn first?

You can start learning the Python programming language. To illustrate how Python differs from other introductory languages, think back to when you were a teenager.

Learn programming with using Python similar to driving your parents' minivan. Once you've driven it around a few times in a parking lot, you'll begin to understand how to handle the car.

Trying to learn programming using C ( or even assembler) it's like learning to drive by assembling your parents' minivan. You'll be stuck in a garage for years putting parts together, and by the time you have a full understanding of how the car works and are able to troubleshoot and predict future problems, you'll be burned out before you ever get behind the wheel.

Benefits of Python

Python is a universal language for beginners. You can automate workflows, create websites, and desktop applications and games using Python. By the way, the demand for Python developers ( PostgreSQL, OOP, Flask, Django) has grown dramatically over the past few years in companies such as Instagram, Reddit, Tumblr, YouTube and Pinterest.

High-level general purpose language

Python refers to high-level languages programming. Using it, you can create almost any type software. This versatility keeps you interested as you develop programs and solutions that target your interests rather than getting stuck in the weeds of a language worrying about its syntax.

Interpreted language

The Python programming language for beginners is interpreted, which means you don't need to know how to compile code. Since there is no compilation step, productivity increases and time for editing, testing and debugging is greatly reduced. Just download the IDE ( IDE), write your code and click “Run” ( Run).

Code readability is key

Python's simple, easy-to-learn syntax emphasizes readability and defines good style programming. With Python, you can express your concept in fewer lines of code. This language also forces you to think about program logic and algorithms. Because of this, it is often used as a scripting or integration language ( glue language) to link existing components together and write large volumes of easily readable and runnable code in short periods of time.

It's just fun

You can't name a programming language after Monty Python without having a sense of humor. Moreover, testing was carried out to compare the time required to write a simple script in various languages (Python, Java, C, J, BASIC):

...Python requires less time, fewer lines of code, and fewer concepts to achieve your goal... And to top it all off, Python programming is fun! Having fun and frequent success builds confidence and interest in students, who become better prepared to continue learning Python.

Translation of the article “Why Learn Python? "was prepared by the friendly project team.

Good bad

Is it worth learning the Python programming language? After all, you can often hear that this language is dying. Quora users discussed this issue and shared their opinions.

Bill Carven, SQL developer, consultant, trainer and author

Assembly language gives you a great opportunity to write compact, efficient, and project-optimized code. In code written in this language, which takes up only a few kilobytes, you can do amazing things. But the level of efficiency that can be achieved using assembly language does not justify extra work, the extra time and the skills it requires.

It is true that languages ​​rise and fall in popularity. Productivity is here the main task in programming, so new languages ​​are created from time to time that increase productivity for at least some types of work.

Most programmers today use higher-level languages ​​- they need to be more productive. Languages top level can compile to machine code(C or C++), or can be compiled into bytecode with an independent architecture and run in virtual machine(Java) or be processed (JavaScript, PHP, Ruby, Python, Perl, etc.).

It is a misconception that you need to learn assembly language because “it’s better than Python.” This is a stupid point of view based on outdated data.

Bill Poucher, Executive Director ICPC, software in the fields of energy, synthetic genetics, etc.

Learn Python. Provide yourself with programming experience. This language has its own elegance.

Learn C as a language for Unix machines. Understanding UNIX is relatively easy.

Learn MIX to understand Knuth.

Learn Java so you don't have to worry about working with others and also learn object-oriented programming.

Learn C++ so you can program in any style you want. Its strength is that it is a basic programming language. Its weakness is that in order to program in it you need to understand its style.

Learn LISP to strengthen your understanding of recursion.

Did I say that it’s not worth learning at least something? No. Because the only thing you have to do is train yourself to constant study anything, especially learning how problems can be solved.

Shiva Shinde, Python is easy to code but hard to read

The Python programming language is not dying; it is one of the fastest growing languages.

  1. It's easy to learn
  • On this moment 8 of the 10 best American programs for computer technology use this language (Philip Guo, CACM)
  • Python programs tend to have a minimum of templates that are commonly found in other programming languages. Therefore, you can use non-standard solutions to problems more often.
  • If you have programming experience, even if not in this language, then you will quickly master Python.

2. Full functionality

  • It's not just a language for statistics. Python has all the capabilities for data collection and cleaning, database and high-performance computing, and much more.
  • This is a common programming language with a huge amount built-in libraries. It is good for data and database management and for working with network programming. It's a thoughtful language with a huge amount of resources available.

3. Serious scientific data libraries

  • Python has significant scientific libraries with a huge amount of data to use.
  • The basis of these scientific libraries is the SciPy Ecosystem, which even hosts its own conferences.
  • Pandas and Matplotlib are components of SciPy. They provide excellent data on the most different topics, for example, machine learning, predictive analysis text and network analysis.

Hernan Soulages, pragmatic programmer

This language is quite popular, its importance is growing in academic circles. It's also true that the usefulness of a programming language depends on what you want to do with it.

I don't like PHP at all, but I'm not stupid enough to deny its versatility and power, and that it's an easy language to learn.
As for learning assembly language, this language directly depends on what processor you are working with.

If you know how to work with one, then you can definitely use it in your processor family for some time. But over time, they also undergo some changes. In this sense, it is the least durable family of languages.

Magnus Lychka, software developer and consultant in Gothenburg

Many users like Python. For some applications it will be too slow, and, for example, they will work faster with assembly language, but these applications will work just as quickly in C, despite the fact that code written in C will work on any platform.

Many startups became successful with Python, after which they had to rewrite some programs in Java, C++ or C. And if these startups started working with assembly language, then most likely they would have run out of funding long before their very fast but difficult to read code would be complete.

But when working with assembly language, you will have to deal not only with different architectures processor, but also with technical details that differ between operating systems.

For some time now, the thought has been swirling in my head about whether I should write a short note on the topic of why the Python programming language is worth learning, and moreover, creating software projects in it.

Some of you know that just recently I attended the largest event in the Python programming community - . All expenses were covered entirely by me without the involvement of sponsors or employers. Perhaps, to attend such an event, you need to have some emotional attachment to the subject, and this is true.

What is Python?

Python is a programming language general purpose, aimed primarily at increasing the productivity of the programmer himself, rather than the code he writes. In simple human language, you can write almost anything in Python (web/desktop applications, games, automation scripts, complex systems calculations, life support control systems and much, much more) without noticeable problems. Moreover, the barrier to entry is low, and the code is largely concise and understandable even to those who have never written in it. Due to the simplicity of the code, further maintenance of programs written in Python becomes easier and more enjoyable compared to Java or C++. And from a business point of view, this entails a reduction in costs and an increase in employee productivity.

To demonstrate brevity, let's look at the Python and Java code that opens a file and stores its contents in a variable:

File = open("file.txt") content = file.read()

Import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; public static void main(String args) throws IOException ( String content = new String(Files.readAllBytes(Paths.get("file.txt"))); )

The Java code uses an updated interface to work with the input/output system. The old way would look even worse :)

Who uses Python?

Even the most advanced programming language is worthless if no one cares about it. One of the components of the success of any technology is the community created around it. It is this that predetermines the future vector of development through joint efforts. The Python community is one of the strongest in the IT world. This is a complex, well-organized and constantly developing organism. In addition to hundreds of thousands of individual developers and small software companies, Python is supported by such IT giants as:

And many many others. Impressive, isn't it? As for large and popular projects written in Python, these are such monsters as:

  • YouTube (most code base entirely in Python)
  • The first version of the Google search spider was written in Python, and later, due to the extremely high load and speed requirements, was rewritten in C++.
  • Dropbox desktop client
  • Reddit
  • Instagram (500M Python users)
  • Bitbucket (Python 2.7 and Django 1.7.11)
  • EVE Online MMOPPG
  • Quora
  • Spotify
  • Critical PayPal services, processing up to 2 billion requests per day. You can find out more in the TalkPython podcast, episode #54
  • Mozilla Services
  • Popular service Pinterest ideas
  • Disqus comment service (I use it on this blog, the service is implemented in Django)
  • Domestic Facebook services(see poster in mine)
  • Mercurial version control system (until some time ago, Python developers used it in their work)
  • Wargaming services

and I'm sure there are many other interesting and popular applications, which I forgot to list here (welcome in the comments).

What does this mean? About many things. And the most important thing is that large corporations are not afraid to build their business around Python, they are confident that the technology will survive, and therefore they should not expect problems with finding specialists. Moreover, the variety of applications is also impressive, demonstrating the wide range of problems that Python solves masterfully.

In a note about the book "", I wrote that it was taken as a basis as educational material for an introductory programming course at MIT, computer language at that time the Lisp dialect was Scheme. Times are changing, now what is leading as a digital lingua franca...? That's right, Python. It is used as a reliable tool in such an amazing craft.

Disadvantages of Python

A reader unfamiliar with Python may have the impression that it is a panacea for all ills, a silver bullet and a cure for cancer. But not everything is so rosy and wonderful. Like everything, Python has a number of its own shortcomings, which can sometimes be critical and influence the choice not in favor of the snake.

Speed

One of the main disadvantages is its relatively low speed execution. Python is a fully dynamically typed language, automatic control memory. While at first glance this may seem like an advantage, when developing programs with increased efficiency requirements, Python can be significantly slower than its static brothers (C/C++, Java, Go). As for its dynamic counterparts (PHP, Ruby, JavaScript), things are much better here; Python in most cases executes code faster due to pre-compilation into bytecode and a significant part standard library, written in C. At conferences I had the opportunity to talk with guys from large companies like Wargaming, many of them have a trend of moving towards statics, and most often this is Go, Rust.

An interesting report about the speed and optimization of CPython (native implementation of the language in C) was read at PiterPy 2015 in St. Petersburg:

Dynamic Typing

For novice programmers, a dynamically typed programming language at first glance (and at the second and even at the third) may seem like an outlet, a heavenly pleasure, especially for those who have previously dealt with “statics”. But there is also back side moon. As the code base grows (and this is often an inevitable process in successful projects), follow the type passed on to a friend It can be very difficult for a data friend (and in the absence of clear documentation and tests, it is almost impossible), this is where problems arise when, for example, they try to call a method on None or access an attribute during code execution. To solve this kind of problem, dynamic languages ​​are overgrown with all sorts of crutches, whistles and tricks in the form of type annotations, mypy projects for static code analysis, and so on. This, in turn, puts a negative connotation on the aesthetic side of the code.

Due to language limitations, alternative implementations of interpreters appear: PyPy, Pyston, Jython, Cython and many others. Now the trend is clearly visible in this direction, for example, Pyston is being developed within the walls of the so-called. Mecca of Python programmers - Dropbox :)

Conclusion

Despite a number of problems historically inherent to Python, it continues to be a leading tool in a number of niches:

  • Web application development (here we have the undisputed leader in the form of Django).
  • Data analysis and machine learning (scipy, scikit-learn, pandas, numpy packages recognized by the global scientific community).
  • Introduction to programming (pygame, turtle are good at motivating children to start coding).
  • Rapid prototyping of ideas in business due to the abundance of ready-made libraries, a low barrier to entry into the language and high productivity of programmers writing in Python.
  • Writing scripts (scenarios) to automate tasks. Python comes by default with all distributions of unix-like systems and is an excellent replacement Bash in every sense.

I'm sure I forgot something else. In general, Python rules!

Links

  • Excellent report about GIL(Global Interpreter Lock). GIL is one of the serious bottlenecks in Python on the way to parallel programming.
  • Guido van Rossum's talk about type annotations at last year's PyCon US.
  • Raymond Hettinger at last year's PyCon read an excellent report on the topic of the pythonic approach to writing code, showing how to transform Java-like into Python-like code. Unconditional must watch.
  • Post in technical Instagram blog about how they handle workloads using Python and Django.
  • 10 Myths of Enterprise Python on the PayPal blog.