views:

428

answers:

13

A few days ago, I read a question asking how many developers hand code their HTML/XHTML rather than rely on the WYSIWYG tools - http://stackoverflow.com/questions/406052/do-most-web-programmers-not-designers-use-wysiwyg-editors-or-hand-code-their

I tend to lean towards designing ASP.NET server controls rather than User Controls for use in my code. I do this so that I can reuse them by drag and drop into WYSIWYG and just set the few pertinent properties. This does cost a little extra in time designing the components, but simplifies things a lot when I come to using them in larger applications.

After having read that most developers seem to hand code rather than use WYSIWYG, it leads me to wonder: Am I wasting my time developing components this way?

Edit: To clarify - mostly, the original intent has been that these controls are for my own use. However, there have been a number of occasions when they could be useful for the rest of my team or potentially for public release. However, like most things, I tend to see the huge potential extra value provided by comparatively little extra work regardless of the probability that the extra value will be realized.

+5  A: 

No, you are not wasting your time. Your potential user base will be larger if WYSIWYG users can easily use your components. If you are the only user of these components design them so they fit your development style. If you design visually then it makes sense to have WYSIWYG support.

Jeremy
+1  A: 

If you are more comfortable with your work in the WYSIWYG editor and developing server components makes your job easier, then I don't see why you should attempt to conform to other developers methods if what you do works for you.

TheTXI
+4  A: 

You could create a UserControl and using different techniques get it compile into a dll that can then be referenced by your web applications:

Overview of some methods: http://geekswithblogs.net/dotnetrodent/archive/2006/06/16/82136.aspx

Detailed method: http://webproject.scottgu.com/CSharp/UserControls/UserControls.aspx

I never use the WYSIWYG tools cause it never trully is WYSIWYG once you facter javascript, and CSS and other things. (I know VS2008 got better but not perfect). And the designers are always sooo slow. I prefer to code using markup.

If your developing a commercial component that you intend to sell you should spend the time on having the most complete feature set IMHO. Including WYSIWYG. If your building components so that your or your team can use them, then you should evaluate the cost benefit of the time it takes to get your components that extra step.

JoshBerke
+1 Great references that I've not come across before. I'd never considered this option since User Controls never seem to display properly in the WYSIWYG once you factor in the behind the scenes craziness like dynamic data display...
BenAlabaster
i try to avoid user controls like the plague
Shawn Simon
I have some fairly complex pages 7 tabs each with grids and all sorts of functionality. We broke it down into user controls to allow multiple to work on it at same time, and more importantly minimize what you have to think abotu when working on it. Then we were able to make three tabs use one ctrl:)
JoshBerke
@Shawn - So what do you use for code reuse? Cut and paste?
BenAlabaster
+2  A: 

I think you're not wasting your time, especially if you want to release these controls for other developers to use. If the effort required is truly "a little extra" and you find it helps you in larger projects I think your controls are improved by being WYSIWYG tool compatible.

Personally, I generally hand code HTML/XHTML but I like using WYSIWYG functionality on occasion. I've always found that controls that were WYSIWYG friendly were easier to use than controls that relied on all code being written manually.

Esteban Brenes
A: 

I would agree with the previous posts. I don't think you are wasting your time. Making your control WYSIWYG enabled allow users to do things both ways, threw the designer and threw code. Also some times it is easier to discover what a control does when you use the property editor, apposed to making your changes in code and then compiling and running the app.

Ron Todosichuk
A: 

When I started to program I loved WYSIWYG and used it for almost everything.

I started to code html by necessity, there was always something that i just coul not get right using just the WYSIWYG editor. Has time passed i realised that it was faster for me to simply right the html than using the mouse to set the properties, so as time passed i used more and more html until no more WYSIWYG editors for me.

Why did i tell you this story? because my personal experience tells me that a beginner programmer will love WYSIWYG and your efforts to make server controls and a advanced programmer wont give you any credit for it.

My opinion is that you should do as you prefer. If you do this way to please others, don't bother to if there is no beginner programmer on your team.

That's my 5 cents ;)

Sergio
What about future programmers that may be maintaining the applications I develop? While there is no beginner programmer on the team now, it doesn't mean there won't be next week...
BenAlabaster
I doubt you could rebuild the html generated by the wizard control on your own. Or the calendard control, for that matter, though I really hate the calendar.
Joel Coehoorn
@joel - and how did we make them before asp.net then?
annakata
@Joel - I'm sure there are many smarter people than me working on those controls, and I'm not looking at rebuild the wheel here - unless it assists with my own personal growth. I'm talking about extension or compositing other controls or writing non-existent ones where necessary.
BenAlabaster
Any type of control, as much complex as it can be, a programmer will end up copy/pasting from an existing one and changing as he needs, that's what i do. And if i use a complex control frequently, i end up creating a scriptlet so i don't have to search for it ;)
Sergio
+1  A: 

For your own use you already know if you are wasting your time or not.

[me enters karma-bomb shelter]

For the public and the rest of your team I'm going to offer an opinion against the flow that you probably are... well not wasting your time, but possibly not making the best use of it.

I think very few web developers will take WYSIWYG offerings seriously, however if the majority can use your controls at a hand code level and the minority can do their drag and dropping then you've provided the benefit of choice which is never an outright bad thing. Except possibly where small children and good behaviour are concerned.

annakata
When you say "won't take seriously" - what about something like a GridView where it's far easier to drag and drop and set the basic params than hand code the whole thing. Surely it's easier to drag/drop, configure and then hand stroke the resulting markup?
BenAlabaster
@balabaster: GridView's one of the examples of a control with the most drawbacks. By default, Microsoft doesn't render those elements in a way you can easily style on them, for example. Although, that's why Control Adapters exist.
John Dunagan
Which are reasons one and two why I don't like ASP.Net as a templating language.
annakata
+1  A: 

I think you have to take that poll with a grain of salt. Just because most people on Stack Overflow say they hand-code their HTML doesn't mean that most web developers do. Tools like Dreamweaver and Microsoft Frontpage are highly popular tools, for instance, mainly because of their WYSIWYG features. Web hosting companies usually have WYSIWYG web page builders that are also highly popular. I hand-code most of my stuff too, but I do a lot of freelance work working with web developers from other companies around the world, and from my personal experience I would probably go so far as to say that most web developers DO use WYSIWYG tools. The more experienced a web developer is, the less likely they are to use a WYSIWYG tool, but those with less experience far outnumber those with a lot of experience.

Gerald
Think you commented the wrong post :P
Gerald
LOL - Thanks, fixed...
BenAlabaster
+1  A: 

You might pose the question, to yourself, "are other developers wasting their time hand coding controls?".

I'd typically just drag and drop controls on a page and alter the generated html when needed, if it's only used on one page. If the control and it's functionality are used on more than one page in the same web app, then I'd go to a user control. When it's going definitely going to be used across apps, then I only want to code once so I go to a server control I can easily distribute. I think the key is that it (the layout and functionality) are being used in multiple places, or you're about to use it in multiple places. It's just as much a "mistake" to have duplicate code in many places as it is to have spent more time developing reusable code for one use. Plus, it's software, so you can change it later!

MikeH
BenAlabaster
+1  A: 

I think your real question probably is, "is there a way to develop my UI that I should learn more about, because it might be better than the way I'm doing it now?"

Considering how fast things are changing, that's a question we are all asking pretty frequently. I reember the first time I saw sites that were developed with Ruby on Rails; and then I ran through a tutorial that had no step for wysiwyging; but everything was accomplished with CSS and themes; and it hit me that maybe Dreamweaver isn't the most productive environment for everything, and the result could be at least equally attractive.

Working through the MVC tutorials gave me the same jolt.

So I think it's at least worth trying the alternatives to make an intelligent decision about what works best for me, my skills, and my requirements. I want the best tools in my toolkit, even if I don't need them for every project.

Especially since you seem to appreciate that your current approach is taking a substantial amount of your time.

le dorfier
A: 

I think I would create the control if it's used in many places. Even you hand code the html, it still saves time, and simplify the work. but I agree that hand-coding html/css is more efficient, WYSIWYG web page builders don't support this very well.

Estelle
+1  A: 

I would say that if it is indeed only a little extra work and it adds so much extra value it's hard to conceive it could be a waste of time. Users coming in behind you that look to use your components in future will find it a lot easier and will be saving a lot of time that would otherwise be spent coding by hand. Not to mention that if you can drag and drop a component with a mouse click and drag, then why waste the keystrokes?

BobTheBuilder
+1  A: 

Like everything else, the appropriate answer is 'it depends' ...

You have to measure the ROI of adding this functionality.

For the 'I'; Personally, I've never created a web control that would work for a wysiwyg editor, so I don't know how much of effort it is.

For the 'R'; If you work on a large development team, distribute your code, will reuse these controls yourself in a wysiwyg editor, or even just want the experience, then you will definitely get your return. But if doing this is based on future maintainence programmers; you may be leaning a bit into the over optimization side. (IMHO)

John MacIntyre