The name is key here. What is this object for? Why would anyone look for it, or use it? When I'm programming, and I need a skiplist where can I find it, and what is it called there? What if it's not called skiplist?
Sometimes this is simple, like python 'datetime' contains 'date', 'time' 'datetime', 'timedelta', and more.
The name 'date' is scoped, so the name is really 'datetime.date' which is important to realize.
The scope should add meaning and context to the immediate name.
It may be that 'partial' wouldn't mean as much to a developer as 'functools.partial'.
Likewise 'Counter' in 'collections' probably is more appropriately meaningful than it might have been in 'itertools'.
But in each case, the (fully scoped) name is supposed to make it easy to find the functionality you are after.
It should evoke an idea of what it's for, rather than what it's made of. The fully-scoped name should be sensible.
OO is a kind of filing system in that regard.
• • •
Missing some Tweet in this thread? You can try to
force a refresh
I got my new UPS today. I intend for it to supply my internet gear (modem, router, mesh, storage).
I plugged it into the wall, plugged everything in.
Note: this could have been planned better - some of my cables are too short so I need a higher shelf for the unit, but we worked through that.
Everything is working okay... or so it seems.
Plugging every item in one at a time helped me ensure I have all the right cords to the right things. This is rather like industriallogic.com/blog/test-driv…
Readability is a relationship between an artifact and an audience, and we all know that. It's not just the artifact, but here is a funky example.
I got a great new overdrive pedal for Christmas. It looks like this:
The weird bit is that usually the bass/treble EQ controls are together, and the volume/gain controls are together.
This time they're not and that was confusing to me.
Why such a weird order?
so, OO, right?
What people are doing with Java typically is nothing like OO.
Imagine you're creating your own language specific to your problem domain and solution domain.
That's a beginning.
A language in which you can solve your problems in your domain and stack.
It doesn't exist, btw. Java, JS, Python, C#, Smalltalk -- they're not it. They're the language you build your language in. You don't implement the solution in Java. You implement your solution in the language you've built in Java.
The problem is that you have two locations in space, a bunch of roads, and you want to route a path from one place to the other.
Don't do that in ints, strings, functions, and doubles.
Do it in places, paths, and routes.
In other countries where you drive on the left, the rule is "say left except to pass" and this works. In the US (where we drive on the right) we don't do that. Cars are in all the lanes. There IS a system though.
The far-right lane (remember we drive on the right) is the "ramp lane." People are always slowing to get off the highway, or coming on slow and speeding up.
You'll be always accelerating/decelerating there, so don't drive this one. Go left.
If I'm involved in a task and it's not completed yet, then people may want to talk to me about it or ask questions.
Eventually it's done, and there is less reason for people to need my attention on that topic.
So, the more work I have in progress and incomplete, the more reasons people have to talk to me.
When I have a lot of work in flight, and I'm trying to work on something else, then all those conversations will be felt as interruptions in the work I'm doing now.