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

This Was The Thing That Made Steve Jobs So Great

Reference: TechGig.com John Sculley It's been nearly 4.5 years since Apple cofounder Steve Jobs passed away. But he remains a role model for many today - the gold standard of a tech visionary. One of the few men who could call himself Steve Jobs' boss, former Apple CEO John Sculley, talks about why in his new book, "Moonshot." "Steve was not an engineer - he just saw different things that people were working on and connected the dots between them," Sculley wrote in his new book, notes the New York Post. Sculley gave the example of how Jobs added calligraphy fonts to the Mac, which created a new market for the Mac as a way to do home-grown document publishing. "That was something no one was working on at the time," Sculley said. Obviously, it's not that easy to look at the world, see what's missing and deliver a high-quality product that fits the bill. Otherwise, we'd all be Steve Jobs. John Sculley/Michael Seto/Busines...

Do you require a dedicated system administrator?

Technology has evolved so has administrator. Days have gone when people were needed to sit in front of System to monitor or manage it. With growing orchestrations tools and system remote manage capabilities. We really don’t require someone to be deputed to do administration on site. We require people to manage the floors and handle physical issues rather than management issues. Outsourcing Administration and Management of Server assets not only give organization peace of mind but quality Engineers to take care of their infrastructure with excellence. Day has come to take a step ahead and take on board organization as System Administrators rather than Resource with limited knowledge.

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...