elfs: (Default)
[personal profile] elfs
Okay, this is probably obvious to everyone else except me. The company I work for is the maker of mighty fine storage appliances with some really nice price/performance breakpoints. My little contribution to this endeavor is (don't laugh) the entire freaking thing. I know nothing about filesystems and kernel hackery, and my knowledge of distributed systems is strictly functional. But what the customers sees is my work, because I do the user interface development. I write the code that talks to all of the things deep in the dark heart of the machine and takes those evil whispers and turns them into bright and meaningful pictures the human mind can swallow. If that breaks down, it's my fault-- and the entire company can lose a sale on my work alone. I am the front door, the face, the handshake of our flagship product. There are days when my braincells quail at the thought.

This morning, I was informed that one of the servers on our system does not actually need to be restarted when some of the configuration file changes. This is not what I was told initially. So now, instead of one configuration prototype file, I needed two: one with the changes that required a restart (the global data), and one with the changes that didn't (local data). I thought this was going to be a ton of grunt work to make this all work the way they wanted and to put it back into the UI.

It took four lines of code.

It required no changes in the UI.

Why? Because I wrote it correctly the first time. I wrote a model of the configuration file as it should be presented to the user, and then the UI consists of views (different ways of twiddling the data in the model to show it) and controllers (various ways of taking data from the user and twiddling the entries in the model). There were two collections of functions in the model: one for getting and setting the globals, one for getting and setting the locals.

The fix? Add a second pair of lines to open and read in the local data, leaving the original only to read in the global. Fix the local functions to refer to the local data. Don't change the interface to the model, and no changes are needed in any clients, including the UI.

I know, to those of you who don't code, I may as well be writing Cantonese. To those of you who do, this seems freakin' obvious. But so many people-- professional programmers-- don't code this way, and I have way too often had to pick up the pieces afterwards. To me, this is important: I have figured out how to program correctly, as opposed to cleverly. And it makes all the difference.
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

elfs: (Default)
Elf Sternberg

December 2025

S M T W T F S
 12345 6
78910111213
14151617181920
21222324252627
28293031   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Dec. 27th, 2025 03:55 pm
Powered by Dreamwidth Studios