On Tue, Dec 29, 2009 at 12:32 PM, Marnen Laibow-Koser <marnen / marnen.org>wrote:

> Alex wrote:
> > On Tue, Dec 29, 2009 at 11:47 AM, Marnen Laibow-Koser
> > <marnen / marnen.org>wrote:
> >
> >> > I don't see how that is a stupid exercise.  I reckon this is not
> >> >>> lists. That's the recursion part.
> >>
> > Way to kill the enjoyment of programming, dude. This guy is a new
> > programmer, and you're talking to him about tests?
>
> Yup.  It's more fun to program with good tests.  You can go faster, and
> you can see things work right away.
>
> Anyway, if he's really a new programmer, he shouldn't be writing sort
> algorithms.
>
>
I guess that's where our opinions differ, again. I don't think it's fun to
write tests. I also don't think there's anything a new programmer "should"
be doing. He/she should be doing whatever interests them, and
learning/having fun.


>
> > When I started out, I
> > certainly didn't care a single bit (GASP!) about how well-written my
> > programs were, or if they followed good design patterns and whatnot.
> > Exposing him to this stuff is just going to make it even more confusing
> > than
> > it needs to be.
>
> I didn't say a word about design patterns.  All I recommended was tests.
> These actually make it less confusing, since you can more clearly see
> what's going on.
>
> And we'd all be better programmers if we thought about good practice as
> an integral part of the craft, not something bolted on later.
>

I agree and disagree with this. It's a confusing feeling.


>
> >
> >
> >>
> >> >  When I started learning software development I
> >> > certainly got more kick out of a working program than a working unit
> >> > test before hand. :-)
> >>
> >> It's the working test beforehand that lets you know when you have a
> >> working program.  It really is best to write the tests first.  Read up
> >> on test-first development and apply it religiously -- it really is worth
> >> it.
> >>
> >
> > Yeah, the way I tell if I have a working program is (generally) to run
> > it.
>
> The tests run it for you.  Have you ever actually tried this?  Sounds
> like not.
>

Yeah, I've done the whole automated testing thing. Not my style, what can I
say? I think tests can be very valuable in the right situation, don't get me
wrong, but teaching a novice programmer about them is just confusing,
methinks.

>
> > True, a new programmer could write a test to ensure that his "hello
> > world"
> > program works right, but isn't that a little silly?
>
> For "hello world", yes.  For anything more complex, no.  And a sort
> implementation is certainly complex.
>

How is a sort implementation complex? For a full-fledged, high quality sort
implementation, maybe. For a student just writing what is (probably) a
single method sort? That's going to be an exciting unit test.


> >
> >
> >> >
> >> --
> >> Posted via http://www.ruby-forum.com/.
> >>
> >>
> >
> > Seriously, guys... He's trying to write a sort algorithm. I wrote many
> > of
> > them when I was starting out, trying to figure out what was going on.
> > What's
> > the problem here? Let's give him some guidance, not talk about how dumb
> > it
> > is to write that, because no one would use it in "the real world."
>
> I did give him some guidance.  Now, since you brought it up...what
> guidance have *you* given him?
>

I haven't given him any advice, as you so keenly pointed out. I'm sure there
are much more talented programmers who can handle that task, I'm just trying
to save a new programmer some of the confusion that's so rampant with
beginners.


> > You
> > know
> > what else no one ever used in the real world? That slot machine program
> > I
> > first wrote. All those "hello world" programs I wrote. All the
> > algorithms I
> > re-implemented, trying to learn how they worked. Does the fact that no
> > one
> > will ever use them make them worthless? Or maybe the experience I gained
> > from writing all that worthless code made me a better programmer.
>
> I'm sure it did.  I know I've done similar exercises.  But I did want
> the OP to realize that he shouldn't expect to ever do this in a real
> Ruby program.
>
>
Really, the point I'm trying to make is that he shouldn't be concerned with
the "real world" yet. He should try to have fun and learn at the same time,
not be bashed over the head with more complexity.


> >
> >
> > Alex
>
> Best,
> --
> Marnen Laibow-Koser
> http://www.marnen.org
> marnen / marnen.org
> --
> Posted via http://www.ruby-forum.com/.
>
>