9
$\begingroup$

Are there any "pros" or "cons" I have overlooked regarding using Excel as a means to introduce a range of fundamental programming concepts.

This question relates to teaching a programming module at secondary school final year level (one level below first year of university). I use Python.

Learner profile

Learners often have no programming or web design background. Some lack essential computer literacy skills- creating and saving files, installing applications and so on (I get a diverse group and have no say in selection) Learners are all adults, ranging typically from 21 to 61. Many have been out of education for a number of years.

Rationale

Many beginners find using the terminal and IDEs to be quite alien. Add to that the need to understand key concepts and apply them, it may present a "barrier to entry". Using an application that they may have encountered before and likely have on their own computers (when they have one) may allow learners to grasp key concepts in a more "familiar" environment.

Syllabus

These vary widely, so rather than include "fluff" on the particular one I have to work with, I'll expand on the relevant elements below, which are likely relevant to any introductory programming course.

Relevant topics to explore in the Introduction

I'll try to be succinct but can expand on any topics in the comments

  • Variables: cell ref ~ address in memory- not user friendly. Name a cell- can be used in expression, like a variable.
  • Operators and BEMDAS
  • Syntax
  • Boolean AND OR NOT
  • conditional statements
  • built-in functions
  • create a User Defined Function (possibly- not sure on this one).

Pros and Cons

I've mentioned some of the pros, as I see them. I cannot think of any cons at the moment:

Are there more pros I've missed, are there possible downsides, and has anyone tried using this before?

$\endgroup$
8
  • $\begingroup$ Which OS are you using. If you are using a Unix (UNIX, MacOS, Gnu/Linux), then (if syllabus allows) it could be a good idea to teach command line. My order of preference, for my own usage, are: Unix command line, Unix GUI (KDE), Microsoft GUI, Microsoft command line. $\endgroup$ Commented Aug 30, 2017 at 14:19
  • $\begingroup$ Actually, I don't see any "pros" stated in your question. Did you forget to list them. I see the "what" but not the "why". $\endgroup$
    – Buffy
    Commented Aug 30, 2017 at 17:11
  • 1
    $\begingroup$ @Buffy; the pros are that the concepts under "Relevant topics to explore in the Introduction" are introduced, i.e. to visualise a variable as a cell location which can be given a name, and you can assign a data type, use the name in calculations etc. $\endgroup$
    – srattigan
    Commented Aug 30, 2017 at 18:38
  • $\begingroup$ @ctrl-alt-decor All the machines use Win7. I use a Linux laptop myself. I have considered starting code after the intro with NotePad++, and this could generate Python code that is run from the command line, and I have also been thinking about creating scripts in the form of Windows batch files and doing some simple "commands" for file-sys nav, editing/creating/deleting folders and so on... $\endgroup$
    – srattigan
    Commented Aug 30, 2017 at 18:40
  • 1
    $\begingroup$ @Buffy My rationale is that it introduces these topics in a more familiar, and relatively popular application that many may have met before, and to use the Excel environment to demonstrate the concepts of variables etc. When I show the Python Interpreter, math expressions will (for the most part) evaluate as they do in Excel. If I use if/else, the syntax will differ but the principle will be the same. If we were to look at a function to sum a list, we have to think about the algorithm that may be used "under the hood" in Excel, and create it in Python. Similarly for min, max etc. $\endgroup$
    – srattigan
    Commented Aug 30, 2017 at 19:20

7 Answers 7

7
$\begingroup$

Spreadsheets are probably the most popular functional programming language, and is is some what visual. I have taught it for years 7 to 9, but not part of a qualification based course.

Things to be aware of:

  • It is a functional language, as long as you avoid VBA / macros etc.
  • You can do functions, though I am not sure about named functions.
  • I like to put intermediate calculations in to hidden columns. The alternative is very complex formulae / functions, that are hard to read, and hard to write.
  • The hard part is making it relevant. Don't make all of the exercises about accounting.
  • Provide spreadsheets that are started, and give them exercises to add/change something.
  • Don't assume that this is relevant, to them, or that they have any experience. Ask them, give them a choice about how they learn.
  • If the data sets are too small, then it will not seem relevant, as you could do it my hand more easily.
  • There is a lot of copy/paste in spreadsheets, this is the main downside, but to use them well you need to embrace it. This is not so for any other, good, language. In the first lesson, have them enter formula, for about 10 rows. Then show them how to use the little dot in the bottom right of the cell, to make it easier. They love this.
  • Whenever I am teaching programming, I tell them that I am teaching them to be lazy. This helps to engage the lazy ones. Sometimes a hard worker will comment on this, but I tell them “don't worry, one we have learnt to do it the easy way, then this allows as to do more stuff.”.
  • Most of what you do in spreadsheets can be done in python (except data entry), so you can link it to the python lessons.

While being a good introduction to functional programming. I do not think it is a good introduction to programming. It may be of some help, but I do not imagine the pace of learning will be high.

Most people start with Scratch. The main barrier with this language is that it seems childish (it is taught to primary school pupils ( ≤ yr 6 ). There is another language call snap. It is like scratch, but taught to 1st year undergraduates. It has some extra features, such as create your own functions. With Scratch you can create your own procedures, but not functions. Both of these languages are available as a web service, scratch also has a desktop app. Both you can download and host locally (if internet access is poor).


With snap you can make it look like any other language. I have made it look like python. Unfortunately I could not get all of the blocks to work, but I did use them to create a printed work sheet scratch to scratchy python to python (they did not know that I used snap to help me create it). You can also teach snap to auto generate code in another language. E.g. write program in snap, click generate, and get a python program (I have not properly tried this).

$\endgroup$
2
  • $\begingroup$ I like to show how I used a spreadsheet with a single expression (duplicated across multiple columns) to decode a "noisy" textual message - 1 in 5 chance that the letter will be correct - from a large number of repetitions of the message (about 40 is usually sufficient). This is from a book by Gerald M. Weinberg, and I think it is a beautiful example of using a spreadsheet to solve a problem that would require a quite complex program otherwise. Thus, I was unwittingly teaching a Functional approach! (which I otherwise do not) $\endgroup$
    – user737
    Commented Aug 30, 2017 at 14:06
  • $\begingroup$ @ctrl-alt-delor I started bith Blockly (Google) last year, and did a few weeks in Scratch, to try to demonstrate the basics. Some said they found it useful, some did not. I am keen to try anything new that helps learners to "get it" at the beginning, before moving on to coding in a text-editor or IDE. $\endgroup$
    – srattigan
    Commented Aug 30, 2017 at 18:51
7
$\begingroup$

The big disadvantage seems to be that you're re-enforcing their (or maybe your own) preconceptions about barriers to entry, and taking them further from the 'normal' programming environment.

Yes, you can twist a spreadsheet to demonstrate some topics, but the biggest misconception you will teach by starting like this is 'everything executes in parallel'. Having moved from coding software to verilog (hardware) I can vouch for this being a major mindset change.

You're also teaching a non-flat code layout, have zero scope for sensible comments, and an unusual syntax.

A better approach is probably to find an online simulator (i.e. a web browser, which everyone has or can access in many countries). These will handle the code storage (in the browser or in the cloud) and avoids any assumptions about how familiar they are with specific types of software. I really think you're better identifying this as a new journey, and not expecting your cohort to have anything installed on their machines.

Having supported a public drop-in class, I'd also opt for an environment which allows both 'block' coding or text based views like the micro:bit javascript blocks editor. This removes the barrier of needing to remember syntax and seems just as relevant with older introductory level students as very young ones. Once you have introduced the fundamentals (keeping the first contact easy and low stress), you can move to using text based entry.

Returning to the micro:bit example, I think having a physical device is less important with an older cohort (particularly if they are in your class by choice). It gives you scope to use a demo, and show some context about how close to invisible/trivial computers are (something else that your spreadsheet doesn't expose).

To summarise my objections to the proposed approach:

  • Students in your specific cohort may have no (or negative) experience of spreadsheets [unless you already covered this in a prior stand-alone module]
  • There is no visible execution flow to follow
  • User input is parsed in parallel, not in sequence
  • The abstraction (and syntax) of user input to a spreadsheet does not look like code (compare with the discussion of markup vs program languages)
  • Only one cell of user input can be read at a time (and this makes commenting or review hard)
  • Students are unlikely to find many other resources to use for independent study which are aligned with your proposed approach
$\endgroup$
10
  • $\begingroup$ I agree that many of your points are true, but I don't think it will hurt anyone to spend a week learning some ideas from spreadsheets. I do this. $\endgroup$
    – user737
    Commented Aug 30, 2017 at 14:02
  • $\begingroup$ Do you mean 'you teach this as an introduction', or 'you learn from spreadsheets'? I think it will do a small amount of harm - maybe to a minority - if it is used as an introduction. $\endgroup$ Commented Aug 30, 2017 at 14:06
  • 1
    $\begingroup$ Ah, then, I stand corrected. Easy and Productive is my mantra. for myself and others $\endgroup$
    – Jay
    Commented Aug 30, 2017 at 14:13
  • 1
    $\begingroup$ @Sean I've also tried both blockly-games.appspot.com and Scratch (cloud and DL vers), trinket.io for online storage and execution and pythontutor.com so that you can step through the code and see it visualised in the browser. I am also teaching a module on Excel this year, and it occurred to me that perhaps I could use it as a learning aid for the concepts outlined above, before moving on to other approaches. I'd be interested to know how it may do harm? If discussing how the SUM function works "under the hood" it might be a way to introduce the idea of something like a for-loop. $\endgroup$
    – srattigan
    Commented Aug 30, 2017 at 18:47
  • 1
    $\begingroup$ @Sean, thanks for clarifying what you meant. I can see where you are coming from, and while I do not agree entirely with your perspective, it is food for thought. I'm going to have to think about this a bit more... $\endgroup$
    – srattigan
    Commented Aug 31, 2017 at 15:56
4
$\begingroup$

I got a chance to teach Introduction to Computing & Programming course to Chemical Engineering entry students and their syllabus included both Programming concepts & Excel. I began the course with just Algorithms and after 4 weeks, switched to Excel & then on programming. Off course they are different to your target audience a bit but I found Excel('s functions) pretty helpful for them to comprehend the syntax (after a couple of weeks of Excel, I switched to Visual C++), so the pros you mentioned are really there.

Cons

Using Excel alone can make students thinking in terms of sheets/tables which can make them picking the concepts of arrays,etc. pretty tough later on and even if you go in some depth of Excel functions, still I don't feel its worth an entire course (even to learn programming).

Conclusion/Suggestion

My personal experience of using Excel as catalyst was really good one and I think using an user-friendly/easier IDE like Visual Studio with Excel is worth a try

$\endgroup$
1
  • 1
    $\begingroup$ Comments are not for extended discussion; this conversation has been moved to chat. $\endgroup$
    – thesecretmaster
    Commented Aug 30, 2017 at 20:55
3
$\begingroup$

The choice of using spreadsheets to teach programming itself is kind of baffling for me. I would rather you use of the several online ways to teach coding, which are much more useful.

If online is not an option and you want something simple, a straight forward combination of Visual Studio Code and GCC Compiler (which is probably already there on the machine) would be a good option.

If these are first years, and I was a first year, I don't want to see Excel sheets. Spreadsheets make command line look like an attractive neighbour.

$\endgroup$
5
  • 1
    $\begingroup$ Actually, spreadsheets are very widely used in complex, "big data" analysis. I used to teach on this idea for a few weeks, but we had to drop it from the curriculum for the sake of time and focus. I suggest that you find one of the many books about data analysis using Excel and Access and take a quick look. You will be surprised and impressed. Excel is not the most used software in the world for nothing, and there are few data analysis tasks that cannot be done elegantly with it. $\endgroup$
    – user737
    Commented Aug 30, 2017 at 14:09
  • 1
    $\begingroup$ I have nothing against spreadsheets (I use them myself at work). Just, I don't want first years exposed to it, that is all :P I like to keep my classroom fun and nice, and spreadsheets are just not that. $\endgroup$
    – Jay
    Commented Aug 30, 2017 at 14:12
  • 1
    $\begingroup$ It would be interesting to hear why you think they are not fun or nice or why early learning would be hindered with spreadsheets. They were designed from the beginning as a tool that was easy to learn and apply for complex problems. Programming is not just writing statements, there used to be "analog computers" that could solve some problems with no numerical representation at all. You can build one to find a linear approximation of a scattered set of points using a plank of wood, nails, rubber bands and a stick. And it works 'instantly' too. $\endgroup$
    – user737
    Commented Aug 30, 2017 at 14:17
  • $\begingroup$ To use a simple analogy, spreadsheets are like that Microsoft guy from the apple ad. Just does not fit into my definition anything remotely fun. Full Disclosure, I am a huge MS fan, and 80 % of my money comes from dot net, but yeah, I can be honest and say that most of the time Microsoft is not what I call fun. They have improved over the years, but, spreadsheets...nope, not fun at all. $\endgroup$
    – Jay
    Commented Aug 30, 2017 at 14:20
  • $\begingroup$ Thanks, I wasn't even thinking of fun! I used Scratch last year with mixed results. I also used Blockly Games. Maybe I can find a way to make Excel sheets fun :D It's a good point though! Fun = engagement => better learning? $\endgroup$
    – srattigan
    Commented Aug 30, 2017 at 18:54
1
$\begingroup$

I agree with most of the other answers, but I wanted to add another way to look at it:

I think one of the biggest downsides of using spreadsheets to introduce programming is that it reinforces a lot of stereotypes about programming, which turns off a lot of people who might otherwise have been interested in the subject. If the first day of my first programming course was "okay, now open up Excel..." my eyes would have glazed over and I would have thought "maybe this programming stuff isn't for me after all..."

Programming is more than just ones and zeroes or staring at spreadsheets. There's a craft to it, if not an art, and it opens up a ton of possibilities for expressing yourself, communicating ideas, and accomplishing your goals. I think that's the stuff you should be highlighting in your first course.

And since you're working with students from diverse backgrounds and of under-represented groups in computer science, I think you should be very aware of the effect your class has on their interest.

At the risk of repeating an answer I've given before, I'd like to point you to Processing, which I think is perfect for the type of class you're teaching. See these other questions for more info:

Shameless self-promotion: I've written a bunch of tutorials that start in Processing and then "graduate" to more advanced topics available at HappyCoding.io, and I think they're pretty amenable to a classroom environment.

$\endgroup$
2
  • 2
    $\begingroup$ @Kevin Workman, really good point. Who wants a boring Introduction? As someone said in another response- we need some fun in there too! I may demo some of the work of previous years students to show what the end-goal is. I've read through those links as well- there were some really nice suggestions in each. Processing looks pretty nice, and although I am happily married to Python, I am tempted to cheat, or even have an affair with Processing. $\endgroup$
    – srattigan
    Commented Aug 30, 2017 at 19:14
  • $\begingroup$ @srattigan In that case you might look into using Processing.py. See this answer for more info. $\endgroup$ Commented Aug 30, 2017 at 19:16
1
$\begingroup$

Perhaps you should first examine the goals you have for your students. Where do you want them to end up. You describe them as pretty unsophisticated in computing when they begin. The students you describe aren't completely unique, of course, but are not the typical high-school or college student.

If all you want is to give them a little bit of a glimpse of programming in a more general course, then your approach seems fine to me, though I would probably do something different.

If you feel that spreadsheets would be an especially useful thing for them to know more deeply, then certainly what you are doing is fine.

However, if you want them to be able to use some general purpose programming language eventually, then it seems to me like you are taking a detour that isn't getting them close enough to the goal to warrant the time and effort.

User ctrl-alt-delor suggested simple programming environments like snap and Scratch which offer a more standardized introduction to programming and that aim more directly toward that goal, if it is, indeed, your goal.

But start with the goal and work from there. Don't take too many side trips or trips that later need to be worked back from.


Sorry, I should have said initially, that if the students already have some fairly deep understanding of spreadsheets, what they do, and how, then this is a much more natural kind of thing to do. However, if they are also naive about spreadsheets, then this might create problems instead of help overcome them. But you need to asses your own students, of course.

$\endgroup$
3
  • 1
    $\begingroup$ I like to try different things every year. Some work and some don't. This would not be a major part of the course, just an introduction before moving on to writing Python code in NotePad++ (and later- in the follow-on module- PyCharm). For this module they must understand the elements in the intro, and be able to create flowcharts, modular programming (files and functions, imports etc.). Some may be familiar with Office, and some likely will not. $\endgroup$
    – srattigan
    Commented Aug 30, 2017 at 19:02
  • 2
    $\begingroup$ Good, then. A wise friend of mine has advocated for a long time that a certain part of every course (I think he says 10%) should be experimental. Try something new and evaluate it. But also be prepared to compensate if it goes especially badly. It also makes it less boring if you have to teach the same courses repeatedly. $\endgroup$
    – Buffy
    Commented Aug 30, 2017 at 19:07
  • 1
    $\begingroup$ I never know what the students are going to be like until they start, so I'll know next Monday. It looks like there can be benefits to using Excel: if they have some knowledge of using it, vars, expression and functions may be grasped more readily. On the other hand, it's not very exciting. Scratch and Google Blockly are arguably more "fun", but it was considered useful by about half of last years cohort. Another "new" thing to try is batch file scripts... there really are so many options I can use that getting the right balance is difficult. $\endgroup$
    – srattigan
    Commented Aug 30, 2017 at 19:46
1
$\begingroup$

I think it is an excellent idea. I have taught both programming and introductions to Excel.

A few quick ideas:

You can teach "debugging" by having sum formulas refer to the wrong range, especially by walking them through editing a sheet so they are led into the trap of the sum not being updated.

Excel is an excellent tool for string manipulation - you can write formulas to take strings from a couple of columns and concatenate them, adding fixed separator characters.

You can add conditional logic to string manipulation, varying the way you concatenate depending on another column, say a salutation.

Computer Graphics can be taught, maybe by customising some samples, because you have access to the Shapes API within VBA.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.