The short answer is a perhaps a functioning program that solves the problem it set out to. It is however unlikely for there to be a single correct solution. There are also many ways of measuring the quality of a solution; efficiency, elegance, maintainability, reusability, adherence to stylistic conventions and so on. Assessing something as un ambiguous as code can be very subjective. It is likely that these measurable features of the program will argue with each other and optimising for one will impact another.
Lets add a little more context. What is programming success for the aspiring novice programmer? In an educational context we are likely to assess or measure some of these things previously mentioned, correctness being at the top of the list and for good reasons. I wonder if we look broader than product (the executing code) and look at the process we can form a richer understanding of what leads to a successful programer.
I have observed and seek to explore three factors that impact programming success. 1) who you are working with, 2) what medium you are working with and 3) attributes of the product.
Groupings are likely to have a substantial impact on programming experience. You may aspire to be the loan geek hacking from you bedroom, work in pairs or as part of a group. Most of the teaching I do involves group work, this is often painful (for everyone) but in most cases students come to realise the importance being able to work with others. We have quite a mixed cohort so we are able to some extent to give students the experience of working with people of similar and different background eg computer scientists working with product designers. I’m interested in exploring to what extent working collaboratively across disciplines motivates programmers. Are the cultural differences between disciplines to large a barrier or is the opportunity to create a rich rounded artefact sufficiently interesting?
The medium you program with also undoubtedly has an impact on the programming experience. Are you working at the terminal, windows form, with 2D or 3D graphics or working with tangible artefacts. I have done some work with robots and school children and there is no denying they are a powerful motivator for a fairly wide range of students. The extent to which this is sugar coating tricky stuff or tangibility of abstract code is less straightforward. Lots of the tool to support introductory programming (Scratch, Greenfoot, Mindstomst etc) have a large spoonful of interesting context. I’m curious to what extent fundamental programming competencies (sequence, variables, decision, iteration) transfer to more conventional languages? Paradigm shifts are often painful for the expert let alone the novice is there evidence of benefit here beyond raw enthusiasm?
The final factor that will impact the programming ‘in the round’ are the attributes of the product. This could be thought of the as the “who cares question”. If the answer is the student because it has marks attached to it this is probably quite a shallow (yet powerful) motive. In several places in the courses I teach I have seen students get caught up in what they do, and deliver superb work. I think the following things are key. Cultural relevance or coolness: students will engage well in work they care about and has a genuine relationship with their life and that of their peers. Where possible I have found giving students a degree of ownership on the things they are making has had great results. Performability is also emerging as an important motivator in the teaching I do. This could be misinterpreted as Disneyficaiton where performance counts for more than content I don’t think this is the case. There is something much more genuine happening, if you look at the communities that have grown from Scratch, Greenfoot, Arduino and Processing sharing work is valuable for both creators and consumers. In addition to this, doing anything creative, which programming is, inspiration plays an important role. The web presents a huge step forward in making inspiration accessible and interactive.
There are undoubtedly cognitive factors that play a huge role in what your relationship with programming will be (if you have one at all!). Most of the things mentioned here have at there core motive, enthusiasm and essentially your emotional response to programming. To fully understand learning to programming we must consider both.