Lawrence D'Oliveiro wrote:
>>
>> You see why all languages are not the same. The concept of what is
>> high-level has progressed somewhat since the 1970s.
>>
>> This is about philosophy...
>
> I showed you an example where it was a bit more than just
> philosophy, did I not: Python offers constructs that let you do more
> with less code, than perhaps what you were used to. Less code to write
> means less effort and time required, less chance for bugs to get in,
> and less ongoing maintenance effort required into the future.
Hi Lawrence,
Fair point. And I think I may have been so busy explaining my philosophy
about how much I hate syntax issues in programming that I didn't give your
actual example the thoughtful attention it deserved.
You're right. Your example demonstrates something more substantive than
simply having different syntax or a different programming philosophy.
The generator approach, for instance, isn't just a shorter way of writing
the same code. It can change how I can approach the problem. Being able to
yield rows as they're needed, rather than loading everything into memory,
is a genuine functional advantage. And being able to encapsulate the
repetitive database operations in a reusable helper reduces both code and
opportunities for mistakes.
Hence, I apologize for going overboard on how much I hate syntax to easily
and openly agree with you about the benefits of doing more with less code.
Less boilerplate, fewer opportunities for errors, and less maintenance down
the road are all things I appreciate. In fact, the whole point of writing
the code was to be able to do in 30 seconds what would have taken me, oh,
maybe an hour to do manually (for a few folders).
I'm all for investing up front for a later return on that investment.
In fact, your help with my experience with Python has already demonstrated
exactly the point you're making. Compared with my original Windows
batch/PowerShell approach, the Python implementation required considerably
fewer nutty workarounds and much less convoluted code as a result.
So perhaps I'm giving Python less credit than it deserves simply because
I'm looking at it through the lens of someone who would rather be doing
something else than looking up the syntax rules when it throws an error.
I do appreciate your APSW suggestion and, more importantly, your taking the
time to show me a better way of approaching the database code.
You're being kind, informative, and helpful.
I don't want my philosophical ramblings to obscure that!
Thanks for the discussion.
Apologies for going overboard on my hatred for syntax. :)
Nolo contendere.