User:Jean-Loup/Learning to program at Wikiversity

Learning to program at Wikiversity
Did you learn to program by reading wise tomes or by going to lectures?.. I did not. I also have a clear impression that IT students of brick-and-mortar universities do not learn programming this way either. Of course, they go to lectures, they read the textbooks. It does help them, they would not obtain their degrees otherwise. This is not however the way those who get to like programming, who become great programmers learn to code.

Pursuit of a dream
Those who end up hooked were pursuing a vague project, an idea of a great little program that they would have liked to put together... They had no idea of where to begin, but they were sure that such a thing was feasible.

They then might have grabbed a programming book that looked promising, scanned a couple of articles in specialised magazines. Of course, they would have had a fair deal of trouble cutting through the jargon, but the titles seemed to have a relationship with the project of their dreams. They had installed a compiler on their PC and tried a few exercise programs. Later they copied a few more interesting examples from the internet, modified them.. and got hooked.

The addicts
It's not difficult to become a programming addict, it is one of the most creative activities. Obviously it is a very tough job, and it requires a completely different way of thinking, but the pleasure when the result at last pops up on the screen is huge!

Frederick Brooks describes it perfectly in The Mythical Man-Month: "The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from air, creating by exertion of the imagination."

Programming is difficult, there is no doubt about this, but it is creative, satisfying, and the end result can be useful to many people. It does not matter then whether the pleasure comes from the intellectual challenge or from finding one's place in a community of peers.

The others
The others are not in the slightest programming addicts. They are many in IT courses of brick-and-mortar universities. They study programming because that's what one has to do to obtain that blasted degree. One goes to lectures and lab sessions. It's the only way to pass.

Will they learn to program?.. well, yes, at least some of them: There are those among them who will get a taste for it and may become addicts in their turn, but many others will never really like it. They will suffer, will learn the steps and the moves, sufficiently to be able to talk coherently about it. When they graduate, they'll find a job in software development and will fulfill their duties. They may not be inventive or keen, but in large development teams it is probably better not to be too keen. It is important to follow the rules, not so important to be inventive. Let's wish them a great career.

What about Wikiversity, then?
Brick and mortar universities deliver degrees that lead to careers. Not so Wikiversity.

Who then will participate in a Wikiversity course in order to learn IT? I do not want to over-generalise, but I imagine that they will be people who are already programming fans or on their way there. People of all ages attracted to IT who want to take it up seriously. These people realise that the way to heart of IT goes through learning to code.

If they are already seriously interested, what can Wikiversity offer them, or if they are only seriously curious, how can they be made to discover this pleasure? This is the central question: the teacher/learner participants are already programming adepts who have reached various levels of expertise. They want to deepen their knowledge and help others discover and share their source of pleasure.

A learning process suitable for Wikiversity
Learning by practicing is one of the principles of Wikiversity. Coding practice is also essential for learning to program. Let's then put programming practice up front.

Theory, of course is essential, but let theory be introduced by examples. These examples mut be motivating pieces of code that are part of complete and functional programs. This will be much more stimulating than in brick-and-mortar universities where theory is put forward, then illustrated by code fragments which often appear artificial and boring.

Learning for pleasure
Let us place play at the centre of learning, together with challenge, the awareness of progress, and the pleasure of thinking that one is doing really well

Learning is not linear
Course notes, lectures, textbooks all follow a linear progression: One writes a first "Hello World!" program, then immediately the sections on keywords, types, operators, constants and variable, loops, conditional structures, functions or subroutines, classes and objects, etc.. follow. A boring world of jargon and definitions that compete for their sleep-inducing power with the most powerful general anesthetics of contemporary medicine.

Stuff it!

Learner or not one want to write striking programs, programs that do interesting things. Available data types, functions, loops, etc.. yes, that very useful. We will learn them in detail when we need to in order to get the computer to do what we want it to do. We are impatient, we do not want to wait until the fifth week of course to learn how to use operations or function, or classes. we need them now.

Programming subjects at Wikiversity can break the de-motivating shackle of linearity: In programming practice, let us first present complete and entertaining programs (of course very simple code at first) accompanied by a textual explanation which explains the primitive data types, or looping structures used in the program. The explanation page may directly provide the associated theory or make reference to the relevant pages on Wikiversity, Wikibooks or others.

It matters little if an early program resorts to using several structures that would appear later in a classical linear progression. Let's not attempt to force learning to follow a straight line, let us start with a general view, forcibly blurred and incomplete, of many basic elements available for the building of programs. Little by little, while working on further programs, some areas of the general picture will come into focus, understanding will become sharper and the general picture will become more clearer.

Active and interactive learning
Complete and entertaining code examples, well presented theoretical explanations would be good, but not enough. Let's not forget that the imagination of the programmer apprentice is racing. She wants to create her own programs.

At Wikiversity teachers and students are on the same footing. Everyone is a student, everyone is a teacher. If the beginner creates another example program that covers the same domain as an existing example, let her publish it.

Since she does not have the same depth of knowledge as an experienced programmer, the beginner is more likely to make mistakes of design or of style. She is also likely to fail using simple and elegant idioms that a more experienced programmer would employ instinctively. Someone will tell her, this is the role of the discussion pages. Coding issues will be debated there, and alternative solutions will be shown. After the debate, there will remain only to amend the original program, either by changing the code or adding a small comment referring to the discussion.

One can be sure however that before publishing an example, any participant will polish it fastidiously, just for the pride of a job well done.

Learning to manage complexity
Sooner or later (in truth very early) one will hit the issue of complexity... A program grows incredibly fast and become impossible to manage very quickly! One will then reflect that there must exist techniques that make the code easier to write and its maintenance or modification easier. One will then be ready to progress to the next stage of reflexion about software engineering, about modularity, structured programming principles and object-oriented design and programming, design patterns... a whole new world.

Let's not jump ahead of ourselves. Systematic study of the development process and of software engineering will come later, when we will have acquired the bases of one or two programming languages. While writing even the simplest program, the experienced programmer will choose idioms most likely to favour intelligibility and reliability of the code, and to improve maintainability and potential extensions of the software.

On Wikiversity, discussion pages allow presentation of alternative solutions and for the justification or debate of the design decisions, or of style and idiom. These debates will often defy the comprehension of learners, but even so, they will have a beneficial learning outcome. They will bring about the realisation that these choices exist and that they are important, that the notions of code reliability and maintainability are essential.