Skip to content

Commit

Permalink
addedSyntaxDefInNewBranch
Browse files Browse the repository at this point in the history
  • Loading branch information
kulsoom2003 committed Oct 24, 2024
1 parent 02b4872 commit f5d2c3e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions book/src/pages/foreword-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ Since we're assuming you have little programming experience we won't go into the
Suffice to say there are different ways to think about and write computer programs, and we've chosen the functional programming approach.

The reasons for choosing functional programming are more interesting.
It's common to teach programming by what we call the "bag of syntax" approach.
In this approach a programming language is taught a collection of syntactical features (variables, for loops, while loops, methods) and students are left to figure out on their own when to use each feature.
It's common to teach programming by what we call the "bag of syntax" approach, where "syntax" is the term we use for the rules defining the structure of symbols in a programming language.
In English, we are taught that a sentence can be constructed using the rule: subject + verb + object e.g. "the artist paints a cat".
A programming language might have a different set of rules and symbols to read `Artist.paint(cat);`.
This is a general example - languages have syntax variations, and it is worth noting that the English sentence is purely descriptive while the general code example is instructing the computer to paint a cat using 'Artist', which could be a library or object.
In the "bag of syntax" approach a programming language is taught a collection of syntactical features (variables, for loops, while loops, methods) and students are left to figure out on their own when to use each feature.
We've seen this method fail both when we were undergraduates learning programming, and as postgraduates teaching programming, as students simply have no systematic way to break down a problem and turn it into code.
The result is that many students dropped out due to the poor quality of teaching.
The students that remained tended to, like us, already have extensive programming experience.
Expand Down

0 comments on commit f5d2c3e

Please sign in to comment.