¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

"I think the community needs more explicit direction...."


 

I would like to amplify Avi's comment below.

I have noticed something when programmers try to practise TDD: they don't seem to learn how to refactor. I don't mean to state this so harshly, but it seems that they struggle a lot more with refactoring than I did when I started. I have this feeling that "we" learned relatively quickly compared to what I see, even comparing myself programming in Java in 1999-2002 to today's programmer also working with Java. And today's Java programmers have better libraries and better tools! They use IDEA and Vavr, but I had Eclipse and plain Java. :)

I'd like to know your impressions. Which kinds of problems do people have when they try to learn how to refactor? When they learn how to guide a design to evolve? Why does it seem like they have more difficulty learning this than "we" had?

I admit that I probably have some strong cognitive distortion. That's why I'm asking this question.

Cheers,
--
J. B. (Joe) Rainsberger :: :: ::

---------- Forwarded message ---------
From: Avi Kessner <akessner@...>
Date: Thu, Nov 14, 2019 at 5:05 AM
Subject: Re: [testdrivendevelopment] We are back on the air!
To: <[email protected]>


Is this the diagram you wanted to share?



I would recommend making a box which is part of the flow rather than some external dotted lines. For example, maybe the box should read, " Apply SOLID principles" as part of the refactoring, and then before the next failing test have something like, "design the contract"

I think the community needs more explicit direction on the design being done in those phases.

On Wed, Nov 13, 2019, 16:44 J. B. Rainsberger <jbrains762@...> wrote:
On Tue, Nov 12, 2019 at 11:27 AM Roy Osherove <roy@...> wrote:
?
Awesome.? I sent a new thread to the group about tdd diagrams.? Was it received?

Maybe.

If you sent it to the Yahoo! group, then no.

Please try again--at least until we figure out the transition. :) I want to see it!
--
J. B. (Joe) Rainsberger :: :: ::



 

Good, realistic examples are likely more helpful that explicit?instructions.? Different tactics, strategies and principles are more useful in different?contexts for teams with different skills, experience and levels of sophistication.


On Sat, Nov 23, 2019 at 11:33 AM J. B. Rainsberger <jbrains762@...> wrote:
I would like to amplify Avi's comment below.

I have noticed something when programmers try to practise TDD: they don't seem to learn how to refactor. I don't mean to state this so harshly, but it seems that they struggle a lot more with refactoring than I did when I started. I have this feeling that "we" learned relatively quickly compared to what I see, even comparing myself programming in Java in 1999-2002 to today's programmer also working with Java. And today's Java programmers have better libraries and better tools! They use IDEA and Vavr, but I had Eclipse and plain Java. :)

I'd like to know your impressions. Which kinds of problems do people have when they try to learn how to refactor? When they learn how to guide a design to evolve? Why does it seem like they have more difficulty learning this than "we" had?

I admit that I probably have some strong cognitive distortion. That's why I'm asking this question.

Cheers,
--
J. B. (Joe) Rainsberger :: :: ::

---------- Forwarded message ---------
From: Avi Kessner <akessner@...>
Date: Thu, Nov 14, 2019 at 5:05 AM
Subject: Re: [testdrivendevelopment] We are back on the air!
To: <[email protected]>


Is this the diagram you wanted to share?



I would recommend making a box which is part of the flow rather than some external dotted lines. For example, maybe the box should read, " Apply SOLID principles" as part of the refactoring, and then before the next failing test have something like, "design the contract"

I think the community needs more explicit direction on the design being done in those phases.

On Wed, Nov 13, 2019, 16:44 J. B. Rainsberger <jbrains762@...> wrote:
On Tue, Nov 12, 2019 at 11:27 AM Roy Osherove <roy@...> wrote:
?
Awesome.? I sent a new thread to the group about tdd diagrams.? Was it received?

Maybe.

If you sent it to the Yahoo! group, then no.

Please try again--at least until we figure out the transition. :) I want to see it!
--
J. B. (Joe) Rainsberger :: :: ::



 

On Sat, Nov 23, 2019 at 7:45 PM Steve Gordon <sgordonphd@...> wrote:
?
Good, realistic examples are likely more helpful that explicit?instructions.? Different tactics, strategies and principles are more useful in different?contexts for teams with different skills, experience and levels of sophistication.

Yes. I don't know how to get my hands on good, realistic examples, because they are typically confidential material. I don't have the energy to spend months finding and refining good, realistic examples by scouring open source projects. What do other people do?

I encourage students to use their projects as good, realistic examples, but then participate in groups like this one where they can ask questions when they encounter situations that they don't feel comfortable resolving on their own.
--
J. B. (Joe) Rainsberger :: :: ::


 

Hi all,

Spontaneously I would guess there is a difference in experience between us trying to learn TDD with 5-10 years or more of programming experience and loads of examples of why it was necessary, compared to people learning it today that (I hope) learn it earlier since TDD is not really new any more. I would also guess/hope that TDD now reach a broader range of people than those actively searching for ways to improve.

Regards,
//Samuel

On 2019-11-23 19:32, J. B. Rainsberger wrote:
I would like to amplify Avi's comment below.
I have noticed something when programmers try to practise TDD: they don't seem to learn how to refactor. I don't mean to state this so harshly, but it seems that they struggle a lot more with refactoring than I did when I started. I have this feeling that "we" learned relatively quickly compared to what I see, even comparing myself programming in Java in 1999-2002 to today's programmer also working with Java. And today's Java programmers have better libraries and better tools! They use IDEA and Vavr, but I had Eclipse and plain Java. :)
I'd like to know your impressions. Which kinds of problems do people have when they try to learn how to refactor? When they learn how to guide a design to evolve? Why does it seem like they have more difficulty learning this than "we" had?
I admit that I probably have some strong cognitive distortion. That's why I'm asking this question.
Cheers,
--
J. B. (Joe) Rainsberger :: :: ::
---------- Forwarded message ---------
From: *Avi Kessner* <akessner@... <mailto:akessner@...>>
Date: Thu, Nov 14, 2019 at 5:05 AM
Subject: Re: [testdrivendevelopment] We are back on the air!
To: <[email protected] <mailto:[email protected]>>
Is this the diagram you wanted to share?

I would recommend making a box which is part of the flow rather than some external dotted lines. For example, maybe the box should read, " Apply SOLID principles" as part of the refactoring, and then before the next failing test have something like, "design the contract"
I think the community needs more explicit direction on the design being done in those phases.
On Wed, Nov 13, 2019, 16:44 J. B. Rainsberger <jbrains762@... <mailto:jbrains762@...>> wrote:
On Tue, Nov 12, 2019 at 11:27 AM Roy Osherove <roy@...
<mailto:roy@...>> wrote:
Awesome.? I sent a new thread to the group about tdd diagrams. Was it received?
Maybe.
If you sent it to the Yahoo! group, then no.
Please try again--at least until we figure out the transition. :) I
want to see it!
--
J. B. (Joe) Rainsberger :: ::
::


 

The other problem is there is a megaton of lip service done to TDD.
You¡¯ll even have working tests. They make some framework change that breaks the tests, and they stop running them, or ¡°crunch time¡± comes, and management says ¡°I don¡¯t care if it takes longer next quarter, you need to get the following done for the end of the month¡±
Place after place I¡¯ve been in has a small to mid sized collection of tests, that are either not maintained, not run, or not added to, and when you do start adding, management complains.
I¡¯ve never been to a place that does more than pay lip service

--
73 de KG2V
Charlie

On Nov 24, 2019, at 4:00 PM, Samuel ]slund <samuel@...> wrote:

?Hi all,

Spontaneously I would guess there is a difference in experience between us trying to learn TDD with 5-10 years or more of programming experience and loads of examples of why it was necessary, compared to people learning it today that (I hope) learn it earlier since TDD is not really new any more. I would also guess/hope that TDD now reach a broader range of people than those actively searching for ways to improve.

Regards,
//Samuel


 

On Sun, Nov 24, 2019 at 1:40 PM Charles Gallo <Charlie@...> wrote:

Place after place I¡¯ve been in has a small to mid sized collection of tests, that are either not maintained, not run, or not added to, and when you do start adding, management complains.
I¡¯ve never been to a place that does more than pay lip service
Ouch, that sucks. I'm part of a smallish team, but we deploy via CI/CD
and if any of the test suite, code coverage minimum, linter, or typespec
checker fails, it doesn't go out.

We reject PRs for not having adequate tests, and recognize people
for expanding coverage of existing code.

My condolences on your past employment situations :-)

--
Hassan Schroeder ------------------------ hassan.schroeder@...
twitter: @hassan
Consulting Availability : Silicon Valley or remote


 

I yeah refactoring a lot, and I think practice helps (shocking, I know). I include it in my workshops as well as in free resources on my github (). I also have three different Pluralsight courses on refactoring, including the monster 8 hour course Refactoring Fundamentals. Anyone can access these with a trial account and most enterprise shops I talk to have subscriptions for their folks.

But to JB¡¯s point, I do think it¡¯s a part of TDD that newer devs lack confidence and probably skill to perform, at least until they gain experience with it.

Steve

On Nov 24, 2019, at 17:14, Hassan Schroeder <hassan.schroeder@...> wrote:

?On Sun, Nov 24, 2019 at 1:40 PM Charles Gallo <Charlie@...> wrote:

Place after place I¡¯ve been in has a small to mid sized collection of tests, that are either not maintained, not run, or not added to, and when you do start adding, management complains.
I¡¯ve never been to a place that does more than pay lip service
Ouch, that sucks. I'm part of a smallish team, but we deploy via CI/CD
and if any of the test suite, code coverage minimum, linter, or typespec
checker fails, it doesn't go out.

We reject PRs for not having adequate tests, and recognize people
for expanding coverage of existing code.

My condolences on your past employment situations :-)

--
Hassan Schroeder ------------------------ hassan.schroeder@...
twitter: @hassan
Consulting Availability : Silicon Valley or remote



 

Autocorrect: yeah->teach

On Nov 24, 2019, at 19:48, Steven Smith via Groups.Io <ssmith.lists@...> wrote:

?I yeah refactoring a lot, and I think practice helps (shocking, I know). I include it in my workshops as well as in free resources on my github (). I also have three different Pluralsight courses on refactoring, including the monster 8 hour course Refactoring Fundamentals. Anyone can access these with a trial account and most enterprise shops I talk to have subscriptions for their folks.

But to JB¡¯s point, I do think it¡¯s a part of TDD that newer devs lack confidence and probably skill to perform, at least until they gain experience with it.

Steve
On Nov 24, 2019, at 17:14, Hassan Schroeder <hassan.schroeder@...> wrote:

?On Sun, Nov 24, 2019 at 1:40 PM Charles Gallo <Charlie@...> wrote:

Place after place I¡¯ve been in has a small to mid sized collection of tests, that are either not maintained, not run, or not added to, and when you do start adding, management complains.
I¡¯ve never been to a place that does more than pay lip service
Ouch, that sucks. I'm part of a smallish team, but we deploy via CI/CD
and if any of the test suite, code coverage minimum, linter, or typespec
checker fails, it doesn't go out.

We reject PRs for not having adequate tests, and recognize people
for expanding coverage of existing code.

My condolences on your past employment situations :-)

--
Hassan Schroeder ------------------------ hassan.schroeder@...
twitter: @hassan
Consulting Availability : Silicon Valley or remote




 

Last place I was at ¡°we can¡¯t touch anything in X library, because too much depends on it, and it might break¡±

Of course the way to fix about 50% of their problems was to add methods to the classes there. The whole system structure had a serious case of Class Envy with 4-5 classes in that library, but ¡°too risky¡±
Oh well, I¡¯m on the beach, so not my Monkey anymore

--
73 de KG2V
Charlie

On Nov 24, 2019, at 7:49 PM, Steven Smith <ssmith.lists@...> wrote:

?I yeah refactoring a lot, and I think practice helps (shocking, I know). I include it in my workshops as well as in free resources on my github (). I also have three different Pluralsight courses on refactoring, including the monster 8 hour course Refactoring Fundamentals. Anyone can access these with a trial account and most enterprise shops I talk to have subscriptions for their folks.

But to JB¡¯s point, I do think it¡¯s a part of TDD that newer devs lack confidence and probably skill to perform, at least until they gain experience with it.

Steve
On Nov 24, 2019, at 17:14, Hassan Schroeder <hassan.schroeder@...> wrote:

?On Sun, Nov 24, 2019 at 1:40 PM Charles Gallo <Charlie@...> wrote:

Place after place I¡¯ve been in has a small to mid sized collection of tests, that are either not maintained, not run, or not added to, and when you do start adding, management complains.
I¡¯ve never been to a place that does more than pay lip service
Ouch, that sucks. I'm part of a smallish team, but we deploy via CI/CD
and if any of the test suite, code coverage minimum, linter, or typespec
checker fails, it doesn't go out.

We reject PRs for not having adequate tests, and recognize people
for expanding coverage of existing code.

My condolences on your past employment situations :-)

--
Hassan Schroeder ------------------------ hassan.schroeder@...
twitter: @hassan
Consulting Availability : Silicon Valley or remote




 

Steve (et al)
So here is the real question I have
I've gotten older, and it seems out of touch with a lot of the younger developers

I was brought in to mentor them on this stuff, refactoring, TDD etc (and of course get out code, setup CD/CI etc etc - of course all at the same time ASAP)

How do you mentor 20 somethings when they won't READ, even short stuff

I tried to get them interested in "Brownfield Development" - Or Feathers, etc - and even when you hand them something as small as a partial chapter, or a simple write-up, you get blown off that they don't read (and this is management, as well as the Jr developers)

I've noticed at the last couple of places. One place - Give them the basic instructions for GIT/TortoiseGIT, no one can be bothered to read it, and one culprit (the CEO no less) would cowboy code, have it on his PC, not in any source control, and yell when you can't get things to work (the only semi working copy of the web site source was on his laptop)

I don't understand how to get through to these folks anymore

Trying to get them to understand WHY you TDD - Why you can't get CI/CD setup on a legacy project in a week (all manual builds off a developers PC, with no tests run, even though there were tests)

On 2019-11-24 19:49, Steven Smith wrote:
Autocorrect: yeah->teach

On Nov 24, 2019, at 19:48, Steven Smith via Groups.Io <ssmith.lists@...> wrote:
?I yeah refactoring a lot, and I think practice helps (shocking, I know). I include it in my workshops as well as in free resources on my github (). I also have three different Pluralsight courses on refactoring, including the monster 8 hour course Refactoring Fundamentals. Anyone can access these with a trial account and most enterprise shops I talk to have subscriptions for their folks.
But to JB¡¯s point, I do think it¡¯s a part of TDD that newer devs lack confidence and probably skill to perform, at least until they gain experience with it.
Steve


 

On Nov 23, 2019, at 12:32 PM, J. B. Rainsberger <jbrains762@...> wrote:
I have noticed something when programmers try to practise TDD: they don't seem to learn how to refactor. I don't mean to state this so harshly, but it seems that they struggle a lot more with refactoring than I did when I started.
This seems really important. Do other people see the same thing?


 

In my view TDD requires three distinct skills to be "fully effective":
1. Writing the test first (as opposed to after)
2. Writing good tests (as opposed to crappy tests: You can write crappy tests first..)
3. Understanding design (this is where the initial test guides our design for the entry point in the unit of work, and the refactoring is us guiding the code into a more maintainable and readable internal design)

Teaching all three at the same time is hard. I've seen people try to just jump into TDD in places and failing because climbing this wall is too high in one go.
I've created courses separately for the design part and named them "refactoring skills for TDD" because even in a 5 days class, teaching the first two skills is difficult enough.

I'm not including here the skill of refactoring?LEGACY code into a testable state. I do teach that stuff, but there seems to be a distinction, at least to me between continuous refactoring during new code vs legacy (not tests) refactoring which is a much more dangerous state and might even require integration tests to begin. Perhaps we are really talking about 4 skills and not three.


On Mon, Nov 25, 2019 at 10:56 AM Brian Marick <marick@...> wrote:

> On Nov 23, 2019, at 12:32 PM, J. B. Rainsberger <jbrains762@...> wrote:
> I have noticed something when programmers try to practise TDD: they don't seem to learn how to refactor. I don't mean to state this so harshly, but it seems that they struggle a lot more with refactoring than I did when I started.

This seems really important. Do other people see the same thing?




--
Thanks,

Roy Osherove





 

I teach programming at the local university and have found that one of the biggest mental blocks which students need to overcome is the assumption that there is only one way to solve any problem, and that the job of a programmer is to find that way.

This mindset makes it really hard to teach refactoring, particularly in the context of eager new practitioners of TDD who want to rush on to the next test as soon as the first one passes.

I'm not sure where this attitude comes from. Perhaps the way that programming and/or software development has been reframed as "coding", and the implications of the name, or maybe that first experiences in the field often come from poking at HTML and CSS with a stick to get something that looks right, and then copy/pasting a bit of Javascript or PHP to make something happen, or perhaps the prevalence of fill-in-the blanks frameworks, or perhaps that so many students prefer to learn by following a linear set of steps from YouTube, Who knows

I'd love to investigate this in more detail, as I too, can see how much new developers struggle with the concept and skills of refactoring.

If it helps, I have found that I get slightly better traction if I lead with the idea of "code smells."

Frank Carver


 

¡°How do you mentor 20 somethings when they won't READ, even short stuff¡±

I have a 19yo son going to college for software engineering, and he doesn¡¯t like to read. He prefers videos. It is frustrating. We tried pointing out that vast swaths of information in the world is written down and if he doesn¡¯t learn to ingest information that way, then he¡¯s cutting himself off from that info. Reasoning hadn¡¯t motivated him enough; it¡¯s too abstract. But you have a specific case. Do you get the sense these 20 somethings want to learn, or are they happy enough with the way things are? Maybe starting with goal setting so they understand ¡°why¡± and what¡¯s in it for them, first?

On Mon, Nov 25, 2019 at 1:03 AM Charles Gallo <Charlie@...> wrote:
Steve (et al)
So here is the real question I have
I've gotten older, and it seems out of touch with a lot of the younger
developers

I was brought in to mentor them on this stuff, refactoring, TDD etc (and
of course get out code, setup CD/CI etc etc - of course all at the same
time ASAP)

How do you mentor 20 somethings when they won't READ, even short stuff

I tried to get them interested in "Brownfield Development" - Or
Feathers, etc - and even when you hand them something as small as a
partial chapter, or a simple write-up, you get blown off that they don't
read (and this is management, as well as the Jr developers)

I've noticed at the last couple of places.? One place - Give them the
basic instructions for GIT/TortoiseGIT, no one can be bothered to read
it, and one culprit (the CEO no less) would cowboy code, have it on his
PC, not in any source control, and yell when you can't get things to
work (the only semi working copy of the web site source was on his
laptop)

I don't understand how to get through to these folks anymore

Trying to get them to understand WHY you TDD - Why you can't get CI/CD
setup on a legacy project in a week (all manual builds off a developers
PC, with no tests run, even though there were tests)



On 2019-11-24 19:49, Steven Smith wrote:
> Autocorrect: yeah->teach
>
>
>> On Nov 24, 2019, at 19:48, Steven Smith via Groups.Io
>> <ssmith.lists=[email protected]> wrote:
>>
>> ?I yeah refactoring a lot, and I think practice helps (shocking, I
>> know). I include it in my workshops as well as in free resources on my
>> github (). I also have three
>> different Pluralsight courses on refactoring, including the monster 8
>> hour course Refactoring Fundamentals. Anyone can access these with a
>> trial account and most enterprise shops I talk to have subscriptions
>> for their folks.
>>
>> But to JB¡¯s point, I do think it¡¯s a part of TDD that newer devs lack
>> confidence and probably skill to perform, at least until they gain
>> experience with it.
>>
>> Steve




 

Hi Roy,
?
Good points!

On Nov 25, 2019, at 4:20 AM, Roy Osherove <roy@...> wrote:

Teaching all three at the same time is hard. I've seen people try to just jump into TDD in places and failing because climbing this wall is too high in one go.
I've created courses separately for the design part and named them "refactoring skills for TDD" because even in a 5 days class, teaching the first two skills is difficult enough.
?
I particularly like this notion. We do encounter students who seem to lack even elementary notions of code clarity and expressiveness.
?
I'm not including here the skill of refactoring?LEGACY code into a testable state. I do teach that stuff, but there seems to be a distinction, at least to me between continuous refactoring during new code vs legacy (not tests) refactoring which is a much more dangerous state and might even require integration tests to begin. Perhaps we are really talking about 4 skills and not three.
?
At least some important details, since Michael Feathers wrote a million-page book on the topic. :)

Ron Jeffries
Impossible is not a fact. It is an opinion. ?-- Muhammad Ali

P.S. For some reason my mails don't come thru. Probably my email addresses.


 

¿ªÔÆÌåÓý

As I said, I was let go for not succeeding with them, so no longer my circus.
My impression ranged from ¡°wants to learn, but busy¡± (accepted the paper) to ¡°it is a paycheck ¡°

¡ª ?
Charlie
73 de KG2V

On Nov 25, 2019, at 8:06 AM, Jeanne Petrangelo <jeanne@...> wrote:

?
¡°How do you mentor 20 somethings when they won't READ, even short stuff¡±

I have a 19yo son going to college for software engineering, and he doesn¡¯t like to read. He prefers videos. It is frustrating. We tried pointing out that vast swaths of information in the world is written down and if he doesn¡¯t learn to ingest information that way, then he¡¯s cutting himself off from that info. Reasoning hadn¡¯t motivated him enough; it¡¯s too abstract. But you have a specific case. Do you get the sense these 20 somethings want to learn, or are they happy enough with the way things are? Maybe starting with goal setting so they understand ¡°why¡± and what¡¯s in it for them, first?

On Mon, Nov 25, 2019 at 1:03 AM Charles Gallo <Charlie@...> wrote:
Steve (et al)
So here is the real question I have
I've gotten older, and it seems out of touch with a lot of the younger
developers

I was brought in to mentor them on this stuff, refactoring, TDD etc (and
of course get out code, setup CD/CI etc etc - of course all at the same
time ASAP)

How do you mentor 20 somethings when they won't READ, even short stuff

I tried to get them interested in "Brownfield Development" - Or
Feathers, etc - and even when you hand them something as small as a
partial chapter, or a simple write-up, you get blown off that they don't
read (and this is management, as well as the Jr developers)

I've noticed at the last couple of places.? One place - Give them the
basic instructions for GIT/TortoiseGIT, no one can be bothered to read
it, and one culprit (the CEO no less) would cowboy code, have it on his
PC, not in any source control, and yell when you can't get things to
work (the only semi working copy of the web site source was on his
laptop)

I don't understand how to get through to these folks anymore

Trying to get them to understand WHY you TDD - Why you can't get CI/CD
setup on a legacy project in a week (all manual builds off a developers
PC, with no tests run, even though there were tests)



On 2019-11-24 19:49, Steven Smith wrote:
> Autocorrect: yeah->teach
>
>
>> On Nov 24, 2019, at 19:48, Steven Smith via Groups.Io
>> <ssmith.lists=[email protected]> wrote:
>>
>> ?I yeah refactoring a lot, and I think practice helps (shocking, I
>> know). I include it in my workshops as well as in free resources on my
>> github (). I also have three
>> different Pluralsight courses on refactoring, including the monster 8
>> hour course Refactoring Fundamentals. Anyone can access these with a
>> trial account and most enterprise shops I talk to have subscriptions
>> for their folks.
>>
>> But to JB¡¯s point, I do think it¡¯s a part of TDD that newer devs lack
>> confidence and probably skill to perform, at least until they gain
>> experience with it.
>>
>> Steve




 

Hi Frank,

Interesting thoughts. I have noticed the problem but thought it might
just be my own attitudes as I get older!

As I think about it, folks of my generation had to climb a very steep
learning curve just to write our first programs. I learned about
refactoring back in the 90s, by which time it seemed like a way to
make my work easier, not harder. The same was true for all the XP
practices at the time... but times have changed.

One thought on teaching this stuff... use at least some commonly
reversible refactorings. For example... convert to method vs convert
call to inline code. I talk about "forces" in this context, in the
same way I teach architectural patterns. In different contexts, the
forces want to resolve in different ways. When I make __choosing__ the
refactoring seem more intellectually challenging than doing it ('cause
it is!) I find that at least some folks start paying attention.

Another think I believe strongly is that folks should learn
refactoring first __without__ tooling to do it for them. Once they do
a few of them by hand, particularly if they are wide-ranging in the
code, they end up with a better understanding about what the tool
needs to do. This also gives the opportunity to talk about how the
presence of tooling changes the balance of the above forces. They also
need to learn about the danger of limiting oneself to only those
refactorings supported by the IDE.

Charlie

On Mon, Nov 25, 2019 at 1:59 AM Frank Carver via Groups.Io
<frank.carver@...> wrote:

I teach programming at the local university and have found that one of the biggest mental blocks which students need to overcome is the assumption that there is only one way to solve any problem, and that the job of a programmer is to find that way.

This mindset makes it really hard to teach refactoring, particularly in the context of eager new practitioners of TDD who want to rush on to the next test as soon as the first one passes.

I'm not sure where this attitude comes from. Perhaps the way that programming and/or software development has been reframed as "coding", and the implications of the name, or maybe that first experiences in the field often come from poking at HTML and CSS with a stick to get something that looks right, and then copy/pasting a bit of Javascript or PHP to make something happen, or perhaps the prevalence of fill-in-the blanks frameworks, or perhaps that so many students prefer to learn by following a linear set of steps from YouTube, Who knows

I'd love to investigate this in more detail, as I too, can see how much new developers struggle with the concept and skills of refactoring.

If it helps, I have found that I get slightly better traction if I lead with the idea of "code smells."

Frank Carver


 

I will say it is so good to see so many of the ¡°old names¡± here.

I remember the old SD Mag form on CIS, and then it going to the web. Is there any place like that today? I feel like I have no place where I can talk with folks to kick things around

¡ª
Charlie
73 de KG2V

On Nov 25, 2019, at 11:11 AM, Charlie Poole <charliepoole@...> wrote:

?Hi Frank,

Interesting thoughts. I have noticed the problem but thought it might
just be my own attitudes as I get older!

As I think about it, folks of my generation had to climb a very steep
learning curve just to write our first programs. I learned about
refactoring back in the 90s, by which time it seemed like a way to
make my work easier, not harder. The same was true for all the XP
practices at the time... but times have changed.

One thought on teaching this stuff... use at least some commonly
reversible refactorings. For example... convert to method vs convert
call to inline code. I talk about "forces" in this context, in the
same way I teach architectural patterns. In different contexts, the
forces want to resolve in different ways. When I make __choosing__ the
refactoring seem more intellectually challenging than doing it ('cause
it is!) I find that at least some folks start paying attention.

Another think I believe strongly is that folks should learn
refactoring first __without__ tooling to do it for them. Once they do
a few of them by hand, particularly if they are wide-ranging in the
code, they end up with a better understanding about what the tool
needs to do. This also gives the opportunity to talk about how the
presence of tooling changes the balance of the above forces. They also
need to learn about the danger of limiting oneself to only those
refactorings supported by the IDE.

Charlie

On Mon, Nov 25, 2019 at 1:59 AM Frank Carver via Groups.Io
<frank.carver@...> wrote:

I teach programming at the local university and have found that one of the biggest mental blocks which students need to overcome is the assumption that there is only one way to solve any problem, and that the job of a programmer is to find that way.

This mindset makes it really hard to teach refactoring, particularly in the context of eager new practitioners of TDD who want to rush on to the next test as soon as the first one passes.

I'm not sure where this attitude comes from. Perhaps the way that programming and/or software development has been reframed as "coding", and the implications of the name, or maybe that first experiences in the field often come from poking at HTML and CSS with a stick to get something that looks right, and then copy/pasting a bit of Javascript or PHP to make something happen, or perhaps the prevalence of fill-in-the blanks frameworks, or perhaps that so many students prefer to learn by following a linear set of steps from YouTube, Who knows

I'd love to investigate this in more detail, as I too, can see how much new developers struggle with the concept and skills of refactoring.

If it helps, I have found that I get slightly better traction if I lead with the idea of "code smells."

Frank Carver


 

We hire a lot of developers straight out of school or working less than 3 years.

From what I have seen, TDD is viewed as a skill used on Greenfield projects, and refactoring is seen as something you do with legacy code. (And still gets confused with 'throw it away and start over')

I have to have more than one code review with them until it clicks that you do both together, always.

On Mon, Nov 25, 2019, 15:05 Ron Jeffries <ronjeffriesacm@...> wrote:
Hi Roy,
?
Good points!

On Nov 25, 2019, at 4:20 AM, Roy Osherove <roy@...> wrote:

Teaching all three at the same time is hard. I've seen people try to just jump into TDD in places and failing because climbing this wall is too high in one go.
I've created courses separately for the design part and named them "refactoring skills for TDD" because even in a 5 days class, teaching the first two skills is difficult enough.
?
I particularly like this notion. We do encounter students who seem to lack even elementary notions of code clarity and expressiveness.
?
I'm not including here the skill of refactoring?LEGACY code into a testable state. I do teach that stuff, but there seems to be a distinction, at least to me between continuous refactoring during new code vs legacy (not tests) refactoring which is a much more dangerous state and might even require integration tests to begin. Perhaps we are really talking about 4 skills and not three.
?
At least some important details, since Michael Feathers wrote a million-page book on the topic. :)

Ron Jeffries
Impossible is not a fact. It is an opinion. ?-- Muhammad Ali

P.S. For some reason my mails don't come thru. Probably my email addresses.


 

Wouldn't pairing with them work better than code reviews?? If not, why not?


On Mon, Nov 25, 2019 at 10:16 AM Avi Kessner <akessner@...> wrote:
We hire a lot of developers straight out of school or working less than 3 years.

From what I have seen, TDD is viewed as a skill used on Greenfield projects, and refactoring is seen as something you do with legacy code. (And still gets confused with 'throw it away and start over')

I have to have more than one code review with them until it clicks that you do both together, always.