Clarification on the presentation please. Unit 3 slide show slide 68

Unit 3 slide show slide 68. “Keep your code clean”, the last bullet point “Write code using blocks”. That seems ambiguous to me. Are we talking about using the App Lab block language? Are we talking about using blocks of code using the { } syntax? Perhaps we are talking about blocks of code separated by blank lines and comments? Or are we talking about blocks of code as in functions? Or as Bilbo Baggins once said “All of them at once”.

@jdonwells I think Bilbo is on to something here :slight_smile:

As a debugging strategy, switching to blocks can also help if there are syntax issues.

Thank you. That was the one meaning I didn’t consider.

My experience with App Lab is that you don’t always have the option of switching to blocks. Screenshot 2020-08-04 at 2.00.28 PM
If you can, switching to blocks can often clarify semantic issues like parens and braces being in the wrong place.

Indentation takes the place of blocks in text mode, but that indentation can lie. Students can go through their code and apply some standard formatting manually if blocks are unavailable. However, that may not highlight the problem if you are human and don’t see the mistake. Cut and paste into some online formatting website could also be useful to get a truthful indentation.