Iris Classon
Iris Classon - In Love with Code

Stupid Question 61: Coding at the click of a button, go or no go?

[To celebrate my first year of programming I will ask a ‘stupid’ questions daily on my blog for a year, to make sure I learn at least 365 new things during my second year as a developer]

Coding at the click of a button, go or no go?

A couple of weeks ago I had a discussion with a senior developer about newbies/n00bs, since I started programming this has been my favorite subject and I love to hear advice, opinions and stories related to that. The programmer told me that he was annoyed that Microsoft made it so easy for programmers now a days, one could only drag and drop, and generate code at the click of a button.
This is very interesting. Complexity of systems has increased, and user expectations are bigger than ever, which demands more from the programmer. I can understand that a user interface for developers to work with, and wizards, is less frightening and for many more appealing. And it could, and probably does, attract more people to begin with programming. Awesome!
At the same time it worries me. Sometimes this abstraction adds ‘coincidental code’ / ‘accidental code’. And it removes an important learning process,- some of the time. An example would be App Inventor. This software lets you create Android applications without writing a single line of code. What’s great here is that it gets more people interested in programming, I love that! What worries me is the use of this for production apps, even LOB apps.
The code by clicking abstraction can be an even bigger problem when working with data and services, the problem being when the developer doesn’t understand what is happening in the background, where the code is generated, what it does and what the implications are. This probably also goes for frameworks and certain API’s. It will only save you time if you ‘get it’.
As for the ‘Microsoft making it too easy’-statement, I don’t agree, as with every good intent there will be misuse, but I think what is important is to make developers aware, and encourage them to go beyond the wizards.

My answer:

It’s a go to get started, but make sure you understand what is happening. Have a good look at the code generated, and look for surprises. Sometimes it’s really a no-go, ask experienced/senior developers when in doubt, or maybe ask nonetheless. And make sure you ask more than one person.

What do you think? Please share if you have some good/bad examples

Comments

Leave a comment below, or by email.
Fredrik Mörk
10/19/2012 2:24:39 AM
I am a very keen amateur photographer. Over the years I have seen the question "Which camera is best for a beginner?" being asked countless times in various forums. One very common answer is (bear in mind that this was in the pre-digital camera era): "Get a mechanical/manual camera and learn the basics about exposure. If you don't know the basics, you won't be a good photographer." While knowing what goes on under the hood is important, I can hardly imagine a more efficient way of killing a budding interest. The success rate with that approach is bound to be very low and, well, failing isn't that much fun, is it?

I'd say the same applies here. Wizard- and drag-drop-based development is a great way to get started, a beginner will get stuff up and running, get inspired by the results and hopefully filled with a desire to understand better how stuff works. Still, if you want to produce straight through high-quality software, you will need to know what goes on under the hood, and how to make the code better. That way, you will be able to write software without unnecessary overhead, that does what it is supposed to do, but not much more.

When it comes to using these tools for LOB applications, well, they may not produce the best software on the planet, but perhaps that is also not necessary all the time. When it comes to business, you will want the software that solves your problem in the most cost efficient manner. Sometimes that will be by hiring seriously skilled developers that produces stellar software, but sometimes a quick hack in a drap-drop IDE might just be sufficient.

As always, the hard part is to know the difference, and to know when to go which way. 
Andreas
10/19/2012 2:25:15 AM
I agree!
I'ts a really good way of getting you started, especially when you're introduced to new functionality in frameworks.
However we will continue to stumble upon people that will always take the shortest route to completion. I'm thinking of all the "Copy-Pasters" out there.
I used to work with a guy that whenever he came across a challenge scouted forums and simply copied the code he found straight into our production code without changes. 
We spent many hours fixing **** he implemented... 
Allwin Jeba
10/19/2012 2:28:32 AM
If you had programmed in c, c++ you will know how much pain it is to include each header files and start from the scratch! By "code on click of a button", I guess you mean auto generated code ?
But what needs to be understood is .NET lets you code even on a Notepad. You can write everything from scratch on a notepad. No one is stopping anyone! But!
Visual Studio is RAD Tool (Rapid Application Development) So yeah it makes sense to auto generate lots of code and Visual Studio does a good job at it! 
Regarding App Inventor maximum apps developed using such tools end up being a fart sound app anyways!
Debugging in Visual Studio is beautiful <3 try working with other software you will know the pain :) 
Michael Lund
10/19/2012 3:01:59 AM
Reply to: Fredrik Mörk
What Frederik said! Well put. 
Alastair
10/19/2012 3:11:56 AM
It was drag and drop tools that got me started, hooking up MS access databases to datasets using Dreamweaver's drag-and-drop tools. Seemed like magic for the first few sites I built, then I hit the "there-isn't-a-button-for-that" wall and actually had to switch to code view and learn what was going on. That led to hacking the generated code and ultimately onto writing my own Classic ASP data access code from scratch.

Some drag-and-crop tools make it easy to transition onto a more DIY approach however many don't. ASP.NET WebForms was one of the big offenders here, in my opinion, because there was such a conceptual leap between dragging a datasource/datagrid onto a page to writing your own code to modifying the default behaviours. Compared to the old dreamweaver code-gen, WebForms was more of a black box, more "magic". If you came from more procedural languages (Classic ASP, PHP etc.) then it was harder to see what was going on without understanding the full abstraction and often felt like doing simple things it was more complex than it needed to be. 
Ricardo Rodrigued
10/19/2012 3:13:16 AM
It's a good point, indeed it is. But if we think about it, code generation, at least in the .NET world (not only, look at JS with all its dialects), surrounds us. Who doesn't add a web/service reference, who doesn't create an entity framework edmx, even other cases..who looks at code generated by this? Very few people... 


Last modified on 2012-10-17

comments powered by Disqus