Questions tagged [syntax]

Questions related to teaching about programming language syntax. Use this tag to ask about teaching the usage of correct syntax or to ask questions involving it.

Filter by
Sorted by
Tagged with
2 votes
1 answer
111 views

Are there any recommended tools for teaching syntax and grammar of programming languages?

I would like to know if there are some tools to teach the following topics in a programming paradigms course: Demonstration of lexical rules Demonstration of grammar rules, such as tree parsers of ...
user avatar
  • 261
8 votes
4 answers
2k views

What are some non-CS concepts that can be defined using BNF notation?

I'm preparing a class on the modified BNF notation that python uses. I.e., Each rule begins with a name (which is the name defined by the rule) and ::=. A vertical bar (...
user avatar
  • 181
2 votes
3 answers
90 views

A category to classify expressions, statements and blocks

I was teaching an intro to Programming class, full of social scientists. After explaining that the basic building blocks of a program are called tokens, I took them through Keywords, Identifiers, ...
user avatar
5 votes
2 answers
120 views

App Lab/JS confusion between strings and variables

In my APCSP class (using app lab, which is javascript based), I noticed that there are many students who struggle with the difference between a string ("foo") and a ...
user avatar
  • 4,754
2 votes
1 answer
74 views

Going from syntax to CS concepts

I am going to be teaching a small-ish group of people to write code to control a device. The code is built around a giant framework made to make it easy to write the actual code. My job nominally is ...
user avatar
  • 4,754
9 votes
2 answers
158 views

Is it a good idea to have students see syntax much earlier than they write it themselves?

I was wondering if there was any research on whether or not students generally perform better later if they're introduced to the syntax they'll be learning far earlier than they actually use it. As ...
user avatar
3 votes
5 answers
320 views

How to teach beginning students how to find and fix syntax errors?

Our college has a course entitled "Introduction To Programming", although I often tell the students that the real title should be "Introduction to Programming... for non-majors... who have never ...
user avatar
7 votes
3 answers
203 views

Teaching syntactic sugar

When I show my code to students I tutor, they ask about "all those things in my code", which refers (quite vaguely) to things such as shortened ifs, post\...
user avatar
  • 6,227
8 votes
4 answers
467 views

How can I help students develop intuition about a programming language?

As an tutor for introductory CS classes, I often come across students that have a very rigid understanding of a programming language up to what they have been taught so far. This most often manifests ...
user avatar
  • 331
12 votes
7 answers
692 views

Lesson Idea: Arrays, Pointers, and Syntactic Sugar

One of the most challenging concepts to instill in new CS students is 0-indexing (indeed, the pedagogy of this fact probably merits its own discussion). Another difficult topic -- although a slightly ...
user avatar
  • 9,032
16 votes
9 answers
964 views

Should I have written tests on basic programming skills?

When making more complex programs, it is natural that one needs to run the program to see whether things work and fixing bugs. However, if one makes a lot of mistakes in basic programming, e.g. ...
user avatar