Summary -
In this topic, we described about the below sections -
When choosing a language for a development project, the language can be decided based on the tasks that can be done by the language. Below are the list of advantages and disadvantages that are used in decision making to use Python as a programming language for development.
Python features discussed in the previous chapter covers most of the advantages. Once again reiterate them to understand the advantages -
Advantages -
- Simple and Easy - Python is a simple language and it is very thin in the coding prospective. Reading a python program feels like reading the code in English terms. This nature allows us to concentrate on solution rather than the language itself.
- Easy to learn - Python is easy to learn and understand as it has simple syntaxes that represents the English.
- Easy to code - Python language is extremely easy to code and anyone can understand the code easily by reading it. Python is a developer friendly language.
- Readable - Python is a very readable language because of its syntax.
- Object-oriented - Python supports procedure-oriented programming and object-oriented programming. Programs built around object the merges data and functionality in object-oriented programming. Python has a easiest way of doing OOP especially when compared to other languages like C++ and Java.
- Free and Open Source - Python is a FLOSS (Free/Libra and Open Source Software) open source programming language. Means, we can freely circulate this software copies, read its source code, make changes to it and use it new program. This is the reason behind the improving the Python by the community.
- Less Coding – Python requires very less coding when compared to other programming languages to complete a simple task. It has a huge library that performs various tasks.
- Portable – Python is portable to many platforms due to its open-source nature. All python can work on any platform without any changes to the existing program.
- Interpreted - Python does not require compilation to binary like other languages C, C++. The program directly runs from the source code. Python converts the source code into an intermediate from called bytecodes, translates bytecodes into native language and runs it. This process makes the Python makes much easier and we do not need to worry about compiling program and load libraries etc. We just need to make sure proper libraries are linked and loaded.
- Extensive Libraries - Python has huge standard Library. It helps to do various things involving regular expressions, documentation generation, unit testing, threading, databases, web browsers, CGI, ftp, email, XML, XML-RPC, HTML, WAV files, cryptography, GUI, Tk, and other system-dependent stuff. This is called the 'Batteries Included' philosophy of Python.
- Extensible - Python is an extensible language to other languages. Python supports using other programming languages like C or C++ code to call python code. This requires when we want to run some critical piece of code extremely fast or some algorithm not to open.
- Embeddable - We can embed Python within C/C++ programs to give 'scripting' capabilities for program's users.
- Automatic memory management - Python supports automatic memory management which means, the memory is cleared and released automatically. We do not have to worry about clearing the memory.
- Improved productivity - The extensive libraries make programmers more productive than other languages like Java and C++ do.
- Speedy – Python language also called “Ready-to-run” language as it directly executes from code without compilation.
- Enterprise Application integration - Python works on different platforms like Raspberry Pi, Linux, Windows, Mac, etc. This makes python as a portable language and cross platform language.
Disadvantages -
- Speed limitations – Python execution results are a bit slow as the code executed line by line.
- Large memory consumption – Python is not suitable to use under the limited memory restrictions. Python structures need more memory space.
- Not suitable for Mobile – Python is designed as server-side scripting language and very rarely used at the client-side. And, also very rarely used in mobile based applications.
- Design restrictions – Python is “dynamic-typed” language as it does not require a variable to be declared before using it. The programmer job is easier with this however it may cause run time errors due to invalid data movements.
- Weak database access layers – Database layers are less comparative when compared with standard database layers ODBC and JDBC.
- Error detection codes – Python executed through an interpreter instead of a compiler. So, the errors and bug cannot be detected during the program execution. Developer should have code an exception handling for catching the errors.
- Difficult to test – All the errors are caught during the runtime including syntax errors. We need to clear up all the errors to get the output. So testing is a bit difficult in Python specially when integrated with other systems.