Back Button Techniques
Simple Rules for Simpler Code

Simple Rules for Simpler Code

If you've ever heard a developer use the term, "object calisthenics," you might have assumed that they were referring to some hugely complex topic. Luckily, though, that's not the case. It simply refers to a series of coding exercises to promote better software.

Intermediate
5 episodes
53m
5
Latest Episode in This Series

Added 4 years ago

Wrap Primitives (Sometimes)

The next guideline instructs us to always wrap primitives (things like strings and integers). However, I'm going...

Watch
Simple Rules for Simpler Code

Simple Rules for Simpler Code

If you've ever heard a developer use the term, "object calisthenics," you might have assumed that they were referring to some hugely complex topic. Luckily, though, that's not the case. It simply refers to a series of coding exercises to promote better software.

Begin
5
Latest Episode in This Series

Added 4 years ago

Wrap Primitives (Sometimes)

The next guideline instructs us to always wrap primitives (things like strings and integers). However, I'm going...
Watch

Your Teacher | Jeffrey Way

https://laracasts.s3.amazonaws.com/avatars/jeffrey-avatar.jpg's avatar
Hi, I'm Jeffrey. I'm the creator of Laracasts and spend most of my days building the site and thinking of new ways to teach confusing concepts. I live in Orlando, Florida with my wife and two kids.
    1. EPISODE 1

      Run Time 8:27

      Free

      Let's begin with a simple rule: avoid abbreviations. Nearly all beginning developers break this one at some point or another.

    2. EPISODE 2

      Run Time 10:23

      Is it possible that the else condition within that method of yours is either unnecessary or redundant? I bet the answer is yes! If so, get it out of there!

    3. EPISODE 3

      Run Time 12:05

      Free

      I know what you're thinking. One level of indentation? That's impossible! Well, are you sure about that? Maybe there are lots of instances, when we can improve the design of our code by adhering to this guideline.

    4. EPISODE 4

      Run Time 10:00

      As we work in PHP, we'll need to tweak this next guideline a bit. Jeff Bay, the creator of these exercises, recommends that, at most, your classes should contain two instance variables. Let's talk about that a bit!

    5. EPISODE 5

      Run Time 12:15

      The next guideline instructs us to always wrap primitives (things like strings and integers). However, I'm going to caution you on this one. You must first consider the complexity of your app, and the benefits that each wrapper provides.