[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Handy utilities = Friday Filosofical Finking

On 2/04/19 1:25 PM, Chris Angelico wrote:
> On Tue, Apr 2, 2019 at 11:16 AM DL Neil <PythonList at danceswithmice.info> wrote:
>> One of the points which intrigue me is that my colleagues don't keep
>> snippets/a library, preferring to remember (hah!) when/where they used
>> particular techniques in the past, and copying/duplicating, to fit the
>> new system's requirements. Am wondering if this is true beyond our
>> little band?
> Until I've done something the same way two or three times, I just
> recollect and steal. There are a few things that are in the back of my
> mind to refactor out and make into libraries, but it's hard when they
> aren't actually identical. Otherwise, it waits till there are a few
> replicas, and then might get put into a central location somewhere.

In the ?good, old days (when computers were lubricated with open-fire 
rendered dinosaur fat) I would have followed such a practice!

However... when I was converted to the 'religion' of OOP, JIT/Agile, 
etc; I started working on one function/method (and class) at a time. 
(which inherently involves a balancing act between preparing some 
'useful tools' and YAGNI) Accordingly, extracting 'useful bits' into a, 
or to form a new, module is not difficult - and only requires the 
addition of an import statement to the original pgm/module. Accordingly, 
I try (very hard) not to find myself with the 'thrills' which you 
describe here...
(but hey, I'm an old ...)

Such also makes it easier to take care of the 'almost identical' nature 
of the programmer's existence...

Having said that, and cast aspersions about other members of the team 
'here', I couldn't believe that I'm the only ... Python coder in this world?

> Sometimes, I recollect and reference, which creates some very weird
> interdependencies until I get around to refactoring...

but some fairly hairy "technical debt" meantime?

> https://github.com/Rosuav/MegaClip/blob/master/deviquotes.py
> imports https://github.com/Rosuav/shed/blob/master/emotify.py
> which gets an API key from the non-sample version of
> https://github.com/Rosuav/MustardMine/blob/master/config_sample.py
> and the end result of deviquotes is to rebuild this
> https://github.com/DeviCatOutlet/devicatoutlet.github.io/blob/master/quotes.md

The twists and turns are positively admirable, but promoting the above 
as a training exemplar might not be the best idea!

Back to the original question(s): something I didn't want to do was to 
have a hard-coding of the import sourceDIR (per above). Whilst the 
PYTHONPATH is (at the very least) a form of "hard coding", at least I 
can do that to/on a client's m/c separately/in-addition to loading the 
s/w AND know that the Python code 'there' is the same as I have (in 
repo) 'here'!

> So running that one script can potentially involve four different
> repositories, because I haven't yet made any of the pieces into proper
> libraries...

- and if I did the same, would you pay me (as much) for delivering such? 
(different rules for personal stuff)

Regards =dn