In my previous post, I made a small inroad to discussing the multi-binding of tests. In that conversation, I glossed over a lot of details.
One of the most important details I skipped was how I abstracted everything about a sophisticated system so that variations in binding points were invisible to the tests. This discussion will probably span several entries.
Tuesday, December 17, 2019
Saturday, December 14, 2019
Making my tests multi-bound
To multi-bind a test is to make it so that a single test enforces the same semantic requirement against different portions of a system.
This has been going on for a long time but not everyone noticed it. Teams that use the Gherkin syntax to define a behavior are likely to exploit those definitions in two ways:
This has been going on for a long time but not everyone noticed it. Teams that use the Gherkin syntax to define a behavior are likely to exploit those definitions in two ways:
- Bind automatically with Specflow or Cucumber.
- Treat as a manual test script.
This is an early form of multi-binding.
I'm talking about something more than that and it's the foundation of stability in all my pipelines. So we need to discuss it, first.
In my environment, any given test can be executed all of the following ways:
- As a unit test.
- As an integration test with no networking (everything runs in a single process).
- As an integration test for the backend with mocked data.
- As a gate between the blue and green environments of the backend.
- As an integration test for the Android client, with a local server and a mocked database.
- As an integration test for the WebGL client, with a local server and a mocked database.
- As a gate between the blue and green environments of one of my WebGL deployments.
There's nothing to stop me from adding more ways to run tests if I need them. This seems pretty good for what amounts to a one-man show.
Thursday, December 12, 2019
Building Dwindle, a list of challenges
This entry is more like the establishment of an initial backlog of topics to discuss than an in-depth discussion of a particular topic.
Wednesday, December 11, 2019
Dwindle released on Kongregate
Dwindle has been released on Kongregate. You can play it here. This deployment interoperates with the existing Android deployment.
This release coincides with a major UI overhaul. Here are some screenshots:
Here's a cute little animated gif, demonstrating gameplay.
Here's a video of me beating the AI on the "normal" (1 star) setting, using the Simple board.
This release coincides with a major UI overhaul. Here are some screenshots:
Here's a cute little animated gif, demonstrating gameplay.
Here's a video of me beating the AI on the "normal" (1 star) setting, using the Simple board.
It took a lot of behind the scenes work to make this happen. In addition to everything you see and what you may easily be able to imagine (like the back end server), I also needed to build a very reliable pipeline to guarantee that what I build flows out to production in a well-controlled way.
The pipeline is summarized in the following dashboard:
It seems like there's months worth of writing on the subject of getting to this milestone.
Tuesday, September 24, 2019
I'm back
I've had a particularly rough year and I allowed myself to lapse in my blogging. I won't bore you with the list of things my family has had to deal with and, to be sure, there are families that have had to endure far greater hardships. Suffice to say: It was a lot of little things that added up to an overwhelming year.
That's okay.
It doesn't bother me that I failed to meet my commitment to write every day a year. That's life. I'll try again.
I'm trying again, now.
That's okay.
It doesn't bother me that I failed to meet my commitment to write every day a year. That's life. I'll try again.
I'm trying again, now.
Monday, September 23, 2019
Continuous Satisfaction
No matter how easy we make things for ourselves, there will always be some way it could be better.
Things are almost never exactly the way they should be. Once we are accustomed to the unachievable pursuit, it's easy to fall into the trap of only noticing what you don't have.
If you add a new layer of tests, you're likely to notice that there's another way you could make your pipeline more strict. If you speed your pipeline up a little bit, you may create an appetite for making it go faster. If you fix a design flaw, you might find that another, more subtle flaw becomes apparent.
It's good to notice those things but sometime's it's also good to stop and remind yourself of what is going right, what you have accomplished...what is better because you touched it.
I have no ritual, ceremony, or process for this. I just try to think about the things I have achieved whenever I get frustrated with the as-of-yet-uncompleted tasks in my life.
Monday, January 28, 2019
Extruding Code from Tests
As you may or may not know, I've been working on a game. I've also been experimenting with writing all my code in test files and extracting it.
I think I'm getting it down.
Recently, I built a lobby for my game. It's an in-memory lobby for letting people start a game on their device but it's the first step.
I started a little bit before the below video but this is where it really started getting good.
I think I'm getting it down.
Recently, I built a lobby for my game. It's an in-memory lobby for letting people start a game on their device but it's the first step.
I started a little bit before the below video but this is where it really started getting good.
Sunday, January 27, 2019
Good Advice
Fred woke without opening his eyes. He'd become a very light sleeper in recent weeks, which enabled him to avoid letting on that he was awake.
Casually, he rolled over and slid his hand under his pillow, feeling for the artifact of his other recently-developed affectation.
A brief panic flashed through Fred's mind when he couldn't find it. When the lights flicked on, his blood ran cold.
"It only works if you sleep with your hand on it," said Kramer.
Fred opened his eyes and looked in the direction of the sound.
Kramer sat in the chair across the hotel room. The lower part of his left leg was balanced casually on his right knee. In Kramer's right hand was a gun Fred didn't recognize. Kramer's left hand held Fred's "pillow pistol".
Neither weapon was pointed in any particular direction. Instead, both of Kramer's hands hung a little slack, pointing the ends of the barrels at the floor and letting them drift lazily.
"It's not a bad idea, Fred," said Kramer, "but the execution is all wrong. A gun under your pillow only works if you can go from asleep to awake and drawn in a single fluid motion."
"I'll try to remember that," said Fred.
"If I'd been here to hurt you, your little 'roll and reach' maneuver would have forced my hand."
Kramer gestured in the general direction of Fred with his left hand, being careful to keep the piece aimed at nothing in the process.
"It's a good thing I'm not," he added.
"How do you keep getting past security?" asked Fred. "Those are federal agents in the next room."
Kramer smirked. "I have to admit," he said, "it's getting harder. Those guys are going to have some nasty headaches in a few minutes."
Fred shook his head. Without thinking he reached up to rub the sleep out of his eyes, then he froze, peeking at Kramer without moving anything but his eyes.
Kramer chuckled. "It's okay. I'm not startled by sudden movements or anything."
"What do you want?" asked Fred, as he tried to rub the blur of midnight from his eyes.
"Samantha knows something," said Kramer. "I think you know it, too. I want to know it, as well."
"I bet you do," said Fred. "I don't think you're going to hurt me to get it, though."
"Oh?"
"Well, you saved me from that guy?"
"Did I?"
Kramer tapped his right index finger against the trigger guard of his pistol. After a long while, he said, "Let me give you some advice." Then there was another long pause.
"Well?" asked Fred.
Kramer pursed his lips and nodded. "Stop making assumptions," he said.
"I don't get it."
"If you don't really know but you can only really imagine one answer, it's probably not the one."
"You're saying...you didn't save me?"
"I'm not saying that."
"You're saying you did save me?"
"I'm not saying that."
"You're saying I don't really know what you're after?"
"That's right."
"Why would you tell me that, if you're not trying to help?"
"That's the question. Assuming someone is helping because they did something helpful may seem reasonable but it is an assumption."
"So what do you want?"
"I think Mike is working for someone. Someone you probably wouldn't like very much, if you found out who it was. I want to know what Samantha knows - what I think you know, too - before Mike can find out and deliver it to his handler."
"So you are on my side?"
"Maybe I'm not and I want you to think I am. Maybe I am and I just want you to think differently."
"Your friends will be waking up, soon, and I'm sure they'll have plenty of questions for you when they do." Kramer stood and began to walk toward the door.
Ask Kramer grasped the handle of the door leading to the hallway, Fred asked, "What if I don't help at all? I mean, anyone...either way."
Kramer paused with one foot out the door. For a moment, he seemed frozen...like a robot whose processors were all simultaneously in deadlock. He looked down and smiled. Then gently placed Fred's Glock on the TV stand, just within his reach.
"Then get used to keeping your hand on the gun under your pillow every night for the rest of your life," he said.
Just before the door closed, obscuring Kramer from view, he added "However long that may be..."
Casually, he rolled over and slid his hand under his pillow, feeling for the artifact of his other recently-developed affectation.
A brief panic flashed through Fred's mind when he couldn't find it. When the lights flicked on, his blood ran cold.
"It only works if you sleep with your hand on it," said Kramer.
Fred opened his eyes and looked in the direction of the sound.
Kramer sat in the chair across the hotel room. The lower part of his left leg was balanced casually on his right knee. In Kramer's right hand was a gun Fred didn't recognize. Kramer's left hand held Fred's "pillow pistol".
Neither weapon was pointed in any particular direction. Instead, both of Kramer's hands hung a little slack, pointing the ends of the barrels at the floor and letting them drift lazily.
"It's not a bad idea, Fred," said Kramer, "but the execution is all wrong. A gun under your pillow only works if you can go from asleep to awake and drawn in a single fluid motion."
"I'll try to remember that," said Fred.
"If I'd been here to hurt you, your little 'roll and reach' maneuver would have forced my hand."
Kramer gestured in the general direction of Fred with his left hand, being careful to keep the piece aimed at nothing in the process.
"It's a good thing I'm not," he added.
"How do you keep getting past security?" asked Fred. "Those are federal agents in the next room."
Kramer smirked. "I have to admit," he said, "it's getting harder. Those guys are going to have some nasty headaches in a few minutes."
Fred shook his head. Without thinking he reached up to rub the sleep out of his eyes, then he froze, peeking at Kramer without moving anything but his eyes.
Kramer chuckled. "It's okay. I'm not startled by sudden movements or anything."
"What do you want?" asked Fred, as he tried to rub the blur of midnight from his eyes.
"Samantha knows something," said Kramer. "I think you know it, too. I want to know it, as well."
"I bet you do," said Fred. "I don't think you're going to hurt me to get it, though."
"Oh?"
"Well, you saved me from that guy?"
"Did I?"
Kramer tapped his right index finger against the trigger guard of his pistol. After a long while, he said, "Let me give you some advice." Then there was another long pause.
"Well?" asked Fred.
Kramer pursed his lips and nodded. "Stop making assumptions," he said.
"I don't get it."
"If you don't really know but you can only really imagine one answer, it's probably not the one."
"You're saying...you didn't save me?"
"I'm not saying that."
"You're saying you did save me?"
"I'm not saying that."
"You're saying I don't really know what you're after?"
"That's right."
"Why would you tell me that, if you're not trying to help?"
"That's the question. Assuming someone is helping because they did something helpful may seem reasonable but it is an assumption."
"So what do you want?"
"I think Mike is working for someone. Someone you probably wouldn't like very much, if you found out who it was. I want to know what Samantha knows - what I think you know, too - before Mike can find out and deliver it to his handler."
"So you are on my side?"
"Maybe I'm not and I want you to think I am. Maybe I am and I just want you to think differently."
"Your friends will be waking up, soon, and I'm sure they'll have plenty of questions for you when they do." Kramer stood and began to walk toward the door.
Ask Kramer grasped the handle of the door leading to the hallway, Fred asked, "What if I don't help at all? I mean, anyone...either way."
Kramer paused with one foot out the door. For a moment, he seemed frozen...like a robot whose processors were all simultaneously in deadlock. He looked down and smiled. Then gently placed Fred's Glock on the TV stand, just within his reach.
"Then get used to keeping your hand on the gun under your pillow every night for the rest of your life," he said.
Just before the door closed, obscuring Kramer from view, he added "However long that may be..."
Friday, January 25, 2019
Labors of the Fastidious Coder
I spend a lot of energy on the coding equivalent of the mantra "cleanliness is next to godliness".
People sometimes think this is extra work but it's not. In fact, it's anything but that.
Fastidious coding is frontloaded work. That is, I'm taking the thing that I know is hardest - keeping my design natural to my problem - and doing that work as soon as I can.
When you do that, code-cleanliness work doesn't start to stack up into a seemingly insurmountable pile.
That psychological effect, alone, is worth the "effort" but there's a subtler, more potent source of value.
Badness compounds on badness. When you let code be bad, you do bad things to get it to work. That makes the code worse.
So, allowing a quality problem to fester not only accumulates redesign work into large chunks but also accumulates work you would never have had to do if you just kept things clean.
Following is a video wherein I spend about an hour cleaning up a test library, among other things. You can think of it as a waste of time or an expression of my perfectionism if you want to, but I would like to offer a different perspective.
What if you watch the video and try to think about all the things that could go wrong if I didn't do that cleanup, this morning?
People sometimes think this is extra work but it's not. In fact, it's anything but that.
Fastidious coding is frontloaded work. That is, I'm taking the thing that I know is hardest - keeping my design natural to my problem - and doing that work as soon as I can.
When you do that, code-cleanliness work doesn't start to stack up into a seemingly insurmountable pile.
That psychological effect, alone, is worth the "effort" but there's a subtler, more potent source of value.
Badness compounds on badness. When you let code be bad, you do bad things to get it to work. That makes the code worse.
So, allowing a quality problem to fester not only accumulates redesign work into large chunks but also accumulates work you would never have had to do if you just kept things clean.
Following is a video wherein I spend about an hour cleaning up a test library, among other things. You can think of it as a waste of time or an expression of my perfectionism if you want to, but I would like to offer a different perspective.
What if you watch the video and try to think about all the things that could go wrong if I didn't do that cleanup, this morning?
Thursday, January 24, 2019
A Friend Asked Why I Don't Have Comments
The answer is simple.
I don't like the way the blog looks with comments enabled. I think it looks ugly with this style.
If people are interested in discussion, I'm sure I can find a solution that isn't visually-jarring.
I don't like the way the blog looks with comments enabled. I think it looks ugly with this style.
If people are interested in discussion, I'm sure I can find a solution that isn't visually-jarring.
Wednesday, January 23, 2019
Intensive Coaching
I'm going through an intensive coaching experience. The idea is that I spend a full ten weeks with a single team.
I'm a little surprised with the outcome. I knew there would be an impact but the team is progressing a lot faster than I, for one, anticipated.
I don't have enough data to attribute that to the intensive experience, yet. It's also a really engaged and interested team and I suspect that has a lot to do with the progress being made.
I think people have a tendency to be a little superstitious in assigning reasons for success or failure. I don't want to contribute to that but, it's easy to see why someone who went through an experience like this one might be convinced it's the only way to coach software developers.
I'm a little surprised with the outcome. I knew there would be an impact but the team is progressing a lot faster than I, for one, anticipated.
I don't have enough data to attribute that to the intensive experience, yet. It's also a really engaged and interested team and I suspect that has a lot to do with the progress being made.
I think people have a tendency to be a little superstitious in assigning reasons for success or failure. I don't want to contribute to that but, it's easy to see why someone who went through an experience like this one might be convinced it's the only way to coach software developers.
Tuesday, January 22, 2019
American Idle
We work a lot, here. We work a lot more than we probably should.
That's not really a problem. Not long ago, where I'm sitting was the frontier. Hard work was necessary to survive and to thrive.
Yet, even in frontier times, people rested. They worked hard and then they rested. Then they worked more.
I think we lost that somewhere along the way. People feel like they need to spend every second working.
The mentality is this:
If you're not busy, you're wasting your time. So get busy.There are many problems with this.
First, you're way more effective for the period of time shortly after you've rested than you are when you've been working for a long time; at least, that's true for most people. So you lose productivity by trying to stay at full utilization. It's a self-defeating proposition from the get-go.
Next, there's the fact that the impulse to work hard continuously suggests there's something fundamentally wrong with your approach. There's a practically-limitless amount of work to be done. Work needs to be managed and sliced into bite-sized pieces with adequate funding. If heroics are required, then the work isn't really being managed. Mismanaged work is nearly-guaranteed to fail.
Finally, there's the fact that work is probably not the best part of your life. I mean, every workplace wants to be a second home, or whatever, but the reality is that most of us have something else that matters more. We have families. We have hobbies. We have charities. Those are typically the reasons why we work in the first place. Working to the detriment of our higher goals is, again, self-defeating.
So if you want to work hard, great. If you want to cannibalize your life to try to get a little more done, spare a few minutes asking yourself way.
The break will probably help you get more done anyway.
Monday, January 21, 2019
Dependencies, Not Levels
The way we teach people to be software developers doesn't make a lot of sense.
It's one of those things that sounds reasonable so long as it is described in vague-enough terms. The idea is that you build up someone's skills slowly, incrementally.
For instance, some people believe that you should start by teaching scripting. Then promote students to procedural coding. The traditional version of object-oriented design follows. Finally, assuming the person you are talking to has enough understanding of software development, you start teaching design patterns.
The same is true of test-driven development. Start with test never. Then move on to test-after. Upgrade to test-first. Promote to TDD and then, ultimately, to organization-level BDD.
Refactoring gets a similar treatment if it gets any treatment at all.
What's really being proposed is ordering alternative ideas by how difficult they are to completely master.
This doesn't make any sense because it sets up a pattern of wasted effort. You start by teaching someone something the wrong way. Then, after they've attained a modicum of mastery in that way, you tell them it's bullshit and they should do something else.
How do we expect people to react?
I'm experimenting with a different pattern: Start with a skill that doesn't have any dependencies and don't worry about mastery. Just help people get enough to start using it, which really isn't that much. As skill in that area improves, it also enables someone to start learning a skill that depends on it.
In software development, given developers who already have basic coding skills, refactoring is the skill with no dependencies. Refactoring enables design because it's way easier to imagine a new design if you have a chance of getting there safely. Design, in turn, enables TDD because it's easier to imagine using tests to drive your development process when you know you can create and refactor to designs that will enable the effort.
It seems like it's working really well.
It's one of those things that sounds reasonable so long as it is described in vague-enough terms. The idea is that you build up someone's skills slowly, incrementally.
For instance, some people believe that you should start by teaching scripting. Then promote students to procedural coding. The traditional version of object-oriented design follows. Finally, assuming the person you are talking to has enough understanding of software development, you start teaching design patterns.
The same is true of test-driven development. Start with test never. Then move on to test-after. Upgrade to test-first. Promote to TDD and then, ultimately, to organization-level BDD.
Refactoring gets a similar treatment if it gets any treatment at all.
What's really being proposed is ordering alternative ideas by how difficult they are to completely master.
This doesn't make any sense because it sets up a pattern of wasted effort. You start by teaching someone something the wrong way. Then, after they've attained a modicum of mastery in that way, you tell them it's bullshit and they should do something else.
How do we expect people to react?
I'm experimenting with a different pattern: Start with a skill that doesn't have any dependencies and don't worry about mastery. Just help people get enough to start using it, which really isn't that much. As skill in that area improves, it also enables someone to start learning a skill that depends on it.
In software development, given developers who already have basic coding skills, refactoring is the skill with no dependencies. Refactoring enables design because it's way easier to imagine a new design if you have a chance of getting there safely. Design, in turn, enables TDD because it's easier to imagine using tests to drive your development process when you know you can create and refactor to designs that will enable the effort.
It seems like it's working really well.
Sunday, January 20, 2019
Saturday, January 19, 2019
The Infinitely-Thin Tightrope
Mike didn't understand what was happening. That was nothing new.
What was different was that he didn't understand his own actions.
He hated Samantha. He despised her arrogance. He found her personality repugnant. Most of the time he interacted with her, he spent thinking he could never see her again and be happy about it.
Conversely, he loved his wife and young son. When apart, Mike often found himself wishing he were with them rather than doing whatever he was doing.
Mike loved his wife and hated Samantha yet he kept finding himself in Samantha's bed. He wanted to be away from Samantha as much as possible but found himself wondering what was the deal when she grew cold and distant.
Samantha had become a ghost walking in human skin. She was pale and jumpy. All the time. She was secretive about what she was doing and for whom.
Mike wondered how badly Kramer had scared her. Was she broken? Would she ever be the same?
...and, most of all, why did he care? He still despised her. She was a disgusting human being...but he also cared.
It was bizarre, having such conflict of feelings.
It was a warm summer's evening. The sun was just barely set, leaving a reddish-amber glow in the sky and casting a thin gray veil over everything.
Mike took a deep breath, absorbing the dryness, warmth, and fragrance of the newborn night as if it could replace the disturbing thoughts running through his head.
He flipped his key around in little circles by spinning his index finger inside the keyring.
It was a disturbingly-quiet walk across the parking lot. No sounds to drown out his thoughts. Just his footsteps on the pavement.
When he got to his car, he barely swung his keys a little too far and they spun off his finger. There was a little "ting" sound as they bounced off the door of his brand new Audi - a birthday gift from his wife - and an abbreviated jingle when they landed on the ground.
Mike sighed and looked closely at his door.
"For fuck's sake," he said. "Really?" The shiny new paint on his shiny new car was marred.
Mike sighed and started to bend down to get his keys but something raised his hackles and his spine stiffened. He narrowed his eyes and peered around without turning his head.
"God damn!" he shouted, leaning in to poke at the fresh ding on his door.
Mike spun around to face the other direction and raised his fists in the air, then repeated: "God damn!"
Quickly, he scanned the parking lot. There was nothing there but he couldn't shake the uneasy feeling.
Eventually, there was nothing to be done about it. He bent down for his keys and, when he stood up, nothing happened. He shrugged.
"Maybe I'm getting paranoid, too," he muttered.
Mike pushed the button to unlock his car. A satisfying "click" told him it was going from locked to unlocked.
He got in the car and started to drive. Everything was dead. It was a quick drive to the parkway, which was basically empty.
Mike decided to really open up his new car and see what she could do. He slammed down on the accelerator and pushed the speed...fifty, sixty, seventy miles an hour.
"Not too fast," said Kramer from the backseat. "You probably don't want to get pulled over, right now."
Mike wanted to jump out of his skin but maintained a semblance of outward calm. He cleared his throat. "Maybe I do," he said. His voice trembled, betraying his veneer of confidence. Nevertheless, he took his foot off the accelerator.
Kramer was barely visible in the rear-view mirror. He was dressed in black from head to toe. Unless you looked closely, you probably wouldn't even notice he was there. He chuckled softly.
"It might not go well, for either of us," said Kramer, light glinting off the rim of his glasses as they passed under a streetlamp. "Even if it did, there would be questions. They'd want to know where you were, recently. They'd want to check with your wife."
Mike pondered the not-so-hidden meaning for a moment, then set the cruise control. "Where are we going?" he asked.
"Just keep going, like you always do."
"Okay."
They drove in silence for a few minutes. Kramer made no effort to continue the conversation.
Eventually, as he was pulling off the Parkway and onto surface streets, Mike asked, "What do you want?"
"It's simple. Samantha knows something. I need to know it, too."
"What makes you so sure?"
"I've been watching you. All of you."
"What makes you think I'll help you."
"That's simple, too." Kramer's teeth shone, revealing a little sneer. "For one thing, I recorded some highlights of your most recent little sleepover with Samantha."
Mike's cheeks reddened. "And?" he asked.
"...and I think you two like each other. Underneath all the hate, that is."
"So?"
"So her life's in danger until whatever she knows is in the right hands."
"Your hands are the right hands?"
"I think they are," said Kramer. "What does Fred think?"
"Your car is dirty. Let's get it washed."
Friday, January 18, 2019
Decoupling from Direction: Named-Lines to Numeric Rays
Please excuse the "NPR host" manner of speech and overall low sound-quality in this video but it's a great refactoring session.
Thursday, January 17, 2019
Choices, Choices, Choices
This is something I learned from the Heath brothers' very good book, Decisive:
If you are making a big decision and you only have two options to start, you're doing yourself a disservice. Start with at least three.
Even if the third one is terrible, you'll probably be happier than you would with two.
Plus, there's always a chance that the effort will yield a better option than you ever could have guessed at first.
Wednesday, January 16, 2019
The Ring
Yesterday I refactored some hokey index-based logic into a circular linked list. It spans two videos: My evening ride home and a late-night coding session.
Tuesday, January 15, 2019
Retroactive Post
On the 15th of January, I missed my first post. I'm setting the time of this post according to when it should have gone out so that it's in the right order and can be looked up but I'm not trying to hide that I missed my mark.
I'm not particularly ashamed of missing a minor goal like posting every day for a year. It's been a really difficult couple of months and even getting as close to that goal as I have was a real accomplishment.
It's important to not chastise yourself when you miss a goal. A goal is a target. Targets get missed. When you miss your target, in most contexts, you just try again. There are cases when that's not true - snipers, lunar landings, and the like - but they are few and far between.
For most of us, it's important to accept that failure is possible and even likely. Instead of lamenting it, we can take it as an opportunity to revise our approach or reinvent our goals.
I'm not particularly ashamed of missing a minor goal like posting every day for a year. It's been a really difficult couple of months and even getting as close to that goal as I have was a real accomplishment.
It's important to not chastise yourself when you miss a goal. A goal is a target. Targets get missed. When you miss your target, in most contexts, you just try again. There are cases when that's not true - snipers, lunar landings, and the like - but they are few and far between.
For most of us, it's important to accept that failure is possible and even likely. Instead of lamenting it, we can take it as an opportunity to revise our approach or reinvent our goals.
Monday, January 14, 2019
It's Going to Be what It's Going to Be
Last week, I had a vision of how I was going to design the networking part of the game I'm writing. This morning, I was all set to execute on that vision.
As I was reviewing the code, before the change, I discovered some things that needed to change. So, instead of doing what I planned, I did what was right. I cleaned up the code.
In the course of my cleanup, I uncovered a better design for the networking part of the game.
There's an important lesson, here. The forces acting on your code are going to be what they are going to be. So let the code be what the forces want it to be.
It probably won't cost you anything and, every once in a while, it grants you an insight of incalculable value.
Literally.
The value of a little discovery like that cannot be calculated because you can't tell how much its absence would have cost you.
Experience, however, allows me to estimate the cost as "a lot".
As I was reviewing the code, before the change, I discovered some things that needed to change. So, instead of doing what I planned, I did what was right. I cleaned up the code.
In the course of my cleanup, I uncovered a better design for the networking part of the game.
There's an important lesson, here. The forces acting on your code are going to be what they are going to be. So let the code be what the forces want it to be.
It probably won't cost you anything and, every once in a while, it grants you an insight of incalculable value.
Literally.
The value of a little discovery like that cannot be calculated because you can't tell how much its absence would have cost you.
Experience, however, allows me to estimate the cost as "a lot".
Sunday, January 13, 2019
Saturday, January 12, 2019
Eyes in All the Shadows
It took several minutes for Adam to regain his composure.
Through his entire crisis, they had not looked away from him. Their expressions were frozen. They simply waited, like a family listening to a doctor rattle off technical details when all they really cared about was the prognosis.
It is important to process things. Process enough, now, then compartmentalize, then process some more, later. That's what he'd learned in his years doing what he did for a living.
He allowed himself a moment to wish she hadn't found it. He let himself worry about the enormity of the news. He spent a few seconds worrying about his own safety and allowed himself to dwell on the ramifications to his mission.
Then he noticed two blank faces staring at him intently.
He allowed himself a moment to wish she hadn't found it. He let himself worry about the enormity of the news. He spent a few seconds worrying about his own safety and allowed himself to dwell on the ramifications to his mission.
Then he noticed two blank faces staring at him intently.
Through his entire crisis, they had not looked away from him. Their expressions were frozen. They simply waited, like a family listening to a doctor rattle off technical details when all they really cared about was the prognosis.
It was one more burden on his shoulders. Two civilians - real civilians, not "civilian" contractors, like himself - who depended on him to carry this the rest of the way.
Their lives were in his hands. Samantha had made it that way by finding the data leak and sharing it with him.
Their lives were in his hands. Samantha had made it that way by finding the data leak and sharing it with him.
Before speaking, Adam took a moment to reflect on the trust Samantha had placed in him. How could she know he was not a part of whatever she found? He could easily have just lied to pass her clumsy little test of authenticity.
As it stood, he didn't have to.
As it stood, he didn't have to.
She had taken a calculated risk. The United States is a big country with a lot of people. It had a big government, also with a lot of people. Statistically-speaking, Adam probably wasn't a traitor. So, she probably just played the numbers.
He began slowly, choosing each word carefully. "You've shown me a lot of trust in sharing this," said Adam. "I won't lie. This could get ugly."
"What's our next move?" asked Fred.
Adam pursed his lips and tried to focus on his chin for a minute.
"I have to think about what to do, next.," said Adam. "This is the kind of problem you can't just report to your commander. It has to be handled carefully..." he reflected on that for a moment and guffawed at the understatement. "Very carefully," he clarified.
Samantha's eyes glistened in the dim light of the closed room. "You don't know who to trust?" asked Samantha.
Adam shook his head. "I don't even know how you decided to trust me."
"So what do we do, now?" asked Fred. He swallowed a gob of nothing then added: "I mean right now."
Adam nodded. "Yeah. Okay. Action items. Stay safe. That's your main job," he said. "Stay safe."
"How do we do that," asked Samantha. "Are we going to some kind of a...a...safe...place?"
Adam shook his head ever so slightly. "Noplace is safe from something like this," he said. "Safe actions is what you need...not a safe place."
"What are those actions?"
"Behave exactly as you did before you found this," said Adam. "Go home, spend time doing the things you did.
"See your girlfriend, Fred. Keep investigating the problem from home in ways you think we don't see. Samantha, keep arranging for your...uh...sleepovers.
"We need to safeguard ourselves because what we know is too valuable to risk losing. That said, we need to quietly and slowly adjust our routines to reduce potential leverage. Create distance...distance keeps you and the things you care about safe.
"No matter what we do, though, there is a chance that things will go south. We need a plan to ensure what we know isn't lost. Ideally, one that ensures our safety. Even a stalemate that stops the leak and keeps us safe is a win, at this point."
"So what's that?"
"I don't know, but I'll start making arrangements for your escape if things get bad."
Adam could see he was losing them. He tried to force a smile but both Fred and Samantha seemed to recoil at whatever emotion he actually rendered.
"What's our next move?" asked Fred.
Adam pursed his lips and tried to focus on his chin for a minute.
"I have to think about what to do, next.," said Adam. "This is the kind of problem you can't just report to your commander. It has to be handled carefully..." he reflected on that for a moment and guffawed at the understatement. "Very carefully," he clarified.
Samantha's eyes glistened in the dim light of the closed room. "You don't know who to trust?" asked Samantha.
Adam shook his head. "I don't even know how you decided to trust me."
"So what do we do, now?" asked Fred. He swallowed a gob of nothing then added: "I mean right now."
Adam nodded. "Yeah. Okay. Action items. Stay safe. That's your main job," he said. "Stay safe."
"How do we do that," asked Samantha. "Are we going to some kind of a...a...safe...place?"
Adam shook his head ever so slightly. "Noplace is safe from something like this," he said. "Safe actions is what you need...not a safe place."
"What are those actions?"
"Behave exactly as you did before you found this," said Adam. "Go home, spend time doing the things you did.
"See your girlfriend, Fred. Keep investigating the problem from home in ways you think we don't see. Samantha, keep arranging for your...uh...sleepovers.
"We need to safeguard ourselves because what we know is too valuable to risk losing. That said, we need to quietly and slowly adjust our routines to reduce potential leverage. Create distance...distance keeps you and the things you care about safe.
"No matter what we do, though, there is a chance that things will go south. We need a plan to ensure what we know isn't lost. Ideally, one that ensures our safety. Even a stalemate that stops the leak and keeps us safe is a win, at this point."
"So what's that?"
"I don't know, but I'll start making arrangements for your escape if things get bad."
Adam could see he was losing them. He tried to force a smile but both Fred and Samantha seemed to recoil at whatever emotion he actually rendered.
"You took a huge risk, sharing what you found. You could have stopped searching when you had an inkling. I'm going to reciprocate that trust. I'm going to give you my real name and the contact info for my commanding officer. Don't use either unless you absolutely need to but, if things go off the rails, head for the La Jolla airforce base. He'll get you in and keep you safe."
Friday, January 11, 2019
Perseverance
Perseverance is assumed to be a good thing. This is probably because most of our success stories include a period of time where someone faced adversity and continued in spite of it.
Yet, the credo "persevere" can easily be used to disguise denial.
Long ago, I tried to launch a product. I had a cool idea and a consultant convinced me that the first thing I needed was a patent.
A business plan was born.
Yet, the credo "persevere" can easily be used to disguise denial.
Long ago, I tried to launch a product. I had a cool idea and a consultant convinced me that the first thing I needed was a patent.
A business plan was born.
- Patent.
- Figure out how to sell it.
- Get rich.
I clung to that plan. I did the first two parts of it, kind of. I invested miles of paper and months of time in writing a patent. Then I figured out there was no way for me to sell what I had invented.
There were people who told me I shouldn't be wasting my time in that way but I couldn't hear them. All I could hear was "give up".
Sometimes we are faced with pivotal moments and, in those moments, we must do the hard thing for the benefit of ourselves and those around us.
It's just that the hard thing isn't always to keep going.
Thursday, January 10, 2019
Advantages of Using Acceptance Criteria as Sole Definition of Scope
A while back, I wrote about using acceptance criteria as the sole definition of scope for a software product. I wanted to expand on how that helps development teams.
It gives developers a clear-cut way of ensuring that all the code they write services some business goal. If you can get rid of it and still clear all your acceptance criteria, you don't need it.
It actually makes writing requirements easier, too, once you get used to it. There's only one way to explain what you want and only one place to look to see what you already have.
Wednesday, January 9, 2019
Keeping It Small
I recently let myself go down a little rabbit hole. I built most of an entire gesture-recognition engine before I realized I only needed two-fingered-drag.
I'm out of it, now, but it's important to avoid going into another one. It would be easy for me to start doing the fun stuff with my little game - adding more features, making it look better, et cetera - but I need to start doing the important stuff, like networking, right away.
This is the hard part. It's not really that hard to convince people that they should do the minimum amount required to get something out the door. A few charts, a quick chat, maybe a case study or two and you're good to go, there.
The hard part is convincing someone that they should be bored in order to achieve that.
Sometimes, the boring stuff is the most important stuff, though. When it comes to product development, few things are more satisfying than actually shipping something. So maybe the boring stuff is less boring and more an exercise in delayed gratification?
Tuesday, January 8, 2019
Excerpt from Live Coding Session
Following is a little monologue I delivered via comments in my live stream.
// I woke up having realized
// again, the problem is an artifact
// of not dissolving the problem into
// enough tiny pieces.
// we need one thing that posts a pending state
// whenever the interior state changes
// we need another thing that expires a interior
// state after a period of time
// we need another thing that transitions to the right
// new state on tap start (for double tap)
//
// cohesion
//
// it's always cohesion
//
// every time you see some other force that looks like
// it's in contention with cohesion, it's really not.
// it's that you don't have enough cohesion...
It's never that you broke things down too far.
Monday, January 7, 2019
The Importance of Deleting
At the end of my ride to my current client's office, I ruthlessly hunted down and destroyed a class I didn't need anymore.
It wasn't doing anything. It wasn't bad. I just wasn't using it anymore.
It was in a category of classes that suggests I might need it, too. So this might seem overly fastidious to some. Maybe they are even right.
My observation is that dead code turns to gangrene remarkably quickly. Removing it costs little and pays off big way more often than the reverse is true.
It wasn't doing anything. It wasn't bad. I just wasn't using it anymore.
It was in a category of classes that suggests I might need it, too. So this might seem overly fastidious to some. Maybe they are even right.
My observation is that dead code turns to gangrene remarkably quickly. Removing it costs little and pays off big way more often than the reverse is true.
Sunday, January 6, 2019
Saturday, January 5, 2019
Blindspot
Samantha caught herself just before the lump in her throat became obvious.
Her fingers trembled, poised over the enter key.
Time seemed to freeze.
It wasn't until her vision began to narrow that she realized she'd been holding her breath the entire time.
Gradually, she tried to let the air trapped in her lungs pass through her lips. She thought she did a pretty good job but, the harder she tried to hold her breath, the harder her lungs fought to breathe of their own accord.
"I take it you've got something," said Eddie.
Samantha's eyes darted in his direction but the rest of her body remained motionless.
He was hunched over his laptop, head cocked slightly to the right. The glow of his computer screen against his face was just barely visible in the dimly-lit room. Eddie continued to type intently. Had he said nothing, there would be no indication he'd seen something.
"Whatever it is, I'm going to find it, eventually," prodded Eddie. He patted a little black box sitting next to his laptop. "If you think you're hiding anything from me, you're wrong. So you might as well just tell me."
Fred cleared his throat and it sounded like he shifted in his seat a few times.
Samantha remained frozen. Eyes transfixed on the man she hadn't thought she'd known in the first place but whose motivations were suddenly called in to question by her revelation.
She tried to speak but her mouth and throat were so dry that her tongue felt like it was welded to the roof of her mouth.
She took a deep breath and drank a full glass of water in a single go.
Her nervousness had failed to garner any additional attention from Eddie and that only seemed to throw Samantha deeper into her self-imposed deadlock.
Finally, she parted suddenly-cracking lips and asked, "Do you," her chin trembled and she bit her lip for control. She took another deep breath and started again. "D- Do you have a...uh...a house?"
"Hmm?" asked Eddie.
"A house...apartment...condo...a shack in the woods. Someplace you stay when you aren't doing," Samantha gestured around the room at all the equipment she didn't recognize, "this?"
Eddie glanced up from his screen for a moment and seemed to consider.
"I have a mailing address, but I'm always going from one assignment to the next. Why?"
"Do you have a...uh...a base you go to, regularly?"
"What? You want to talk to my manager?"
"Yes."
Eddie chuckled, then looked up from his screen for a moment. His nostrils flared and he didn't blink. "Well," he said thoughtfully, "I guess the closest thing I have to that, for a civilian, would be the Airforce base in La Jolla, California. Call the main line and lodge a complaint."
"Is that where your mailing address is?"
Eddie sneered. "La Jolla?" He full-on laughed. "Nobody does this for the money. I can't afford to live there and I wouldn't want to live there if I could."
"I want to send you something without the base knowing. Do I send it to your Langley address?"
Eddie shook his head and chuckled. "Lady, I don't know what game you think you're playing but I'm tired of it. If you want to send me something at my mailing address, I'd have to fly to Reno and drive for six hours to pick it up...whoever you don't want to know whatever you don't want them to know is probably going to notice that. Last chance, Samantha. Tell me what it is you've got."
An enormous sigh of relief escaped Samantha's lips. She felt like collapsing into the back of her chair as every tensed muscle simultaneously relaxed. "Okay," she said, "I'll tell you."
Samantha took another deep breath and added, "It's the receipts."
"First off," interrupted Eddie. "How do you know whatever it is you think you know?" He gestured at Fred and himself with his left hand and added: "We need to reproduce your findings to confirm."
"I started by analyzing short, long, and medium-length trends over the last ten years," said Samantha. "As expected, there was nothing I could find with any of our existing algorithms. The signal seemed to be just regular signal everywhere I looked. Normal shopping. Normal browsing. Normal everything.
"Like I said, though. That was expected. I figured the signal wouldn't matter. So then, I started subtracting the trends out of the aggregates, leaving me with a map of the noise and I started analyzing that, too."
"How?" asked Eddie. Fred smiled as if he knew the response.
"There are some new AI-assisted signal-processing algorithms that specialize in finding patterns in apparent noise. They can do things like highlight the outline of shapes in photographs that were taken in what we would think of as complete darkness. They hadn't helped me when I was analyzing the raw data but that's because the signal was 'too bright'...it was hiding the real answers."
"So you checked the noise?" asked Eddie. "...and that showed the pattern?"
"Kind of. It showed me how the pattern was shaped so that I could train a custom algorithm to pick it out of raw data, despite any stronger patterns."
"What did you find?"
Picking up her rhythm, Samantha answered with "Like I said, it's in the receipts."
"What does that mean?" asked Fred.
"The purchases executed through our storefront-as-a-service offering," replied Samantha. "They mean something."
Eddie was still not looking away from his screen but he nodded gently and persistently to communicate that he was listening. "What do they mean?" he prodded, as gently as his relatively crusty exterior would permit.
Samantha cleared her throat and leaned forward, resting her elbows on the edge of the conference table. "There are about two-hundred people," she said, "who always buy either zero or one of the same seventeen items on an alarmingly-rhythmic schedule."
Eddie stopped typing.
"Typically, four of them daily," she added.
Very slowly, Eddie lifted his face and turned it in Samantha's direction. His never-ending poker face remained but the sloth-like fashion in which he moved hinted at how much energy he was spending on processing what he had just heard and, perhaps, reprocessing what he had heard a few minutes
earlier.
Samantha pressed onward. "Each of the seventeen items is something innocuous and easily justified as a regular purchase, usually artisanal consumables from a mom-and-pop boutique. Following a very-complicated scrambling pattern, each shipping address gets four items a day and each of those four items seems to represent a bit."
Eddie and Fred were transfixed. Eddie had even dropped his poker face. His jaw hung slack. Samantha wondered if he knew what was coming.
"All of this seems to be about moving about one-hundred bytes a day in an incredibly-obfuscated way," said Samantha. "It took a while to crack this - which I had to do to make sure I wasn't crazy - but, after I did, I was able to decode some messages."
"What do they say?" asked Eddie.
"I don't know."
Eddie began to protest with "But -" and was immediately cut off by Samantha.
"I don't know," she emphasized the word "know," then continued with "because I can't read Mandarin Chinese and it just translates to gibberish."
Eddie had dropped all tough-guy pretense. His hand was covering his mouth. "Please, don't tell me," he murmured.
Eddie losing his cool terrified Samantha. That lump started creeping up her throat and she swallowed hard to suppress it. "I plotted a map of the mailing addresses. They're all in the D.C. area."
Fred's face went ghost-white.
Samantha's hands trembled as she pulled the HDMI cable toward her computer. Her eyes were tearing up and the room felt like it was about fifty degrees.
She was practically numb. What she was about to say next terrified her. It scared her so much that she didn't even want to think about it, let alone say it.
She put a map up on the projection.
"Langley. Most of them are in the Langley area."
Her fingers trembled, poised over the enter key.
Time seemed to freeze.
It wasn't until her vision began to narrow that she realized she'd been holding her breath the entire time.
Gradually, she tried to let the air trapped in her lungs pass through her lips. She thought she did a pretty good job but, the harder she tried to hold her breath, the harder her lungs fought to breathe of their own accord.
"I take it you've got something," said Eddie.
Samantha's eyes darted in his direction but the rest of her body remained motionless.
He was hunched over his laptop, head cocked slightly to the right. The glow of his computer screen against his face was just barely visible in the dimly-lit room. Eddie continued to type intently. Had he said nothing, there would be no indication he'd seen something.
"Whatever it is, I'm going to find it, eventually," prodded Eddie. He patted a little black box sitting next to his laptop. "If you think you're hiding anything from me, you're wrong. So you might as well just tell me."
Fred cleared his throat and it sounded like he shifted in his seat a few times.
Samantha remained frozen. Eyes transfixed on the man she hadn't thought she'd known in the first place but whose motivations were suddenly called in to question by her revelation.
She tried to speak but her mouth and throat were so dry that her tongue felt like it was welded to the roof of her mouth.
She took a deep breath and drank a full glass of water in a single go.
Her nervousness had failed to garner any additional attention from Eddie and that only seemed to throw Samantha deeper into her self-imposed deadlock.
Finally, she parted suddenly-cracking lips and asked, "Do you," her chin trembled and she bit her lip for control. She took another deep breath and started again. "D- Do you have a...uh...a house?"
"Hmm?" asked Eddie.
"A house...apartment...condo...a shack in the woods. Someplace you stay when you aren't doing," Samantha gestured around the room at all the equipment she didn't recognize, "this?"
Eddie glanced up from his screen for a moment and seemed to consider.
"I have a mailing address, but I'm always going from one assignment to the next. Why?"
"Do you have a...uh...a base you go to, regularly?"
"What? You want to talk to my manager?"
"Yes."
Eddie chuckled, then looked up from his screen for a moment. His nostrils flared and he didn't blink. "Well," he said thoughtfully, "I guess the closest thing I have to that, for a civilian, would be the Airforce base in La Jolla, California. Call the main line and lodge a complaint."
"Is that where your mailing address is?"
Eddie sneered. "La Jolla?" He full-on laughed. "Nobody does this for the money. I can't afford to live there and I wouldn't want to live there if I could."
"I want to send you something without the base knowing. Do I send it to your Langley address?"
Eddie shook his head and chuckled. "Lady, I don't know what game you think you're playing but I'm tired of it. If you want to send me something at my mailing address, I'd have to fly to Reno and drive for six hours to pick it up...whoever you don't want to know whatever you don't want them to know is probably going to notice that. Last chance, Samantha. Tell me what it is you've got."
An enormous sigh of relief escaped Samantha's lips. She felt like collapsing into the back of her chair as every tensed muscle simultaneously relaxed. "Okay," she said, "I'll tell you."
Samantha took another deep breath and added, "It's the receipts."
"First off," interrupted Eddie. "How do you know whatever it is you think you know?" He gestured at Fred and himself with his left hand and added: "We need to reproduce your findings to confirm."
"I started by analyzing short, long, and medium-length trends over the last ten years," said Samantha. "As expected, there was nothing I could find with any of our existing algorithms. The signal seemed to be just regular signal everywhere I looked. Normal shopping. Normal browsing. Normal everything.
"Like I said, though. That was expected. I figured the signal wouldn't matter. So then, I started subtracting the trends out of the aggregates, leaving me with a map of the noise and I started analyzing that, too."
"How?" asked Eddie. Fred smiled as if he knew the response.
"There are some new AI-assisted signal-processing algorithms that specialize in finding patterns in apparent noise. They can do things like highlight the outline of shapes in photographs that were taken in what we would think of as complete darkness. They hadn't helped me when I was analyzing the raw data but that's because the signal was 'too bright'...it was hiding the real answers."
"So you checked the noise?" asked Eddie. "...and that showed the pattern?"
"Kind of. It showed me how the pattern was shaped so that I could train a custom algorithm to pick it out of raw data, despite any stronger patterns."
"What did you find?"
Picking up her rhythm, Samantha answered with "Like I said, it's in the receipts."
"What does that mean?" asked Fred.
"The purchases executed through our storefront-as-a-service offering," replied Samantha. "They mean something."
Eddie was still not looking away from his screen but he nodded gently and persistently to communicate that he was listening. "What do they mean?" he prodded, as gently as his relatively crusty exterior would permit.
Samantha cleared her throat and leaned forward, resting her elbows on the edge of the conference table. "There are about two-hundred people," she said, "who always buy either zero or one of the same seventeen items on an alarmingly-rhythmic schedule."
Eddie stopped typing.
"Typically, four of them daily," she added.
Very slowly, Eddie lifted his face and turned it in Samantha's direction. His never-ending poker face remained but the sloth-like fashion in which he moved hinted at how much energy he was spending on processing what he had just heard and, perhaps, reprocessing what he had heard a few minutes
earlier.
Samantha pressed onward. "Each of the seventeen items is something innocuous and easily justified as a regular purchase, usually artisanal consumables from a mom-and-pop boutique. Following a very-complicated scrambling pattern, each shipping address gets four items a day and each of those four items seems to represent a bit."
Eddie and Fred were transfixed. Eddie had even dropped his poker face. His jaw hung slack. Samantha wondered if he knew what was coming.
"All of this seems to be about moving about one-hundred bytes a day in an incredibly-obfuscated way," said Samantha. "It took a while to crack this - which I had to do to make sure I wasn't crazy - but, after I did, I was able to decode some messages."
"What do they say?" asked Eddie.
"I don't know."
Eddie began to protest with "But -" and was immediately cut off by Samantha.
"I don't know," she emphasized the word "know," then continued with "because I can't read Mandarin Chinese and it just translates to gibberish."
Eddie had dropped all tough-guy pretense. His hand was covering his mouth. "Please, don't tell me," he murmured.
Eddie losing his cool terrified Samantha. That lump started creeping up her throat and she swallowed hard to suppress it. "I plotted a map of the mailing addresses. They're all in the D.C. area."
Fred's face went ghost-white.
Samantha's hands trembled as she pulled the HDMI cable toward her computer. Her eyes were tearing up and the room felt like it was about fifty degrees.
She was practically numb. What she was about to say next terrified her. It scared her so much that she didn't even want to think about it, let alone say it.
She put a map up on the projection.
"Langley. Most of them are in the Langley area."
Friday, January 4, 2019
Cleaning Up Unity gestures library for escape tiles
Today, I cleaned up my little Unity gestures library.
I had already factored the system to recognize the State pattern implicit in the problem but I had left a little bit of the logic tangled together and driven by quasi-implicit state codes.
What I did on my ride back from my current client, today was get rid of the rest of the snarled, procedural logic.
I had already factored the system to recognize the State pattern implicit in the problem but I had left a little bit of the logic tangled together and driven by quasi-implicit state codes.
What I did on my ride back from my current client, today was get rid of the rest of the snarled, procedural logic.
Thursday, January 3, 2019
Wednesday, January 2, 2019
A Continuation of Yesterday's Theme
In continuing to build my Unity gestures library, I am also continuing to experiment with developing all code in the tests and extracting as needed.
Tuesday, January 1, 2019
Interesting Trick I'm Trying
I saw a tweet titled something like "TDD as if you mean it". I'm sorry to whoever posted it. I can't find the link, now. The gist was that you start with only your tests and extrude a design from passing tests.
I'm experimenting with it and it's kind of interesting.
I think it might seem even less comfortable for someone who hasn't made the TDD mindset shift than "regular" TDD.
I'm digging it, though.
Subscribe to:
Posts (Atom)