I've been working on my non-work project this weekend, which has been a nice reprieve from pajeetery.
I'm working on a little daemon that manages resources. I'm being deliberately vague in case this project goes anywhere (

), so, let's say it manages "media streams", with "sources" and "sinks". (Made up terms to be deliberately vague.)
So basically I want something that I can feed it a config file (yaml) of "sources" and "sinks" and "tasks" that direct the daemon to read from the sources and write to the sinks in a loop.
One little nuance is that some of the sources and sinks might have multiple channels in them that can be read/written in parallel.
So the config file can specify one task that reads from one source, writes to one sink, but if that source and sink each have two channels apiece, then it's more efficient to have two processes (or threads or whatever) instead of one. If I write the config file to specify two sources (each with a flag set to channel 0 and 1) and two sinks (channel 0 and 1) and two tasks that separately handle those pairs, then the daemon will fork and handle each task separately.
It would be convenient to have a flag on the daemon to do this expansion automatically when possible. Commit a simple, high level config file, but have it expand it to parallelize it as much as is possible.
So from
YAML:
source:
name: front-door-cam
url: http://192.168.1.145/stream
sink:
name: aggregation-target
url: http://foobar/stream
task:
name: upload
source: front-door-cam
sink: aggregation-target
To:
YAML:
source:
name: front-door-cam-0
url: http://192.168.1.145/stream
channel: 0
source:
name: front-door-cam-0
url: http://192.168.1.145/stream
channel: 1
sink:
name: aggregation-target-0
url: http://foobar/stream
channel: 0
sink:
name: aggregation-target-1
url: http://foobar/stream
channel: 1
task:
name: upload-0
source: front-door-cam-0
sink: aggregation-target-0
task:
name: upload-1
source: front-door-cam-1
sink: aggregation-target-1
So this is a perfect little niche for
TDD, test driven development. So I wrote up a bunch of functions for the config expansion code (several simple expansion stages), thought up all the contexts in which it should fail, and wrote up a bunch of tests. Now I'm just going through and implementing the stages and the tests start passing, one by one.
So I'm having a cozy saturday evening working on this. Some friends of mine are watching UFC online, so I'm half watching that while working on getting the tests to pass.
The reason I'm rambling about this, is because this had me thinking about how good concepts like TDD get (mis)interpreted by non-technical (or ex-technical) team managers.
TDD? Good idea for some situations. But then you get team managers who read some blog post about how TDD is the future of all software development and they breathlessly announce how we're moving to a TDD approach and every PR must come with a full battery of tests and they get super mad if the automated test percentage drops. So you end up writing a lot of pointless tests that essentially test for tautologies, just to keep them off your ass.
And substitute TDD for any other new trendy thing.
I've had good jobs in the past and bad jobs. Despite my bitching earlier in the week, my current job isn't really that terrible. But just thinking about all this, I think I'm going to resolve two things for my career going forward:
- Never work directly under a fully non-technical manager. They can be nice people and maybe they're really good at managing people in other contexts, but if they have zero understanding of the technical implications of what they're telling me to do, I won't be very productive. Which means my job will be tedious and suck, and the company probably isn't well run. I worked for a marketing department like this once, with actual pajeets as coworkers.
- No matter where I advance to, I want to still spend at least some portion of my time programming. I've had opportunities to advance in my career and run small teams, and that's nice (especially with the extra money).
But my current boss hasn't programmed regularly in years. He's sharp and he can understand technical language, but the best he can do is just fuck off when me and the other guy give a basic technical explanation about an issue. Whether we're arguing with each other or together against management, we just need to offer just enough technical language to pass the sniff test and then he fucks off. It's not because he's smart or because he's not a programmer, it's because he's not a current programmer, and he's not currently balls-deep in the project enough to argue with us effectively.
He's not much better than a fully non-technical manager.
It's funny, the CEO at my current job wrote our original product (it's a small company). He still comes around to try to contribute to stuff, but I think he's been left behind. I don't know if he likes his new role or not, maybe he's happy. But it's funny watching a programmer play as a big C-suite type. He's like a chimp in a suit.
I don't want to end up like that.