tag:antonioyon.com,2013:/posts The Greater Fool 2018-01-15T13:33:32Z ant tag:antonioyon.com,2013:Post/658608 2014-02-27T03:48:45Z 2018-01-15T13:33:32Z Unpopular ideas and why they're worth protecting

I've been thinking a lot about the situation in the SW United States. You know the one, Senate Bill 1062 which was passed by the Arizona Legislature last week and most recently vetoed by Arizona Governor Jan Brewer, ironically, at the behest of at least three state senators who "made a bad decision in a rushed process." The process was pandering to the state's constituency that no longer thinks the right is far right enough. The bill, which at two pages in length is a nice contrast to the usual Federal bills that obfuscate by expanding to thousands of pages, allows for the "Exercise of religion [which] means the PRACTICE OR OBSERVANCE OF RELIGION, INCLUDING THE ability to act or refusal to act in a manner substantially motivated by a religious belief, whether or not the exercise is compulsory or central to a larger system of religious belief." Of course that is meant to be a shield against litigation and, in effect, allowing American business to discriminate. 

At first, I had the same general reaction of as a lot of the world; one of shock and dismay at the seemingly backwards step away from the tolerance and compassion that this country has worked so hard for in the last half-century. Upon further reflection, however, I can understand it. I don't support it by any measure. But I can see the value of a government that would allow such unpopular opinions to not only exist but be heard and legislated. Change only occurs if unpopular opinions are allowed to be disseminated and considered. That is how progress is defined. Benjamin Franklin stated that dissent is the highest form of patriotism. No one is forced to live in Arizona, Massachusetts, California, Texas nor any state which upholds strongly held beliefs on one side of the sociopolitical spectrum or another. In our republic democracy, we are free to live, vote, or legislate to our own values. And if Governor Brewer's veto stands, isn't that democracy, complete with checks and balances at work?

Antonio Yon
tag:antonioyon.com,2013:Post/580440 2013-05-22T04:42:34Z 2014-02-26T06:05:24Z Pixar leveraged Moore's Law to create Toy Story and now Google is following their plan
Toy Story 3 trailer-002

image courtesy: Bill Toenjes

A terrific yarn from Alvy Ray Smith, one of the co-founders of Pixar about how they knew they could create Toy Story, given enough time and resources in the 1970s. They knew that Pixar would have to spend its time building and innovating hardware instead of making movies in the early years in order to help Moore's Law along the way.

An interesting sidenote is how Moore's Law actually works (computing gets an order of magnitude better every five years) and why the intervening years matter (because the thought process to imagine those gains have to be acquired). Consequently, what Pixar did for movies is what Google is trying to do with the web. That's why they are building Android and Chrome, which are noticeably heading towards convergence. Google wants to own the web and everyone who interacts on/with/through it. They are predicting a future where everyone utilizes the ubiquitous cloud to do things we aren't even currently doing at all.

In order to imagine the computing paradigm of 2020, Google has to push the evolutionary crank around one cycle at a time. That's why they marketed their new Chromebook Pixel as the device for what's next. We don't know what's next but Pixel has to be built to "gain the courage, the insight, and the engineering mastery to proceed to the next step."

Now, I really want one of these.

Antonio Yon
tag:antonioyon.com,2013:Post/580109 2013-05-20T22:31:33Z 2013-10-08T17:25:35Z Flickr tries again to be relevant by offering 1TB free for all users

I've been a flickr user since 2005 though, I let my pro membership lapse about 3 years ago. I stopped paying for it because it wasn't useful or relevant anymore. Flickr once defined social media long before twitter or facebook were dreamed of. Then Yahoo! came and acquired them. I thought it was a good thing at first. However, it didn't take long until it was obvious Yahoo! had bigger problems that keeping flickr afloat. They basically let a gold mine fall through their grasp as they let user after user leave with hard feelings due to crazy administrative stuff like deleting people's uploads to simple atrophy by letting their mobile apps become stale.

They were first (or close enough) in creating communities of users to contribute and engage in meaningful ways. They were first to offer 'unlimited' storage even if you didn't pay, they kept your images around so that whenever you came back, they would be there waiting for you. They were first in building quality API to interact with other services that people use. They were even first among the vowel droppers of app naming. All of these advantages meant nothing in a few years. I have tried 500px and SmugMug as replacements and none of them felt as seamless in terms of sharing. I loathed uploading directly to facebook but I eventually pulled the Flickr-Facebook integration since the mobile app sucked so bad.

So here we are, in 2013, as Melissa Mayer attempts to buy their way back to relevance. They acquired tumblr today, which I recently began using after choosing the 'Betamax/MiniDisc/HD-DVD' option in Posterous way back when those two were competitors and before twitter acquired Posterous and let that platform wither and die. Another attempt to get back in the game, they've offered 1TB (yes that's 537,731 6.5 Mpx images as their new landing page eloquently reminds me) gratis for all users. So all my images are back and hopefully they can get the photographers and artists back and make this platform a player again. I'm in.

Antonio Yon
tag:antonioyon.com,2013:Post/441703 2013-04-22T04:28:07Z 2013-10-08T16:56:12Z Shells, Terminals, and tmux, oh my!

I've been working in a lot of non-microsoft development lately, namely the xAMP stack. Trying to find a suitable development environment has been a challenge. I've tried Eclipse, Netbeans, MAMP, MacVim and found all of them wanting in some fashion or another. It's either too bloated or slow or just feels wrong. Finally this weekend, I was determined to get back to the root and use Terminal (see what I did there?)

Learning to go CLI after a career in IDE is somewhat intimidating. Luckily, I started learning this stuff in the *nix heyday of the early nineties (I remember reading on USENET that some Finnish guy name Linus was going to port unix to the x86 platform). So I was at least comfortable in vi and bash, if not proficient. Started with plain ole Terminal and quickly moved to iTerm2 and quickly built tmux and I was off. I could do most things on the CLI, from creating directories to vim to executing the occasional sudo make install to get stuff running. 

Ironically, the most taxing thing to learn how to do was to copy a directory and all its contents to a new directory. I tried copydir and cpdir without any success. With a little help from my favorite search engine, I found a nice unix command line primer on ibm's site of all places. If you ever need to copy the contents of a directory from one to another, here it is:

tar cf - /path/to/original |  \
  (mkdir -p /path/to/copy; cd /path/to/copy; tar xvf -)

I'm sure there will be more. Now tomorrow I have to switch back to Windows and MS development. I hope I remember how to start Visual Studio.
Antonio Yon
tag:antonioyon.com,2013:Post/431851 2012-11-20T00:33:00Z 2013-10-08T16:54:08Z Key stuck in ignition (or how did we get by before the Internet)

Tonight, I came home and pulled into the driveway as usual and put the tranny in park and turned off the ignition. I've done this a thousand times in my 2005 POS Ford Focus. Pull in, put it in park, turn off, take key, leave. However, tonight, the key did not come out. It felt like I could not turn it all the way to the 0 off position. Turn the ignition back on; start the car; put the transmission in various gears. No luck, the key would not come out.

My first clue to trouble was that I could shift the transmission out of Park without stepping on the brake first to release the Shift/Lock interlock that prevents folks from shifting the car into a moving gear without realizing the consequences and having your foot on the brake pedal. There's a spot next to the shift lever to unlock the interlock device if it's stuck but I had the opposite problem. It was stuck off.

Pull out the smartphone, a quick google search brings me to this page. I push the collar under the shifter back up after it's been placed in Park and et voila, key comes out. Seriously, what did folks do before the Internet. Some folks may ask their preferred supreme consciousness for answers when they do not know the answer. I ask Google. QED

Antonio Yon
tag:antonioyon.com,2013:Post/431854 2012-11-03T14:26:00Z 2013-10-08T16:54:08Z The cracks are starting to form...
via bgr.com

via bgr.com

For all the bravado behind the idyllic synergy behind the Steve Job's Reality Distortion Field, the cracks are beginning to form after his death. These aren't the first signs. I think the message has changed significantly around their core products. Under Steve's rule, we never would have seen an iPad that was thicker, even marginally, than its predecessor. There would be no discussion of A5, A6, O69 processors; Steve preferred to keep those details away from the consumer.

But now, there's political chaos reminiscent of actual corporations rather than the (Walt) Disney-like transcendance that typifies a company with more cash than Amazon, Microsoft, and the US government put together. The SVP of iOS, Scott Forstall, and SVP of retail, John Browett, have been canned and the SVPs of Design, Jonny Ive, and Technology, Bob Mansfield have taken on additional responsibilities. (Even un-retiring in Mansfield's case.

Antonio Yon
tag:antonioyon.com,2013:Post/431875 2012-10-06T13:51:00Z 2013-10-08T16:54:08Z Why Holbrook missed the spirit if not the letter of the infield fly rule
When a rule is barely understood, that’s a problem. When a rule is applied in seemingly counter-intuitive fashion, that’s a problem. When a rule causes fans to flip out, littering the field with debris and causing an 18-minute delay, that’s a problem.

Too bad for MLB that this happened on a one-game wildcard play-in format. Too bad for the Braves for not winning their division and making this point moot. Too bad for the Cards a tainted victory when it may not have made a difference. Too bad for the umps that this happened less than a month after the NFL interception-touchdown.

Antonio Yon
tag:antonioyon.com,2013:Post/431890 2012-07-20T14:57:00Z 2013-10-08T16:54:09Z Backbone.js Is Not An MVC Framework

There Are No Controllers In Backbone

There simply aren’t. In spite of the documentation saying that routers or view may be sort of maybe almost kind of close to some of what a controller might do, there are no controllers. It’s not a construct that exists in the backbone namespace, and there’s no implementation that represents what a controller does, architecturally.

A router is not a controller. It’s a router. A view is not a controller. It’s a view. Yes, both routers and controllers share some of what a traditional MVC framework would call a controller. No, neither of these is a controller.

More MVP Than MVC

I’ve spent 5 years building MV* family applications in thick-client / GUI systems (Windows / WinForms / WinMobile) and on the web (Rails, ASP.NET, ASP.NET MVC, etc). Backbone clearly fits in to this family, but it’s also clearly not MVC. My opinion says that it’s closer to MVP, where the backbone view is closer to a P (presenter) and the HTML/DOM is the V (view).

Consider this picture of an MVC process flow (from Wikipedia):


Here, the models contain data which is used to populate views. Actions that a user initiates are handled by the controller which processes the request and updates the models. The models are then fed back to the views and the cycle starts over. It’s cyclical in nature.

And now consider this picture of an MVP process flow (from LessThanDot.com):


Notice the difference? Right – it’s not circular. That’s the big difference between MVC and plain-jane MVP (a.k.a. “passive view“). MVP does not work in a circular fashion the way MVC does. Instead, it relies on a presenter (the “P” in MVP) to be the coordinating brains of the operation. The presenter in an MVP app is responsible for taking the data from the models and stuffing it in to the views. Then when an action is taken on the view, the presenter intercepts it and coordinates the work with the other services, resulting in changes to models. The presenter then takes those model changes and pushes them back out to the view, and the elevator of moving data up and down the architectural stack begins again.

Does the idea and responsibility of a presenter sound familiar when thinking about Backbone? It should… it fits almost concept for concept with Backbone’s views, in my mind. But that doesn’t mean Backbone is an MVP implementation, either. It only means that views should be thought of as presenters, not controllers.

A great reminder on why backbone.js is not a MVC (nor MVVM, MVP) framework. If anything, it's best described as a MOVE framework. Models that represent the data or nouns of your application. Operations that represent the verbs of your operations. Views that combine the nouns and verbs and present them to the the user. Finally, there are events that bind all the other pieces together and allows for a common communication channel between them.

Antonio Yon
tag:antonioyon.com,2013:Post/431921 2012-06-13T14:56:00Z 2013-10-08T16:54:09Z Flip your JavaScript Switch

No one likes code conditionals, right? They're difficult to read, extend, and maintain; primarily because they intermingle data with logic. They're why we put up with bloated IOC containers, just to be able to avoid using switch and nested if statements. In JavaScript, we have a better way. Here's a typical switch statement in JS:

var label = switch (dataTypeId) {
case 'revenue' : 'Thousands of USD';
case 'census' : 'Number of Customers';
case 'inventory' : 'Hundreds of Units';
default: '';

So we have to deal with ubiquitous break token, the extra case structure, and lengthy code bloat to make a simple decision. Got code smell? Here's the alternative, use object prototypal extension and JSON interpretation to create a hash instead.

var labelOptions = {
'revenue' : 'Thousands of USD',
'census' : 'Number of Customers',
'inventory' : 'Hundred of Units'
var label = labelOptions[dataTypeId] || '';

Et voila! We have separation of concerns, data and logic. We have easy extension by adding another property to our labelOptions object. We have more streamlined code without intermingled execution tokens and is easier to grok. Thanks to JavaScript's treatment of functions as data type, you could even return functions instead of simple expressions. So before you reach for that switch construct again, think about hashing instead.

Antonio Yon
tag:antonioyon.com,2013:Post/431925 2012-06-01T13:19:00Z 2013-10-08T16:54:09Z 25 years of HyperCard—the missing link to the Web
I grew up in a box-centric culture at Apple. If I'd grown up in a network-centric culture, like Sun, HyperCard might have been the first Web browser. My blind spot at Apple prevented me from making HyperCard the first Web browser.

As the 25th anniversary of HyperCard approaches, ars technica takes a look back at the cool little program that could. I remember being a college freshman with my first Macintosh (Classic) in 1990 trying to figure out this desktop and GUI. HyperCard was instrumental in helping me understand this computing paradigm. Being able to put media and content on each Card and linking them into stacks.

Of course, as a comic book geek at the time, my first task was to catalog my collection. After some two months of effort, in between lectures, parties, and sleep, I finally had my first HyperCard array of my collection of New Mutants, Batman, and Grendel. I had fields for issue number, date, condition. How I longed for a way to capture an image of the actual book!

So on August 11, 2012, please join me in pouring one out for HyperCard which died in 2004 and its creator Bill Atkinson lamented the above-referenced quote to what it could have been.

Antonio Yon
tag:antonioyon.com,2013:Post/431942 2012-05-17T14:50:00Z 2013-10-08T16:54:09Z Are you a brogrammer and is that a bad thing?
"I think what has changed," agrees my Anonymous Female Tech Authority, "is that engineers are thought of as awkward tech nerds with glasses. And now they are beer-slugging dudes who stare at sales ladies' boobs."
via gizmodo.com

The recent run on brogrammers and their taking over of the tech space is greatly exaggerated. Just like most media-spawned stories during an election year, the truth is sometimes lost in search of good headline. The enterprise software space has been rife with so-called brogrammers for years. But now that they've reached the start-up world that's the darling of the media, people have noticed. Bottom line, a brogrammer is not a bro and a bro would never survive the pace of the start-up lifestyle.

Antonio Yon
tag:antonioyon.com,2013:Post/431959 2012-05-16T18:44:00Z 2013-10-08T16:54:10Z An awesome talk on Dissonance Theory

Why people retreat to their original opinions when provided evidence that contradicts that position. This lesson is crucial on how to effectively influence others and reconcile our morality and judgement. We have to live with dissonance. "When a friend makes a mistake, the friend remains a friend and the mistake is still a mistake."

Antonio Yon
tag:antonioyon.com,2013:Post/431963 2012-04-24T20:57:00Z 2013-10-08T16:54:10Z Apple Reports Second Quarter Results
Gross margin was 47.4 percent compared to 41.4 percent in the year-ago quarter

That's all you need to know. Nearly half of all AAPL's revenue is profit. Net Profit is increased 94% Year-over-year. Wow!

Antonio Yon
tag:antonioyon.com,2013:Post/431965 2012-04-23T20:42:00Z 2013-10-08T16:54:10Z Real life grown-up August Gloop

Joey Chestnut has nothing on Alexander Valov, pictured, the winner of Moscow's caviar eating contest. Held on April 20, 2012, the contest challenges eaters to consume 500 grams (a little over 1 pound) of the pricey preserved sturgeon eggs in the shortest time period. That's roughly a CLS550 Coupe Sasha is shoveling down his gullet there. Capitalism is alive and well in Russia, my friends.

Antonio Yon
tag:antonioyon.com,2013:Post/431980 2012-04-13T18:06:00Z 2013-10-08T16:54:10Z This is how every software company should be run
At a lot companies, this is where you’d see me writing something like, “so I’ve decided to leave $COMPANY, take a sabbatical, and then join $OTHER_COMPANY to find new challenges.” At Fog Creek, that’s not how it works. Joel and Michael have a strong attitude that good developers should be rewarded as developers. When I went to them and told them that I wanted to get new experiences and get back into the writing part of writing software, they were really happy to make that happen.

There's a lot that Joel Sposky has done for the software industry but I think this is one of the most significant. To reward technical people with technical responsibilities. Making a great developer into a mediocre manager costs the organization double. Tying compensation to number of direct reports is a non-starter strategy in the software business. And just about everyone is in the software business these days.

Antonio Yon
tag:antonioyon.com,2013:Post/432014 2012-04-12T13:16:00Z 2013-10-08T16:54:10Z This line of argument is how we got the TSA, and how they squandered billions fondling balls and confiscating nail clippers

Testing like the TSA David Apr 11

84 comments Latest by Cássio Marques

When developers first discover the wonders of test-driven development, it’s like gaining entrance to a new and better world with less stress and insecurity. It truly is a wonderful experience well worth celebrating. But internalizing the benefits of testing is only the first step to enlightenment. Knowing what not to test is the harder part of the lesson.

While as a beginner you shouldn’t worry much about what not to test on day one, you better start picking it up by day two. Humans are creatures of habit, and if you start forming bad habits of over-testing early on, it will be hard to shake later. And shake them you must.

“But what’s the harm in over-testing, Phil, don’t you want your code to be safe? If we catch just one bug from entering production, isn’t it worth it?”. Fuck no it ain’t, and don’t call me Phil. This line of argument is how we got the TSA, and how they squandered billions fondling balls and confiscating nail clippers.

Tests aren’t free (they cost a buck o’five)
Every line of code you write has a cost. It takes time to write it, it takes time to update it, and it takes time to read and understand it. Thus it follows that the benefit derived must be greater than the cost to make it. In the case of over-testing, that’s by definition not the case.

Think of it like this: What’s the cost to prevent a bug? If it takes you 1,000 lines of validation testing to catch the one time Bob accidentally removed the validates_presence_of :name declaration, was it worth it? Of course not (yes, yes, if you were working on an airport control system for launching rockets to Mars and the rockets would hit the White House if they weren’t scheduled with a name, you can test it—but you aren’t, so forget it).

The problem with calling out over-testing is that it’s hard to boil down to a catchy phrase. There’s nothing succinct like test-first, red-green, or other sexy terms that helped propel test-driven development to its rightful place on the center stage. Testing just what’s useful takes nuance, experience, and dozens of fine-grained heuristics.

Seven don’ts of testing
But while all that nuance might have a place in a two-hour dinner conversation with enlightened participants, not so much in a blog post. So let me firebomb the debate with the following list of nuance-less opinions about testing your typical Rails application:

  1. Don’t aim for 100% coverage.
  2. Code-to-test ratios above 1:2 is a smell, above 1:3 is a stink.
  3. You’re probably doing it wrong if testing is taking more than 1/3 of your time. You’re definitely doing it wrong if it’s taking up more than half.
  4. Don’t test standard Active Record associations, validations, or scopes.
  5. Reserve integration testing for issues arising from the integration of separate elements (aka don’t integration test things that can be unit tested instead).
  6. Don’t use Cucumber unless you live in the magic kingdom of non-programmers-writing-tests (and send me a bottle of fairy dust if you’re there!)
  7. Don’t force yourself to test-first every controller, model, and view (my ratio is typically 20% test-first, 80% test-after).

Given all the hundreds of books we’ve seen on how to get started on test-driven development, I wish there’d be just one or two that’d focus on how to tame the beast. There’s a lot of subtlety in figuring out what’s worth testing that’s lost when everyone is focusing on the same bowling or bacon examples of how to test.

But first things first. We must collectively decide that the TSA-style of testing, the coverage theater of quality, is discredited before we can move forward. Very few applications operate at a level of criticality that warrant testing everything.

In the wise words of Kent Beck, the man who deserves the most credit for popularizing test-driven development:

I get paid for code that works, not for tests, so my philosophy is to test as little as possible to reach a given level of confidence (I suspect this level of confidence is high compared to industry standards, but that could just be hubris). If I don’t typically make a kind of mistake (like setting the wrong variables in a constructor), I don’t test for it.

Great sanity check by David of aaaa37signals discussing the cost of testing and chasing 100% coverage. While I love the analogy to the TSA, I'm not so sure code coverage isn't a noble goal, at least in the enterprise software realm. To me, the real value of unit tests is not protecting the code from mistakes I typically make but rather the mistakes that the next developer may make.
By the time, code reaches production and needs to be refactored, it has undergone many (many) iterations, and hopefully, is concise, succinct, and descriptive enough to be maintainable. What isn't always obvious (though, probably visible in some version) are the multiple layers of intention that got to that end. Unit tests are one window into that thought process. Ends and means are often different when it comes to code.

Antonio Yon
tag:antonioyon.com,2013:Post/432031 2012-03-24T17:57:00Z 2013-10-08T16:54:10Z The Free Universal Construction Kit

How awesome is this? Having loved Legos as a kid and seeing all the new generation of construction toys my boys have to play with today, these are a dream come true. Now we can mate Tinkertoys to Legos to Lincoln Logs all in the same piece! The Free Universal Construction Kit is a set of 80 interoperability adapters between 10 popular construction toys including the aforementioned sets.

They're also available as download if you have your own 3-D printer. Now to I finally have a reason to buy a 3-D printer.

Antonio Yon
tag:antonioyon.com,2013:Post/432034 2012-03-15T18:00:00Z 2013-10-08T16:54:10Z Software is the future

I've heard many times how software and the people (architects, designers, developers, testers, et al) that make it happen is the currency of the future. How companies and industries will have to learn to do more with less and make up the difference with software. The other side of that equation see it that companies are replacing people with robots and processes. So how are we, the implementers of software, supposed to operate in order to be most effective? The Agile process has taught us our goal should not be to create perfect software but to gather feedback to eliminate the bad software. Well, what if those giving the feedback are incentivized to not give genuinely useful feedback since it's quite possibly their job they are eliminating?

My task as a developer is to decompose a complex problem into easily solved or solvable problems that limited computer logic can accomplish that task. I can spend the time to learn the business domain as well as the back of my hand or, more often, rely on business analysts, product owners, subject matter experts to fill in that gap. The problem that I've seen in more than one Line-Of-Business application is that those people may not be in the best position to offer constructive feedback. Professionals, which is anyone who gets paid to perform a task, want to feel valued. They want to be the keeper of the "secret sauce" that makes the machine work so well. They don't want their contributions reduced to the sum of its elementary parts. It devalues their effort, experience, and training. They don't want to see their legion reduced or eliminated by process or software.

That is the single greatest hurdle to producing quality effective software. We are using requirements from sources that have no incentive to produce quality or even valid requirements. By de-humanizing the process and workflow, we de-incentivize the very people we are trying to help.

Antonio Yon
tag:antonioyon.com,2013:Post/432052 2012-03-14T17:47:00Z 2013-10-08T16:54:11Z The Daily Mash - Why I am leaving the Empire, by Darth Vader
I hope this can be a wake-up call. Make killing people in terrifying and unstoppable ways the focal point of your business again. Without it you will not exist. Weed out the morally bankrupt people, no matter how much non-existent Alderaan real estate they sell. And get the culture right again, so people want to make millions of voices cry out in terror before being suddenly silenced.

If I had Galactic Moon Coin for every time I've sound the culture alarm at a company...

Antonio Yon
tag:antonioyon.com,2013:Post/432069 2012-01-20T13:54:00Z 2013-10-08T16:54:11Z My kind of bowling

He's got great form! He must have incredible triceps.

Antonio Yon
tag:antonioyon.com,2013:Post/432079 2012-01-12T03:01:00Z 2013-10-08T16:54:11Z Live to eat or eat to live?
And of course he doesn't just eat it...He has to eat it in my face.

I grew up in an ethnic household, and a poor one at that, so we ate any and everything. From Spam fried rice to oxtail stew to duck tongues to ham hocks to thousand-year-old eggs. My wife is from the mid-west where the dominant flavor profile is bland.

We have learned to compromise but it wasn't an easy road. On one of our early meals together, we went to a Tuscan restaurant where the bread service was accompanied by extra-virgin olive oil. She was horrified! During an extended stay with her family, I learned the multitude of ways that ground beef, pasta, and Campbell's Cream of Chicken soup can be combined into a lifetime of "hot dishes."

Today, we still have some ground rules. She won't try any seafood and I've managed to learn to love the congealed salad. Still, the thought of a guys-with-unadventurous-wives supper club is piquing my interest.

Antonio Yon
tag:antonioyon.com,2013:Post/432113 2012-01-11T22:54:00Z 2013-10-08T16:54:11Z When is null not null?

In JavaScript, that's when. Say you have an object in C# like Person with string properties for FirstName and LastName. Something like this:

public class Person
    public string FirstName { get; set; }
    public string LastName { get; set }

Those properties are, of course, nullable.  In JavaScript, an instance of that object might look something like this:


That's what the JSON symbol would look like. Now if you wanted to set the FirstName to null and pass that object back to some controller on the server-side code, you might expect something like this:


Well, we came across this today. We passed the above JSON through the MVC.net ModelBinder and this is what came out on the server-side:

+ FirstName = "null"
+ LastName = "Yon"

Wait, what!?! A little digging reveals that <em>null</em> in JavaScript is a special object with type of object. Somehow the default ModelBinder interprets that to be a string and infers that we really wanted "null" instead of null. What we wanted, in fact, was undefined instead. That is a special value whose type is "undefined." So passing this JSON


will achieve the desired effect. It's a simple concept and a subtle difference but a potential gotcha, nonetheless.

Antonio Yon
tag:antonioyon.com,2013:Post/432135 2012-01-10T22:30:19Z 2013-10-08T16:54:12Z What does Web-enabled really mean? One of the projects I'm working on is to build the v.next of a successful LOB client-server desktop application (nee winform). My company recognizes the ubiquity of the Internet and the mobile paradigm, so the v.next means web-enabled and within a browser. We are not porting to application, ie. rewriting it in HTML/JavaScript but rather designing for a new platform. It's tempting to take the existing User Experience and translate it to the browser. Certainly, tools like HTML5, jQuery, insert your favorite ECMAScript library here, it's able to duplicate the desktop experience in a straightforward, if not elegant, manner.

The existing desktop application is a typical narrow-focus business design that relies on training, gradual evolution and Microsoft patterns (hover tooltips, header-detail split layouts, modal dialogs, et al) to enhance usability. In the]]>
Antonio Yon
tag:antonioyon.com,2013:Post/432162 2012-01-07T17:08:00Z 2013-10-08T16:54:12Z Java lives the thug life

My first words were, "Hello world!"

Antonio Yon
tag:antonioyon.com,2013:Post/431855 2012-01-06T14:04:00Z 2013-10-08T16:54:08Z Geeks understand that all tasks will eventually benefit from automation

I think that the X and Y axes are better if swapped, but the idiom remains valid.

Hat tip to Bruno Oliveira

Antonio Yon
tag:antonioyon.com,2013:Post/431866 2011-12-26T08:37:00Z 2013-10-08T16:54:08Z Developers, heroes, geeks, genius, rulers of the world

The current wave of developer love is truly amazing. Between works like this and Forbes' Developeronomics, we seem to be the in the golden age of Developer. How long will it last, before the backlash, inevitably arises.

Antonio Yon
tag:antonioyon.com,2013:Post/431881 2011-12-20T21:25:00Z 2013-10-08T16:54:09Z Developers vs Project Managers

Is there a more incongruous relationship than the one that exists between developers and project managers? On one hand, you have artists who are tasked with creating something from nothing. On the other, you have a resource manager that is trying to prognosticate, with some measure of reliability, the outcome on a daily, weekly, sprint-ly basis. There is less common ground between these two people than exists in the DMZ between North and South Korea. And yet, we interoperate on a regular basis to come up with progress reports and burndown charts and other artifacts to prove that this investment was, indeed, a wise one.

Sure you have your utility programmers who's tasked only with plumbing together existing solutions but, in general, the good engineers are more akin to artists than to knowledge workers. We are talking about skills such as inspiration, design, and architecture. It's like asking to an architect to plan you an office that may be used in a home or a 170-floor building and everything in between. It will be used by 2 users or 7 million. It must be completely responsive on first use and be able to accommodate being scaled to "the cloud." All of these things require more than what a blueprint and steel can offer. As a software developer, we are asked to construct tools and artifacts that make all of this a reality.

Project management, as a discipline, developed as a response to the very basic nature of a project. A project is a ephemeral task that is, by definition, somewhere outside the range of routine business activity. As such, leadership will try to wrap their arms around the beast by employing someone known as a PM to ensure that goals are met while honoring preconceived constraints. Therein lies the problem. If you accept that software development is an art then preconceived constraints are nothing more than a guess. Traditional Project Management patterns are designed around concepts that have measurable (and linear) workflows. Software development is not one of those concepts.

Overall, we are still in a very immature industry that hasn't ironed out all the details yet but we should approach this challenge with new ideas rather than yesterday's retreads. If developers really are the basis for our future economy then we should find better ways to measure and them and their work. Until then, I offer you this bit of wisdom given to me by someone smart than myself, "You should treat Project Managers like mushrooms. Keep them in the dark and feed them lots of shit."

Antonio Yon
tag:antonioyon.com,2013:Post/431898 2011-12-15T15:37:00Z 2013-10-08T16:54:09Z Why the current conservatism in this country is so distasteful
Paul [has] none of the resentment that burns in Gingrich or the fakeness that defines Romney or the fascistic strains in Perry's buffoonery. He has yet to show the Obama-derangement of his peers, even though he differs with him. He has now gone through two primary elections without compromising an inch of his character or his philosophy. This kind of rigidity has its flaws, but, in the context of the Newt Romney blur, it is refreshing. He would never take $1.8 million from Freddie Mac. He would never disown Reagan, as Romney once did. He would never speak of lynching Bernanke, as Perry threatened. When he answers a question, you can see that he is genuinely listening to it and responding - rather than searching, Bachmann-like, for the one-liner to rouse the base. He is, in other words, a decent fellow, and that's an adjective I don't use lightly. We need more decency among Republicans.

I don't often blog about politics (or religion, for that matter) but occasionally I come across something thoughtful and feel the need to voice my dissent or "mega-dittos." Here is a blog from Andrew Sullivan endorsing Ron Paul for the 2012 election. Sullivan contrasts Paul to his contemporaries, among them, the current darlings of the polls. While I don't agree with his endorsement of Ron Paul as the best answer, I certainly like his summary of the current GOP platform of fear-mongering, extremist views, and a general lack of restraint and decency.

FWIW, I like Huntsman's bid for the less fascist side of conservatism.

Antonio Yon
tag:antonioyon.com,2013:Post/431927 2011-12-09T14:47:00Z 2013-10-08T16:54:09Z My favorite tidbit of CS lore: Etymology of Apache Server
As the specification effort for HTTP began to take the form of complete specifications, we needed server software that could both effectively demonstrate the proposed standard protocol and serve as a test-bed for worthwhile extensions. At the time, the most popular HTTP server (httpd) was the public domain software developed by Rob McCool at the National Center for Supercomputing Applications, University of Illinois, Urbana-Champaign (NCSA). However, development had stalled after Rob left NCSA in mid-1994, and many webmasters had developed their own extensions and bug fixes that were in need of a common distribution. A group of us created a mailing list for the purpose of coordinating our changes as "patches" to the original source. In the process, we created the Apache HTTP Server Project

In case you ever wondered if Apache was named for the helicopter or its eponymous Native American tribe. Another reason to remember not to take yourself too seriously.

Antonio Yon
tag:antonioyon.com,2013:Post/431958 2011-11-29T16:56:00Z 2013-10-08T16:54:10Z What we have here is a failure to communicate

I'm reading Land of Lisp in an effort to better understand Functional Programming patterns and idioms. Why not start with the mother of all functional (and procedural, object-oriented) languages. That's gotten me thinking about the impedance mismatch of programming languages and natural human languages.

When computing machines were first invented, we had machine language, or ones and zeros as the CS pioneers referred to it. Then came compilers and interpreters and run-times and virtual-machines.  All in an effort to better match the precision of machine code with the vagary of human language. What makes the human brain remarkable is its ability to process patterns and context while evaluating expressions. It allows for a relatively small syntax to express a wide variety of ideas and concepts. That's our natural language has evolved. Take a small base, the English alphabet for instance, and build it into patterns, words and sentences, until a usable, repeatable, inferable system is accepted by all users then share! These patterns have a lot of visual and logical helpers that give the expression meaning beyond the provided syntax.

Computers, by nature, excel at precision and accuracy so they require a language that's very precise in order to function properly. Early languages like Lisp don't even really have a syntax to speak of, rather more of an abstract prefix notation tree. Symbols like parentheses, commas, quotes, and back-quotes rule the land with instructions and data intermingling throughout. There's no functionally useless tokens, or syntactic sugar, here to assist readability or understanding. As languages evolve and become higher-form, they typically approximate more human-readable features. Each new language supposed to better interface concepts with instructional code.

As machines get faster and platforms get more efficient, we find new layers of abstraction to exploit them. It's a never-ending cycle that precludes us from actually gaining any computing efficiency. We even have macros and domain-specific languages now to approximate the utility and business knowledge that our brains intrinsically and subconsciously handle for us. I propose we quit that chase. We should just adopt a human-understandable language that's as elegant and functional Lisp and quit trying to layer language on top of framework on top of platform ad infinitum.

(defun are-you-with-me ()
             (apply #'share(cdr ('language *knowledge*))))]]>
Antonio Yon