From the course: Learning Data Analytics: 1 Foundations

Learning syntax

From the course: Learning Data Analytics: 1 Foundations

Learning syntax

- [Instructor] Syntax is required. Programs use syntax to run. And really, nothing can happen without it. All programs have their own syntax, just like different countries have their different language. So an easy way to think about syntax is that it's the language of your program. And it allows you to interact with your program to do a variety of different commands, like when you choose a menu option. Or even when you write a formula, you're using syntax. So of course, it can be intimidating. Could you imagine if you had to learn syntax to open or save a file? If you're old enough to remember DOS, then you know exactly what it's like. Don't be overwhelmed by syntax, because just like you learned to speak in your language, you'll learn to speak in syntax. I think one of the more difficult parts of learning syntax is that you have to know what you want to say. Then you have to learn how to say it. And then you have to say it correctly, or should I say, type it correctly? There's really no way around learning syntax, or as some would say, fumbling through syntax until you learn it. However, if you're not a programmer, you may find that you don't have to learn as much as you think. I know people typically dread going to the help menu, but trust me, it's way better than it was in the '90s. The help menu also includes examples. And I know for me, personally, seeing a working sample helps me to understand maybe how to apply it, which is great when I know what I want to do, but not exactly how to syntactically write it. I don't know a single technical person that doesn't hit up the internet when they're looking for something to solve a problem in a particular program. This can either be dramatically helpful to solve the problem or at least give you options to try. When I'm searching for answers, if I see Experts Exchange or Stack Overflow pop up, I'm going to typically go there first, because very early in my career, these sites were where the technical people went to share questions and get information from other technical people. You'll see people asking similar questions to yours, and it will be full of suggestions and potential syntax. I encourage people to use real-people terms to find the answer versus attempting to write technical terms. Simple searches like tie names together will likely to take you to a concatenator CONCAT function. Or convert text date to a real date in Excel will likely take you to some conversion functions. Keep in mind that syntax requires following the rules of the syntax for that program. The way you write a function in one program is not necessarily how you write it in all programs. However, if you have learned syntax for one program, it's easier to find it in other programs. For example, you could use words like, how do I concatenate in SQL or how do I write an IF function in Power BI? Many modern tools give us the ability to use a GUI or graphical user interface to build things. But we can always take a peek behind the scenes to look at the syntax. For example, in Power Query, we would look at M code. In Macros, we would look at the VBA. In the Function palette, we would just look at what the function is written in the formula bar. Even Access queries build a SQL statement that you can see in the background and learn how to read. There's no way to get around learning syntax. And if you want to expand the capabilities of your data and your skills, the more you learn about syntax of any particular program, the more you can leverage it. If you find you're in love with syntax, if you like to type out all that code versus using the GUI, you might grow up to pursue data science, where programming is one of the key differences between a data scientist and a data analyst.

Contents