Kids learning to code #rant

Why is it that my engineering-slanted child is getting taught how to code, without getting taught how to test their code?

Let me just lay out the actual picture a bit here, not all kids are into coding, I have 2 boys, I have not at any point tried to force them to become engineers, I’m just a lazy parent. I have thus, done a fair few Computer-science (CS) homework assignments with my 2 boys. I never do any typing. This pictured keyboard was built by kid2 his older brother is not into such things, but that did not stop both of them trying to emulate their father. Unfortunately kid1 is just not really technical like his younger brother, you cannot win them all.

#TLDR
So my gripe - is multiple really. They get given an assignment, write battleships the game on C#. Okay so my last real C# coding was a bit of code reviewing 8 years ago and some coding almost 20 years back now. So I’m struggling to build this too, but the teacher has asked them to write the game with simplified and changed rules. The rules I objected to

  • ships may touch
  • the grid is 8x8, no battleship, cruisers only
  • they somehow swapped the size of the submarine and the destroyer

Why, just why? Okay well, that’s not my gripe really I’ll get back there in a moment. Why teach kids to build something that does not actually do the job, the Biff and Chip reading books curriculum specifically pissed me off when I was young, I had similar book as a young-un and my gripe was that we were getting taught to read, write and definitely not to “say” short almost pointless sentences that actually had no meaning because they were often missing all of the parts of a basic sentence. In carpentry or woodshop, we teach kids how to sandpaper and varnish a piece of wood before we teach them to saw, before we teach them how to make joints, and then to finally build a cupboard. Each year we had a complete take-home and display or use it woodwork project, none of this half-working game of Battleships. We had a thing that was done, and we all know the definition of done includes one ingredient, and it’s not varnish. Why is coding done backwards? It’s like the chef who never tastes the food he/she makes, we can do better at this.

Coding Is Hard
He has already written a “partly” working program, but even my untuned C# eyes can smell the terrible stench of bad code just walking past, so I dive in and refresh my C# skills. These are my gripes.

  • copy-pasta code : do not teach kids copy to copy-paste code and write a 40 lines long function when 10 functions of 4 lines each will allow you to refactor bigtime - at this point I pull out a actual paper copy of Folwer : Refactoring - yes that whole volume, I politely explain , that this is for reading later, and only to read up to chapter 1 and no furthur.
  • They have not taught them to design their program - I spent a long time explaining how code is really really hard to write, and all the refactoring we had to do was because, it’s well hard. designs will very often be “emergent”. It’s impossible to write correct code the first time, and this leads to the clincher for me.
  • The teacher is not a practitioner. So they teach it like in the book and have missed out so many key OO programming concepts like the correct use of base classes and interface classes.
  • He does not know about NUnit. That should have been the first thing the teacher taught or at least mentioned as a way to write refactorable code safely, because hellooooooo it saves time because each line of code comes with maintenance cost, so why would you not want to refactor?

You cannot refactor without some kind of check or test.

3 Likes

I get the impression that this a global problem with schools and education in general, kids are expected to memorize official descriptions just to get grades, most teachers don’t even bother explaining why do they need to learn something and who can they apply what they learn in real life. :angry:

1 Like

So true.

Even in Uni’s they don’t even learn how to test properly… or even test at all :stuck_out_tongue:
They should introduce sessions about software quality & teach testing so it becomes more accepted among other developers and so people don’t get scared from testing or writing unit tests XD

3 Likes

I don’t really want to interfere , and would volunteer to do a module at a local 6th form, or even a lunch-club in high school. But there are plenty of good distance learning courses (aka youtube) in computer-science, every single teacher does not need to actually present these kinds of lessons themselves. Just one teacher has to do it, once, well.

1 Like

I think this is one of those things that needs to get better and quick.

But then I think back to my IT classes in school and it was all about learning to use Microsoft Office products and no coding. Often the students knew more about what was going on than the teacher.

I guess now some of those students are the teachers themselves but there’s no doubt still going to be a lag before the importance of testing becomes obvious,

3 Likes

This job isn’t as easy as people think.

Every so often I stop and look back on what I have done and consider if it is going in the direction of being unmanageable. Why do I do that? Probably because I have the years of experiences of making exactly that mistake.

What amuses me are the twitter posting of people who have got their first computing job with something like “Yay, yesterday I started as a full stack developer”.

I don’t believe that it has occurred to them that they are at the start of the journey not at the end.

2 Likes

This is just so cringeworthy on twitter. It’s embarrassing, because often these people have a lot of study behind them that they are not telling you how hard it was to get under their belts. Kids need to know that it will be hard to get good, but also that it is fun to be able to create “great” programs.

1 Like

I agree with the woodshop analogy. Teach the basics first such as assignment, iteration, input/output, storage, math, etc., and testing. In my opinion, that kind of introduction to programming lays a foundation and could imply a “good practice”. That is, if you grow up writing code with tests, you might always do it that way.

With that foundation, one might move to design which is putting the basics together to create something of value.

Lastly, I’m surprised a school would select C#. I hope the school didn’t lay out a bunch of money for what could be taught for a whole lot less using notepad, a browser, and some javascript. If you are learning the basics, any language would suffice.

Joe

2 Likes

My son has been unusual, @devtotest in that he is really into this stuff, they teach them Python, and they teach them C++ too, so he is like years ahead of me who only was beginning to grasp BASIC at that age.
The current battleships assignment is Python or C#, he just chose C#. Students get access to loads of Microsoft tools for free, so cost is really not a barrier these days. But yes, it’s curious that he is actually learning 3 languages in one go, which is why I have kept pushing testing into the conversations.

When I later learned to program “formally” I did a course, back in ~1989 where they spent half of the class time covering theory concepts like refactoring, performance, debugging, concurrency, maintenance and high level design. (Test frameworks did not really exist back then.) Those are things or areas they do cover, but not nearly as much time spent on theory as I have had formally taught to me.

1 Like

Good job Dad! It’s great to see kids have a passion for learning.

I’ve had similar conversations with my son about testing when he was learning to write programs (during high school maybe four or five years ago). My approach was the same: explore the topic of testing and its benefits but let them find their own way.
While it may require more time for them to see the benefits of testing, the immediate (and, in my experience, long lasting) benefit is a common interest that a parent and child share, and the bonds it creates.

Joe

2 Likes