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

JavaScript jQuery Basics (2014) Creating a Simple Lightbox Plan

JT Keller
JT Keller
12,731 Points

Why can't Treehouse apply a common/standard style guide such as Google's HTML/CSS Style Guide across it's courses ?

First let me say that I'm a big Treehouse fan! However, I would like to provide some constructive criticism.

I don't understand why Treehouse can't apply common/standard style guides across all of their courses. Google style guides are considered by most to be best practice.

It's really annoying when one course emphasizes HTML indentation using 2 spaces, whereas other classes use a tab for indentation. The most annoying is the improper nesting and indentation of child elements in the HTML. It makes it really difficult to eyeball branch relationships when everything is jammed on a single line.

Adhering to common formatting and styling practices is just as important as TDD or properly documenting your code.

Google Style Guides:

Before ( (⊙_☉) ):

<ul>
        <li><a href="images/refferal_machine.png"><img src="images/refferal_machine.png" width="100" alt="Refferal Machine By Matthew Spiel"></a></li>
        <li><a href="images/space-juice.png"><img src="images/space-juice.png" width="100" alt="Space Juice by Mat Helme"></a></li>
        <li><a href="images/education.png"><img src="images/education.png" width="100" alt="Education by Chris Michel"></a></li>
        <li><a href="images/copy_mcrepeatsalot.png"><img src="images/copy_mcrepeatsalot.png" width="100" alt="Wanted: Copy McRepeatsalot by Chris Michel"></a></li>
        <li><a href="images/sebastian.png"><img src="images/sebastian.png" width="100" alt="Sebastian by Mat Helme"></a></li>
        <li><a href="images/skill-polish.png"><img src="images/skill-polish.png" width="100" alt="Skill Polish by Chris Michel"></a></li>
        <li><a href="images/chuck.png"><img src="images/chuck.png" width="100" alt="Chuck by Mat Helme"></a></li>
        <li><a href="images/library.png"><img src="images/library.png" width="100" alt="Library by Tyson Rosage"></a></li>
        <li><a href="images/boat.png"><img src="images/boat.png" width="100" alt="Boat by Griffin Moore"></a></li>
        <li><a href="images/illustrator_foundations.png"><img src="images/illustrator_foundations.png" width="100" alt="Illustrator Foundations by Matthew Spiel"></a></li>
        <li><a href="images/treehouse_shop.jpg"><img src="images/treehouse_shop.jpg" width="100" alt="Treehouse Shop by Eric Smith"></a></li>
    </ul>

After (Oh there's actual branching (•‿•) ):

<ul id="imageGallery">
      <li>
        <a href="images/refferal_machine.png">
          <img src="images/refferal_machine.png" width="100" alt="Refferal Machine By Matthew Spiel">
        </a>
      </li>
      <li>
        <a href="images/space-juice.png">
          <img src="images/space-juice.png" width="100" alt="Space Juice by Mat Helme">
        </a>
      </li>
      <li>
        <a href="images/education.png">
          <img src="images/education.png" width="100" alt="Education by Chris Michel">
        </a>
      </li>
      <li>
        <a href="images/copy_mcrepeatsalot.png">
          <img src="images/copy_mcrepeatsalot.png" width="100" alt="Wanted: Copy McRepeatsalot by Chris Michel">
        </a>
      </li>
      <li>
        <a href="images/sebastian.png">
          <img src="images/sebastian.png" width="100" alt="Sebastian by Mat Helme"></a></li>
      <li>
        <a href="images/skill-polish.png">
          <img src="images/skill-polish.png" width="100" alt="Skill Polish by Chris Michel">
        </a>
      </li>
      <li>
        <a href="images/chuck.png">
          <img src="images/chuck.png" width="100" alt="Chuck by Mat Helme">
        </a>
      </li>
      <li>
        <a href="images/library.png">
          <img src="images/library.png" width="100" alt="Library by Tyson Rosage">
        </a>
      </li>
      <li>
        <a href="images/boat.png">
          <img src="images/boat.png" width="100" alt="Boat by Griffin Moore">
        </a>
      </li>
      <li>
        <a href="images/illustrator_foundations.png">
          <img src="images/illustrator_foundations.png" width="100" alt="Illustrator Foundations by Matthew Spiel">
        </a>
      </li>
      <li>
        <a href="images/treehouse_shop.jpg">
          <img src="images/treehouse_shop.jpg" width="100" alt="Treehouse Shop by Eric Smith">
        </a>
      </li>
    </ul>
Steven Parker
Steven Parker
231,269 Points

Yea, but look how many extra lines you wasted! :stuck_out_tongue:

But seriously ... shouldn't the <ul> line up with the </ul> ?

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

I come from an editing background and am used to having to use "Style Guides," but learned really fast both there and now in coding that it is just that... "Guides." They "guide" you to what could be done, but are by no means the absolute rules.

Everyone has his or her own personal style (that will never change). Even when I was editing full-time, I could have two almost identical projects from two different authors that I would have to edit very differently, based on what the author wanted.

The only things about one's style that really matter are:

  1. Maintain styling that affects syntax.

  2. Always be consistent throughout your code. If you do one thing on line 20 it should be done the same way on line 200.

  3. When you're working collaboratively, you will have to adapt your personal style to match that of the group. But keep in mind that the styles will very likely be different with the next/new group you work with.

There are more, but I feel those three are the most important. So, personally, I think it's great that Treehouse has diversity and individuality in styles, because that's what it will most likely be in the real world. :)

Keep Coding! :dizzy:

Gabbie Metheny
Gabbie Metheny
33,778 Points

I think this is pretty accurate, and I've actually appreciated the variety of styles because I feel like the varied exposure is helping me define my own personal coding style.