Developing Best Practices

(Patrick Stuart [@pstuart]) #1

Would love to see a post that highlights best practices from the community for properly developing and sharing SmartApps and SmartDevices.

For example, how to get started on github.

How to set up a respository

How to browse the IDE code examples for smartapps (both internal and the shared examples)

How to browse the IDE code examples for smartdevice types (why is there no share option here?)

How to fork someone’s repo.

How to post your code to the forums.

Tips and tricks for coding in the IDE
-How to use log.debug and other log options
-How to use simulator commands
-How to use messages
-How to use commands
-Difference between virtual devices and actual devices
-How to properly publish

Wishlist for IDE
-Version control (please, please, please)
-Watchlist for variables
-Ability to have access to the getClass() method for variables.
-Better documentation for functions
-Inline code complete (I’m dreaming, I know)
-Core API access

I am more than happy to post and share how I am doing things, as I am just figuring things out on this platform, but would love others to share their developing methodology, tips, tricks etc.

(Convinced ST will never be unbroken…) #2

I’d also like to see some clarification on ST’s implementation of groovy as I assume it is a subset of the language.

I tried to use some of groovy’s neat time notation ( and got nothing but errors.

(Aaron) #3

So, I’m going to try to revive this thread. I was just starting a new post with similar questions and Discourse (the underlying forum software) pointed me to this thread. Specifically, I have written my first SmartApp (that borrows heavily from others). I started with code I copied out of a published SmartApp and a SmartApp I picked up in a post. I shared my code by posting the code in the forum. Another member picked it up, tested, and added some stuff. This is fantastic stuff but I know there is a more rigorous way to do this to avoid errors, omissions, and unintended forks. To an experienced coder, this may be obvious and, I suspect, has something to do with using GitHub.

Since it would appear that a lot of us are not coders and new to this, I think it would be very helpful to have some basic best-practices guidelines suggested by someone at ST. Maybe @Ben could weigh in.

Maybe this has already been covered on another thread. If so, please post a link here for anyone else who come upon this thread like I did.