Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

procedural vs object oriented

Not much on procedural programming languages on here, how come?

1 Answer

Largely because procedural-focused languages (procedural and OOP are more methodologies than specific languages, though some languages fit certain styles better) tend to have major issues at scale and with growing teams ("too many cooks in the kichen"). The whole premise of OOP is that the code becomes more modular and easy to modify/replicate without unnecessarily risking the safety and performance of the entire application.

Have you ever played Jenga? It's a game where you stack wooden blocks on top of one another and take turns with your opponent to pull out a single block and move it to the top of the stack. As the game (e.g. the development) continues, the risk of failure increases. Much like Jenga, procedural programming by nature tends to be very linear and continually builds upon itself - which, over time, creates the risk of a cascading failure (one piece fails and causes everything else to fail).

This isn't to say this doesn't happen regardless - but OOP is a style of coding that, atleast in the hands of experienced devs, tries to minimize those chances by emphasizing the abstraction of objects and processes and creating more modular, reusable code. This is especially important at scale when you have dozens of people touching your growing codebase. Modular and reusable are the key points here (so far as OOP is concerned).

A great reference that goes into more detail (I didn't write, nor am I associated with the writer/publisher): https://neonbrand.com/website-design/procedural-programming-vs-object-oriented-programming-a-review/