Skip to main content

A Developers Guide To The Pros And Cons Of Python

From: Techgig.com

Python is billed by the Python Software Foundation as being easy to learn and running everywhere. It's useful for a range of application types, including Web development, scientific computing, and education. Google and Instagram have been among the many users of Python, and the language scores well in popularity indexes.

But Python has had its issues, with questions raised about its performance and design quirks. To get to the bottom of what's right -- and maybe not so right -- about Python, InfoWorld Editor at Large Paul Krill asked dignitaries in the Python community for their input.

Python pros

Read it, use it with ease. "The main characteristics of a Python program is that it is easy to read," says Pierre Carbonnelle, a Python programmer and blogger who runs the PyPL language index. "This has benefits to you and to others. It helps you think more clearly when writing programs, and it helps the others who will maintain or enhance your program. In both cases, it requires less effort to write a Python program than to write one in another language like C++ or Java." Readability of Python facilitates open source development, Carbonnelle added.

Python is easy to use and extremely popular in academia, creating a large talent pool, says Sumit Chachra, CTO at Tivix, a software consulting firm that specializes in Python/Django development. Django and Python are leveraged by Tivix in Web and mobile development, he says.

Python is a very productive way to write code, says Stephen Deibel, of Wingware, which makes the Wing Python IDE. "Some of this comes from the simple syntax and readability -- there is virtually no 'boilerplate' at all. Some of it comes from the rich, well-designed built-ins and standard library and the availability of many third-party open source libraries and modules." By being easy to understand, the code is easier to maintain, he adds.

Python, says Chachra, is dynamically typed and flexible, with code that is less verbose. However, he cites dynamic typing as a potential negative (see below).

Internet of things opportunities. Python may become popular for the Internet of things, as new platforms such as Raspberry Pi are based on it, Carbonnelle says. Raspberry Pi's documentation cites the language as "a wonderful and powerful programming language that's easy to use (easy to read and write) and with Raspberry Pi lets you connect your project to the real world."

Asynchronous coding benefits. Python, Deibel says, "is great for writing asynchronous code, which rather than threading uses a single event loop to do work in small units." This code, he says, is often easier to write and maintain without confusing resource contention, deadlocks, etc. "Python's generators are a great way to interleave running many processing loops in this approach."

Multiparadigm approach bests Java. Python's programming approach is not as limited as Java's, Carbonnelle says. "For example, you don't need to create an OO class to print 'Hello world' in Python -- you have to in Java." Unlike Java, Python is multiparadigm and supports OO, procedural, and functional programming styles, he says. (Java recently added functional capabilities in Java 8.)

"In Python, everything is an object," says Brian Curtin, a member of the Python Software Foundation board of directors and a core contributor to CPython. "It's possible to write applications in Python using several programming paradigms, but it does make for writing very clear and understandable object-oriented code."

Python's cons

Speed can be an issue. "Because it is an interpreted language, it is often many times slower than compiled languages," Curtin says. "However, it comes back to separating the language from the runtime. Certain benchmarks of Python code run under PyPy run faster than the equivalent C code or others."

"A possible disadvantage of Python is its slow speed of execution," says Carbonnelle. But many Python packages have been optimized over the years and execute at C speed, he says. Performance, Chachra says, "is slower compared to older languages such as C/C++ and even newer ones such as Go." Absence from mobile computing and browsers. "Python is present on many server and desktop platforms, but it is weak in mobile computing; very few smartphone applications are developed with Python," says Carbonnelle. "It is also rarely seen on the client side of a Web application."

Python isn't in Web browsers, Deibel notes. "That's a real shame. There is brython, but I don't think it's real-world usable." Python is hard to secure, and that's why it is not in browsers, he adds. "There still isn't really a good secure sandbox/jail for Python, and I think it's considered basically impossible for CPython (the standard implementation).

Design restrictions. Python devotees cited several issues with the design of the language. Because the language is dynamically typed, it requires more testing and has errors that only show up at runtime, Chachra says.

Python's global interpreter lock, meanwhile, means only one thread can access Python internals at a time, Deibel says. "This may be less important these days, since you can so easily spawn tasks out to separate processes using the multiprocessing module, or write asynchronous code instead."

Curtin says there are a few conventions around the use of Python, but significant whitespace is one that is enforced by the interpreter. "The structure of Python programs must be consistent, so where brackets or other identifiers allow the user more freedom in other languages, indentation is what matters when it comes to Python."


Comments

Popular posts from this blog

Microsoft Ends Support for Windows 10 Version 1803, Users Advised to Update Now to Get New Features

Microsoft has announced that the company will no provide updates to PCs running Windows 10 version 1809 (aka October 2018 Update) as it will no longer support the outdated operating system. Originally, support for the Windows 10 version 1809 was supposed to end early this year; however, it was delayed to the COVID-19 pandemic, therefore giving more time to users and IT professional to update their systems. As a result, users with Windows 10 Home or Pro editions of Windows 10 version 1809 will not receive monthly security and quality updates containing protections from the latest security threats. To update to latest Windows OS, users can head to Settings > Update & Security > Windows Update. Although several users are likely using the Windows 10 version 1909 as Microsoft started rolling out the automatic update last December, the newer version might be unavailable to those who turned off automatic updates. Typically, Microsoft brings new features for Windows 10 versions fo

Google announces new career certificates for tech job-seekers

Google launched three-course certifications to help job seekers and professionals. It is to enhance their skills and help them grow in major fields.  Google has launched three major certification courses for job seekers to help enhance their career in the technology domain. The flexible online training will help job seekers to polish their skills in their high-growth fields and track jobs.  The courses will target the major fields such as User Experience Design (UX), Project Management, Data Analytics, IT support, and Android Development. This is a way to expand the employer consortium, get job seekers enrolled with the latest certifications, and introduce new tools to improve the job search.  CEO of Google and Alphabet, Sundar Pichai, announced the new Associate Android Developer certification that will help in Android development for entry-level jobs. It is predicted that by 2025, the US market will open up to 1.3 million jobs.  Here are the Google Career Certificates that users can

10 tips for protecting your most important data

From: Techgig.com For many modern businesses, their data is their most valuable asset. However, these days it seems every morning brings news of another high profile data breach. Sadly hackers are becoming more sophisticated and more determined than ever before, but this doesn’t mean businesses can’t take steps to protect themselves. Just a few considerations regarding security processes can be enough to ensure would-be hackers move on to an easier target. Here are ten tips which can help individuals and businesses of all shapes and sizes better protect personal data, financial information and privacy. Keep your operating system and all software up to date. This is a tip you’ll hear time and time again from security professionals. Those pesky OS and computer software updates are not only important from a functionality standpoint, but they more often than not contain critical security updates and vulnerability patches. Where possible, enable automatic software updates to