Beginning Programming with Python For Dummies
Book image
Explore Book Buy On Amazon
You might be a nonprogrammer or a developer who isn't interested in learning some new arcane method of writing code. If so, Python is the a great language for you. Most programming languages use just one coding style, which reduces flexibility for the programmer. Python is different, though. You can use a number of coding styles with it to achieve differing effects. Among the various Python coding styles, here are the four commonly used:
  • Functional: Every statement is a kind of math equation. This style lends itself well to use in parallel processing activities. Academics and data scientists tend to use this coding style regularly. However, nothing stops you from using it even if you don't fall into one of these groups.
  • Imperative: Computations occur as changes to program state. This style is most used for manipulating data structures. Scientists of all sorts rely on this programming style because it demonstrates processes so clearly.
  • Object-oriented: This is the style commonly used with other languages to simplify the coding environment by using objects to model the real world. Python doesn't fully implement this coding style because it doesn't support features like data hiding, but you can still use this approach to a significant degree. This is the style that most developers use, but other groups can use it when creating more complicated applications.
  • Procedural: Most people begin learning a language by using procedural code, where tasks proceed a step at a time. This style is most used for iteration, sequencing, selection, and modularization. It's the simplest form of coding you can use. Nonprogrammers love this style because it's the least complicated way to achieve smaller, experimental tasks.

About This Article

This article is from the book:

About the book author:

John Paul Mueller is a freelance author and technical editor with more than 107 books and 600 articles to his credit. His subjects range from networking and artificial intelligence to database management and heads-down programming. He also consults and writes certification exams. Visit his website at http://www.johnmuellerbooks.com/.

This article can be found in the category: