The Artima Developer Community
Sponsored Link

News & Ideas Forum (Closed for new topic posts)
Teaching Java the Extreme Way

3 replies on 1 page. Most recent reply: Nov 14, 2002 3:02 PM by Daniel Steinberg

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Teaching Java the Extreme Way Posted: Oct 17, 2002 3:39 PM
Reply to this message Reply
Advertisement
"Now that you're remembering back to your early days, perhaps you used to type in -- I mean, perhaps you knew people who would type in -- long passages of a program and then save and try to compile it. They spent a lot of time debugging the program. Maybe they put print statements here or there and commented out sections that weren't working, rather than use an actual debugger. In any case, they spent a lot of time trying to track down what usually amounted to little typos.

In extreme programming, you take very small steps. The goal is for the code to always compile, and for all of the tests to pass. We might write a couple of lines of code and then compile and run all of the tests. If something goes wrong, we have a good idea where to look for our mistake. Here's a pseudo-code explanation of how we might proceed with the current program," says Daniel Steinberg in this O'Reilly OnJava.com article:

http://www.onjava.com/pub/a/onjava/2002/10/09/javaxp2.html


Matt Gerrans

Posts: 1153
Nickname: matt
Registered: Feb, 2002

Re: Teaching Java the Extreme Way Posted: Oct 18, 2002 9:17 AM
Reply to this message Reply
I'm just responding to the intro above, because I haven't had time to read the full article, yet.

In the first few years that I learned programming I had the problems described (actually, it seemed that even typing in small amounts of code and trying to get them to compile was sometimes a mess, especially when there are lots of precompiler macros to contend with). However, after years of practice, I find that I can type in quite a lot of code and it will not only compile the first time, but actually work as intended (Wow!). This is largely due to experience, but might also have to do with the improved quality of programming languages and tools; in some cases, the tools can help even novice programmers to avoid compiler errors (but getting the intended resuls is another problem altogether!).

My point is that this commandment of XP may be more applicable to beginning programmers or experienced programmers who never improve ;-). Realistically, I think (for me) following this rule would just a hinderance and it would decrease my productivity.

Berco Beute

Posts: 72
Nickname: berco
Registered: Jan, 2002

Re: Teaching Java the Extreme Way Posted: Oct 28, 2002 11:13 AM
Reply to this message Reply
I must say I agree with Matt, the more experienced I become as a programmer, the more lines of code I can write without getting confused where a possible error sneaked in. XP seems very cumbersome to me, especially if you have to do a couple of things each time you compile (e.g. move some files).

Daniel Steinberg

Posts: 3
Nickname: daniel
Registered: Jan, 2002

Re: Teaching Java the Extreme Way Posted: Nov 14, 2002 3:02 PM
Reply to this message Reply
I'm not sure I understand this argument that you two are making. You've never tried this method but you're sure it won't work or doesn't apply to you. I'm also not sure how the compiler gives you any assurance of correctness. The compiler tells you that what you've done is legal -- it doesn't tell you that what you've done is what you intended to do.

Getting code to compile is a minimal requirement. Test first combines two important thoughts. First, your code is well tested. This means that you have confidence that it does what you think it does. A compiler can't do that for you. This also protects you against later changes that you or someone else makes in your code. If you have a comprehensive set of Unit tests then your code can be changed without fear because you know that you haven't broken any thing. If you never go back and revise your code, then I suppose this isn't a consideration.

Second, the code you write will be cleaner. This is why I so strongly endorse test first programming. It really changed the quality of my code. I wasn't writing wandering unnecessary code. My code was clear, less coupled, and more highly cohesive. If you've never tried it, do it. But really do it . Most of the people who question XP end up half doing a practice or the entire methodology and then complain that it isn't all that it's cracked up to be.

Matt and Bill, when you were writing your testing framework, did you write it test first?

D

Flat View: This topic has 3 replies on 1 page
Topic: Evolutionary Design Previous Topic   Next Topic Topic: Tomcat and Apache Living Together, Mass Hysteria

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use