gvsucis / mobile-app-dev-book

Sample code for the Engelsma/Dulimarta Mobile App Dev book.
GNU General Public License v3.0
18 stars 5 forks source link

Swift Styling Feedback #8

Closed jengelsma closed 7 years ago

jengelsma commented 7 years ago

@josiahcampbell pointed out that the consistent use of explicit self. on instance variables is contrary to most Swift style guides (and there are many). Old school Java developers used this technique (this.) for a couple of reasons 1) make explicit what are instance variables and what are not. 2) Autocomplete didn't kick in on many IDEs (Eclipse, JBuilder, etc) until you you typed the dot.

Both of these benefits are a moot point now with Xcode and Android Studio both using syntax highlighting to differentiate between local and instance vars. In addition, they autocomplete on every keystroke.

The only remaining merit for this approach would be in the text book, the default syntax highlighting in LaTeX does not distinguish between local and instance vars. Methinks it shouldn't be hard for @dulimarta to solve this. If so, we should probably conform to conventional style guidelines and abandon our old duffer ways.

jengelsma commented 7 years ago

See commit 2ac5def4890e4c64ebbbed6e82a4fa755e0958f4 in private repo.