views:

196

answers:

4

Wizards can kick-start features. They can also obfuscate your code, and are anti-YAGNI.

On balance, do you think Wizards are more useful or more harmful?

+1  A: 

They're there for a reason - to try and make your life easier. They can be useful and save you 5 or 10 minutes of typing. Of course it's best to read and make sure you understand what they've written for you.

If you use them without understanding, then they could be considered harmful in the fact that they're letting you get away with not learning something you should probably know, but on balance I think they're a good thing.

Greg
+5  A: 

They are more useful than harmful if and only if you understand the code they generate. Only after you mastered the problem the wizard is trying to solve they are really useful. Otherwise you'll hit walls later in the project, because the generated code will need modifications at some point.

"The Law of Leaky Abstractions" really nails it on the head.

maayank
+1  A: 

Wizards are "mostly harmless" when they generate an encapsulated entity - a function, a class or a set of classes - which you don't need to modify and which you interact with through a well-defined, well-designed interface.

On the other end of the spectrum is a wizard that that generates skeleton code that needs to be extended and modified. This is especially troublesome if you can't change some of the wizard option later without losing your edits.

These are still "ok" for the pro who could write the same code by himself and uses the wizard to save time. However, when they are used to make something complicated look easy for beginners, they are a paint job over a rusty car: they help selling something that you otherwise wouldn't buy.

In practice, they may still be useful to ease adoption of a platform. But that's a business aspect, and whether business aspects may justify code blunders is a question of the development environment.

peterchen
+2  A: 

Wizards are good if and only if you can get away with never editing the code that they generate. In that situation, they are in essence a very high level programming language. When you change your mind about something that was generated by the wizard, you can run the wizard again.

Wizards are most horribly evil if you must ever edit the code that they generate. If you do this, and later change your mind about one of the choices that you made in the wizard, then you are forced to choose between two very bad options. You can rerun the wizard, and reapply the manual edits, or you can try to edit the multiple copies of the boilerplate code that the wizard created the first time around. In the former case, you are likely to forget at least one of your edits, and in the latter case, you are likely to miss at least one of the places in the code that was affected by your choice at wizard running time.

Glomek