Wizards vs. code samples?

As many of you are probably aware, my team (DevTech) is involved in a number of activities around the APIs to Autodesk products: we talk about them at conferences and seminars (what we tend to call "evangelism"), we provide API training, support & consulting, and we also develop content to publish via blogs and the Autodesk Developer Network website.

One activity of which people may not be aware is the work we do around development tools: one very good example is the ObjectARX Wizard that ships on the ObjectARX SDK and helps C++ developers build applications and use various ObjectARX APIs from them. We also develop a few other tools and utilities, but wizards are usually the most complex of them (especially the one for ObjectARX).

Now on to my somewhat philosophical question... I'm curious whether wizards have the same relevance for .NET languages, where you have - at least in theory - simpler programming languages to master, better built-in tool support (Intellisense, etc.) and better online resources to help you find pre-existing solutions to problems.

Here's my basic question: given a limited pool of resources (i.e. we can't do everything) and the fact we have to choose between two activities, would you prefer to have us focus our efforts on a) building a wizard (or wizards) to help develop .NET code (which for us would mean using the .NET APIs to AutoCAD, in this particular example), or b) creating more samples and code snippets that demonstrate how to use the various .NET APIs? It's clear that these activities don't necessarily have to be mutually exclusive, but asking the question in this way should help to see whether people have a particular preference.

My suspicion is that while wizards are great for implementing code where you want to be shielded from the complexity (think MFC & ObjectARX), extensive code samples are of more use to people developing with "simpler" programming technology where it's easier to copy/paste and modify code that already exists. While it's clear I have some bias around this subject - let's face it, I spend a fair amount of time creating code samples to publish via this blog 🙂 - I also don't want to sway people... hopefully we'll see a range of opinions from people that will help my team prioritise its efforts in this area. Another risk is that people visiting this blog might well have some bias towards using code samples, of course, but I can't really see how it's possible to adjust for that... 🙂

So, if you have an opinion on this subject, please post a comment on this page and/or cast your vote via the poll I've added to the left-hand sash, below the "Autodesk Blogs" list. If you don't see a poll there in the left-sash, the chances are you're reading this post at some point in the future when I've chosen to remove it. if the poll is still open, you should also be able to access it from here.

21 responses to “Wizards vs. code samples?”

  1. Hi Kean,

    I vote for code samples. I trust no wizard, never!

    Cheers, Jeremy.

  2. Code samples & snippets (more flexible then wizard)

  3. I vote for code samples

  4. Code samples & snippets. Your wizards probably wouldn't work for the visual studio express editions anyways 😛

  5. Why not incorporate the samples into a wizard? What do you want to do today?
    --> With user-interaction
    -> pick a point
    ->pick a element
    --> Modify selected elements
    -> add a paramter
    -> change dimension

    and so forth and so on, at the end I have a skeleton for my application with all code-samples I need.

  6. I vote for Code Snippets

  7. I vote for code samples, but then again I have no idea what a wizard is.

  8. Being a complete beginner myself, and I don't know what a wizard is either, code samples (snippets?) would be great. After all it's your code samples in this blog that have helped me learn the little I know about VB.NET. I have a limited time to complete my project so mastering ObjectARX, .NET, VB, and all those other acronyms just isn't in the cards. Cut and pastes from code samples so I have something to show, then I can go back and learn the details to take it to the next level. I know, not the way it should be done...

  9. Kean,
    I would have to go along with the majority here and vote for Samples (snippets) as well.

    Its the easiest way to go from a blinking cursor/blank page to something that resembles an application.

    Besides, theoretically, you could create samples a lot quicker than you would a wizard.

  10. I think the reason that Wizards aren't terribly useful in managed languages is mainly due to the ease with which Visual Studio allows you to turn an existing project into a template, which may contain commonly-used code.

    For example, I start with one of several project templates, each of which referencs the AutoCAD assemblies I need, and my own commonly-used shared assemblies.

    Most of my project templates also come with a class template that implements IExtensionApplication, and another for command methods as well, all with the needed attributes already defined.

  11. Slighty bias from Kean! 😉 I personally love the idea of a wizard from you guys, but as long as it is focused on tasks that I do often, including complex tasks like say...

    So for those who don't know, a wizard is a tool which plugs into Visual Studio which aids tasks which are generally repetitive or complex.

    Tommy

  12. I think a new project wizard is an absolute necessity for *any* language. Beyond that I agree that, for the .NET languages at least, code samples and snippets are probably more useful to the average programmer.

  13. Code samples definitely. Wizards can be good in some specific case but I find samples are better for multiple cases. I've also had wizards fail to many times when the development environments don't completely math up.

  14. The wizards are great to knock up a quick ARX project and add a couple of commands - but after that, samples are king!

  15. Code Samples. How much .NET code do you have to write to get a command up and running? Not much, the trickiest part is getting all the references correct (Copy local = false). IIRC, ObjectARX is far more complex than that.

    I wouldn't mind some Autodesk snippets from my right click menu.. Insert Snippet > Autodesk > Decorate function as command ([ComamndMethod]). Putting Best Practice code in there helps everyone write quality code quicker.

    That plus the .NET programmers guide and associated help files would be nice.

  16. I vote for a very simple wizard that references the 2 .NET APIs and connects the VS help system to the AutoCAD .NET help files.

    Other than that, code samples are king.

    Thanks for the blog,
    -Danny

  17. Snippets! I prefer to see how the potion is made rather than having it made for me.

  18. J. Daniel Smith Avatar
    J. Daniel Smith

    Here's a "push the envelope" thought: every time you write a code sample (or wizard, for that matter), ask "should there be something to support this in the API?"

    Much of the current .NET API is largely a (thin) managed wrapper over ObjectARX; there isn't a lot of additional functionality. Much of the "goodness" comes from simply using .NET, not the .NET API itself.

    Code samples are the most primitive form of code reuse: cut-and-paste. Abstracting those ideas into an API could provide a lot of long term value.

  19. I would have to vote for samples and code snippets as being more useful. I can integrate those into my coding style more easily than wizards. I also like the idea of a high level API for the .NET managed classes. I am developing something simialr to this so our design engineers who are familiar with VBA can use a ThisDrawing.Poroperty or ThisDrawing.Method() API within .NET. This will be particularly useful when moving between 32 bit and 64 bit environments.

  20. Hello Kean,

    Code samples are more useful than wizards. But wizards could be helpful sometimes. I can suggest one more thing : helper libraries.

  21. Cyrille Fauvel Avatar

    To my opinion there is no good answer to that question 😉 Both address a different need and target a different audience. Wizards are mainly for beginners and used for repetitive tasks by advanced programmers.
    - Wizards for beginners because using a code snippet from someone else in a different context may not work as is and cause more disatisfaction than it helps. Beginners want to learn, not to fight with project settings and context to get something to work.
    - Wizards for repetitive tasks for more advanced programmers, because people are lazy and as long they know what wizards are doing it simplify coding and save time.
    - Code snippet for everything else because no wizards ever will be able to demonstrate everything. Wizards are there for basic and repetitive things. They aren't for showning how to use one API or another.
    - That reminds me the fight between Linux fan and Windows user about configuration Wizards. The discussion was would Microsoft be able to create Wizards for every possible configurable option in Windows. The answer is no even if they did a lot. It is the same here 😉

    So my vote is both with a good understanding where should be the limit for the Wizards.

Leave a Reply to Christopher Cancel reply

Your email address will not be published. Required fields are marked *