Fog Creek Software
Discussion Board

Programming for the rest of us

Hi Joel,

I seem to remember that you were once involved in developing the strategy for macros in Excel.  It seems to me that in their current incarnation, macros are a rather feeble tool for the average user.  The most a novice/intermediate user can do is record a sequence of actions and convert it to one macro.  Not actually that useful.

How hard would it be to create some simple macro templates that also built in basic programming ideas such as loops, cases, etc?

E.g. it would be great if a novice could easily create a macro such as:

"Throughout this document whenever you find a particular word or delimiter do action 'x'"

Why was this basic idea never built into the macro strategy? It seems that macros are only use to those with a conventional programming background.

How about programming for the rest of us?


Monday, February 23, 2004

Nobody has ever been successful at making a programming environment for non-programmers, because non-programmers just don't think in terms of "how can I solve this problem by programming." I have thought long and hard about this and firmly believe that there is just no audience that would take advantage of such an environment. The very concept of a "loop" that you mentioned above is a concept that is not a familiar one to a non-programmer, and no amount of simplification and wizards and icons will overcome that.

There have been attempts to create dumbed-down prettied-up simplified programming environments for non-programmers but the truth is that the non-programmers just won't use them, and meanwhile the gui cruft is just annoying to the real programmers who DO try to code macros, who are better served by a traditional programming environment with all its flexibility.

That said the original design of VBA is full of features which were designed to make it easy to use for novice or part-time programmers, for example:

* the script recorder records comments, so you can learn from the script that is generated
* the object model is designed so that everything that can be done with pointers (actually VBA references) can also be done with "index variables" instead which most people find easier to comprehend than references
* the language defaults everything to variants so that a variable is just a "box you store things in"; you don't have to learn anything about data types to create a macro successfully.

I think you get much more benefit out of focusing on ease of use for lightweight, part time programmers or people who once learned BASIC in school, rather than focusing on the complete non-programmers, who, no matter how optimistic you may be, are never going to write a program.

Joel Spolsky
Fog Creek Software
Monday, February 23, 2004

How about the Rules-wizard in Outlook? That's always seemed to me like programming for non-programmers... Must have been a pain to make though.

Monday, February 23, 2004

There's a contiuum with "configuration/settings" at one end and "programming" on the other end.

Basically I would be forced to say that since the Rules Wizard is not Turing-equivalent, it's not programming :) Nor does it have loops or variables; although it does sort of have variables they can't be used to maintain state.

Joel Spolsky
Fog Creek Software
Monday, February 23, 2004

The wizards for Neverwinter Nights are about as close as I've seen to programming for non-programmers.

And honestly, I don't think many folks understood the structure enough to use the wizards if they weren't already a novice programmer.

Fred M. Napier
Monday, February 23, 2004

I do think the macro facility in Office is probably as close as you are going to get to programming for "everyone". 
To me, the hardest thing about getting something useful out of a point and click macro is the fact that all of your cell references are faithfully transcribed. I wish clippy or someone would notice that you are summing  the end of a column and offer to sum wherever the column ends up from now on. 

Michael Joyner
Tuesday, February 24, 2004

The programming gene seems to be very specific.

I reckon it is capability to deal with indirection that is the determining factor

real thing -> variable = programmer or not programmer

variable -> variable = able to actually write something useful

variable -> pointer = could be a good programmer

pointer -> pointer = could be a professional programmer

I suppose instead of pointers you could substitute classes or some kind of ADT.

Loops, data structures etc. all seem to depend on this basic understanding.

Tuesday, February 24, 2004

Triggers in StarCraft maps.

Tuesday, February 24, 2004

I actually like the Excel 'Record Macro' feature.  When I don't know how to code something in VBA for Excel, I usually record a Macro.

I then read the Macro, say 'Aha!  That's what Excel calls that!".  Then I code my loops around what Excel has done.

The only negative here is that some parts of the Excel programming model are not very well documented, so I still need the right books to tell me how to find the magic incantation for the last row used, last column used, etc. 

Tuesday, February 24, 2004

Hey, at the top of this thread I thought 'rules wizard in outlook' and then I saw it already mentioned..

VBA in Excel is great.  A rules wizard that generated VBA might be very very useful.  I would especially like to be able to use a rules wizard to see the resulting VBA underneath, even if doing so cost me the ability to go continue editing it in the rules wizard.

i like i
Wednesday, February 25, 2004

*  Recent Topics

*  Fog Creek Home