Functional programming in Lua

@dave1707 I know, it’s a great feeling whilst it lasts but there are too many people who would take the piss and from a company perspective it’s very bad practice because anything could happen to you and then the company would be screwed.

@TechDojo I probably wasn’t as indispensable as it seemed. The other programmers around me were just as good and I’m sure any of them could have jumped in and in a short time been able to take over. Like I said, I kept the coding as simple as I could. Not only for someone else, but for me. But I’m just trying to point out that you don’t need all the pair programming, functional programming, procedural programming, OOP, and whatever else they call it. Just write simple, straight forward code and don’t try to get fancy. There are some languages where you have to stare at the code for hours just to figure out what a line of code is doing, and then you’re still not sure.

@dave1707 I 100% agree and so far in my career i’ve been in the same situation as you but it’s as the size and scale of programmes and systems of interrelated programs grow that these concepts become more important, also I think the really good programmers do these kinds of organisational things naturally which is why we now have more formalised methods that are used to try and instil better programming habits.

I guess one gets to do as one wishes. I’ve found great joy in learning about different approaches and techniques, trying them, figuring out how they fit into my work. I think I’d learn less if I had to invent all the new programming ideas on my own, and don’t feel the least bit threatened by reading about some different thing, and if it sounds interesting, trying it until I think I’m good enough at it to make a decent decision about how it fits in.

That said, I have less than zero interest in anyone, manager or guru, telling me how I must program. So, when I’m offering what sounds like it might be advice, I try hard to say “this is what I do, this is why I think I’m doing it, this is what happened, I invite you to think about this and if it seems interesting, try it.” I don’t like to be given orders, so I try not to give orders.

@UberGoober I’m glad you found my little article useful. :smile: Thanks!

@RonJeffries the main thing I got from it, by watching your process, was that a test can be one line of code.

You didn’t need to set up a whole testing framework to build tests, quickly and easily, right into your code. What you opened my eyes to was that anything that verifies a result can be considered a test. This has made my code much better, and also helped me code faster, because I find it easy to do simple, quick tests right as I write.

TDD in general gets criticized for being slow, but what your process demonstrated was that it doesn’t have to be. I don’t know if that’s a message you intended to teach, but it’s a style of work that you demonstrated, and a style that inspired me and made my code better ever since.

Well, super. I write all this stuff in this kind of naive well let’s see what happens, try something nearly stupid fashion, because I find that if we keep pushing toward better tests and better code, we can keep going forever.

Especially in Codea, it’s so close to the metal that you can feel the effects of adjusting practices really early on. If you’re watching my site just now, this “Spiders & Ant” exercise is fun and, more important I think, is turning up some interesting ideas on going fast. There’s at least one more article coming on that series, probably today.

Thanks again! Keep on keeping on, keep on learning!