It is quite strange when you take the time to step back from being an experienced developer and have to look at things from the perspective of someone just starting to learn to code.
My partner has taken the decision to learn HTML and PHP and so far is doing very well at it. This has lead to a few questions which I am more than happy to answer, I just have to try and think about how to explain things.
You see after years of development things are just things. A variable is a variable, an array is an array and functions, methods, objects etc. well, they just are what they are. So stepping back and trying to explain that a variable is just a box you can put something in, an array is just a bigger box that you can put other boxes (variables) in and actually thinking about how to explain things can get quite esoteric.
I have found myself coming up with some strange and probably completely flawed examples whilst trying to explain something that to me “just is” to someone who doesn’t yet understand what it is. For example on the spur of the moment I was trying to explain what a function is and came up with “Well imagine a function is a kettle, you put cold water and electricity in and get hot water out ”
hotwater kettle('cold water','electric')
Probably not the best way to explain it but it seemed to get the idea over and that is where the problem is going to come from in future.
When you think of how abstract some of the concepts we use are and how alien they are to non developers it can be quite a task on the spur of the moment to produce an explanation that is not just understandable “The singleton is like The Highlander, there can be only one” but is also useful and still easy to understand and remember.
I wonder what explanations and examples other people heard or used (both good or bad) of development basics, ideas and concepts?
