T
tshad
Kevin Spencer said:I didn't miss any point. Do you know the average length of time it takes
to develop a habit? 6 weeks. So, assuming that you've been working with
ASP.Net for more than 6 weeks, you've already developed some habits. Now,
let's say you graduate from working on tiny applications to something of
some size and scope. It will take you another 6 weeks to teach yourself to
do it right.
You're assuming that code-beside is a bad habit.
Based on your last post, I think you are mixing arguments OOP is not
Code-behind. You called it an extension. I don't agree here. It would
take you a little while, as you correctly state, to learn new methods. OOP
will take a while to learn. But the difference between Code-Behind vs
Code-Beside is minimal, at least as far as I can fathom (and I could be
wrong here). Based on what I have seen, you can take a Code-Beside page -
take out the script section move it to another page - add some attributes to
the Page definition - On the code-behind page add the Namespace and Class as
well as a few imports that the aspx page takes for granted as well as the
defining the objects on the aspx page (I am getting tired just thinking
about it).
Any code you want to reuse you would put in a class (which you could do -
and should do - in either case).
I don't see a bad habit here.
Earlier it was mentioned:
"Not using codebehind is ignoring one of the largest benefits of the dotNET
architecture"
I don't agree here, either. I think the largest benefits of the dotNET
architecture is the *separation* of code from design elements (which you
didn't have in asp). A code-beside page does have the separation
(completely) from the design. It just happens to be on the same page.
I've been programming for about 10 years now. This is not theory; it is my
experience. In my experience, more work in the short run always leads to
less work in the long run. Today is gone tomorrow. But tomorrow is always
just around the bend.
I have been doing it for many more years than that (so I probably do have
some bad habits). More work in the short run does NOT always lead to less
work in the long run.
My philosphy: If, when you are beginning, you develop and practice best
practices, you will not be beginning for long.
Programmers are a dime a dozen. Good programmers are rare. If you want to
make money, you have to distinguish yourself. Start early, and you'll
never be without a good-paying job.
Whether you use Code-behind vs Code-beside doesn't make a good programmer.
A good programmer, I guarentee you, can go from Code-beside to Code-behind
in no time at all. That doesn't mean he should.
Tom