Suggestions for noob training

I have no programming skills or training. I’m pretty technical, so I’m certain I can learn. Any suggestions on which online courses I should take in order to be able to start writing in Groovy?

http://docs.smartthings.com/en/latest/

1 Like

I’ve never written a line of code in my life.

Groovy Basics
SmartThings uses the Groovy programming language. If you’ve programmed before, you can learn Groovy.

In that case maybe try codecademy.com to get your feet wet :slight_smile:

2 Likes

Yeah I’m using udemy right now. I was hoping someone could suggest a specific course or at least competency. Java? Pearl?

I’m 3 videos in to this https://www.udemy.com/java-tutorial/learn/#/

I’ll see if it gets me started.

1 Like

Say you want to learn Spanish. There are basically three philosophies:

  1. Study Latin. As the foundation for all Romance languages, what you learn will help you understand the concepts of Spanish. It won’t however teach you to speak, read, or write Spanish. You have to take another Spanish course after you’ve mastered Latin.

  2. Study Spanish. There are lots of free courses these days. Eventually, you get enough Spanish to do something with. How much depends on many different factors, including your natural proficiency with languages. Some people end up learning how to write, but not really how to read or speak. You’ll probably have excellent grammar, though. :wink:

  3. move to Mexico for a few months. Don’t hang out with people who speak English. This is often the reverse of 2: you learn how to speak, but not necessarily how to read or write. And you may develop quirks depending on the first places you encounter certain linguistic concepts. It’s really common, for example, for people to learn the present and future tenses, but not conditionals or past tenses.

Learning Groovy

Deciding to learn Java in order to learn groovy is the first approach. Latin before Spanish. You’re still going to have to learn groovy eventually, and some of what you learn in Java will be helpful in some of it won’t be. It’s not a bad idea, but it’s a time-consuming good idea.

Watching live code Fridays or just jumping in with code samples is the third approach. Live it before you learn it. Again, it’s not a bad idea. It will certainly get you writing groovy faster than the first approach. But it’s also very likely that you will be missing pieces, sometimes big pieces, of what writing groovy is all about.

The alternative is the second approach mixed with the third. Find a groovy course or a book, study groovy in a formal way that covers all the pieces, and mix in exposure to real life examples as often as you can without getting confused. This is probably the best idea for most languages, but unfortunately for historical reasons pretty much every groovy book and course assumes you already know Java.

Also what SmartThings uses is actually a groovy dialect – – it’s its own stripped down version, and doesn’t have everything that official groovy has. But it’s close enough that if you study groovy, you’ll be able to make the adjustments you need. (You should know, however, that SmartThings does not use grails. And you can’t load your own libraries.)

If I were making a recommendation to a friend who had no coding background and wasn’t in a hurry, I would say take a basic java course, then combine a basic groovy tutorial (which will probably be very easy once you do have some Java) with watching live coding and studying code examples. Just know that a lot of the coding methods you learn in Java will not be usable in SmartThings. But the basic concepts that you learn in Java will directly apply. And most of the groovy resources are really bad at explaining those basic concepts, because they assume you already know them from another programming language.

But there are lots of different ways to approach it. Many people just start with an existing device handler and make a few minor changes. :sunglasses:

5 Likes

Great answer, thanks. As you know I’ve touched a couple device handlers and (unsuccessfully) tried to make them work with a device I’m having a problem with. It’s largely Latin to me, but I do see what’s going on in some areas of the code.

As you suggested I’m taking a basic online Java course now. I’ll try to get through this in the next week, then dive back in to Groovy once I have an idea of the basics of code. And I do plan to check out the Live Code Fridays.

Thanks guys, this community is pretty cool. I’m looking forward to being a part of it.

1 Like

Im not a formally trained programmer, as I am sure some programmers will attest to by looking at any code I have released, I know where things are not optimised and how I should be optimising it, but I lack some knowledge on how to do it correctly.
However I do feel like I hold my own in regards to what I have managed to achieve in a short space of time. I am a technical guy with some powershell and C# experience beforehand and IMHO groovy is their love child :smile:

For me the only place that is important and the most valuable is the ST documentation, such is the high standards of the documentation. It is pure gold.
along with looking through others code for inspiration and plagiarism ( just be sure to credit where credit is due!)

2 Likes