Tidying your code in Sandbox

While working on your sandbox you may have noticed that some of your code is untidy and doesn’t look organized. Don’t worry because there is a tool that gives you a quick fix to make your code tidy.

This is an example of an untidy sandbox.

Now to make the code tidy and in the proper place, follow these steps:

Step 1: Click the lock button

Step 2: Click unlock code

Step 3: Now, click the “magic wand” icon to do its trick and make the code tidy.

Here’s what happens after clicking the tidy code tool. All the codes are aligned to the left.

Step 4: It’s your preference to lock the codes to avoid any accidental changes.

You can relock the code for HTML to avoid accidental changes to the CSS and script reference. Also, please note that you will not be able to relock the CSS and JS code once they are unlocked for the first time.

The importance of having tidy code - easy to look at later, easy for debugging, most coding work is a collaborative effort and other people will read the code, so make it easy and consistent (decreases chances of errors and saves time).

So, this is how the tidy code button works - your code is properly placed and neater to look.

Keep posted here in the BSD community for more tips.