ez ✔

ez ✔ is an extremely powerful, yet simple and fun to use software product that gives you the superpower to focus on building solid habits of the most important activities for your success in Life and Business.

The more you use it, the better it gets... and so do you.

Price: Free. Start Now: Read the User Guide

____________________________________________________

Tuesday, December 24, 2024

The Unbearable Burden of Perfection (version 12.8.3)

Always code as if 

the guy who ends up maintaining your code 

will be a violent psychopath who knows where you live.

John Woods


The ToBeWise™ quotation above popped up on my EZchecklist, and it got me thinking about the imperfection of my own coding...

After experiencing first hand the spectacular abilities of AI, I couldn't resist the temptation to request a complete rewrite of the underlying Apps Script governing some of the special features of EZchecklist.

I described what I wanted the AI to program, in English, and it produced the code to produce the result. It was a "clean sheet of paper" approach as opposed to asking for an optimized version of my own code. 

The first result showed me that I needed to be more clear and precise in my description of the problem, but after I got the hang of it, the results were clearly superior to what I would have done. I was surprised that the AI even built in reasonableness checks on human-entered data and issued warnings for non-numeric input, etc. (something I had not requested, but definitely desirable). The code was even well documented with comments describing what was going on for each major step.

When the AI produced a code snippet that was unfamiliar to me, I simply pasted that snippet back with the question "What does this do?" and it gave me a thorough explanation. What a great way to learn!

Although this new version is functionally the same as the previous version, it runs faster, is more concise, more adaptable to edge cases, works better on mobile devices, and more clearly written. It's a most excellent Christmas present to myself, and a great foundation for what is to come in the New Year.

While I was building a more perfect product, I also went through and cleaned up some cosmetic issues. So it is now perfect and more beautiful... until the next time I decide to do something extraordinary.

Saturday, December 21, 2024

Getting by with a little help from AI friend (versioin 12.8.2)

 

A couple of days ago I had just finished coding a feature in EZchecklist that I'd wanted to do for a long time. It took about 5 hours to get working, and it looked good, but the underlying coding was so ugly that I couldn't bear it if anyone ever saw it. The odds of someone seeing the ugliness were extremely remote, but before I went to sleep I promised myself to rewrite the code so that it was more presentable (to myself, at least).

That opportunity came the next morning because I just couldn't live another day with all that ugly code living inside my computer, even though it was invisible to the world except me, of course.  Another five hours and it was done.  Two hundred plus lines of code replaced with 39 lines.

Feeling much better about the transformation, I then had the thought that chatGPT 4.o might be able to do better, so I copied and pasted the code into the AI and asked it to optimize it... if it can. AI got it down to about 18 lines and did it in about 5 seconds, tops, but it's not as easy to follow as my code.  Sure, it would run a bit faster but speed is not the issue here.

Having a coder to coder chat with AI about the various approaches to the problem was amazingly educational.  For me.  I doubt AI learned anything, and sure didn't have that warm fuzzy feeling of getting something to work.

Maybe I'll go back later and implement AI's optimized coding.  Maybe not.  There's something to be said for pride of human workmanship rather than the sterile perfection of AI.

And I'm happy that, at 82, my mind is still capable of learning new approaches to coding.

Note: I asked AI to illustrate the concept. It took about 10 seconds. I couldn't have done it in 10 years.