Archive for General

SQLite Dynamic Data in Titanium

// November 30th, 2011 // No Comments » // General

My talk at @LondonTitanium on using SQLite as an API cache.

 

Where are my rounded corners?

// November 26th, 2011 // No Comments » // General

Factsheet-_Where_are_my_rounded_corners.pdf Download this file

If it was hard to write, it should be hard to understand.

// May 18th, 2011 // No Comments » // General

Let me get this straight to the point from the start and in a really short matter…

You may rewrite the whole API, you may do it so well that is actually 10x more performant of the ugly previous version that you spent months moaning about…

To be honest based on some queries, it may be 100x better… More robust, clean and scalable!!!

You do all this job in your own fucking world, close in your headsets and maybe whispering what are you doing to few fellas that venerate you like a God. The rest of the world, won’t even know the existence ’cause you can’t write and communicate about…

But if they ask you… Well of course you stand proud of your 10x or 100x performance factor.

So in that way I found out about the existence of this miraculous piece of code and I decide to investigate if not, use it.

Surprise!!!

All those lines of genius are empty. Why? ’cause you didn’t wasted 10sec in creating a doc about, you couldn’t even spend 2sec to add a line of comment before opening a curly bracket…

Result?
You’re a kamikaze! You’re not a developer, to be honest with you… You’re pretty useless ’cause you’re useless to the community around you; even the first men living in a cave managed to leave us something.

Maybe rough and not pretty, but not useless.

Timing

// May 17th, 2011 // No Comments » // General

“Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do. If you haven’t found it yet, keep looking and don’t settle.” — Steve Jobs

The best idea… #2

// February 2nd, 2011 // No Comments » // General

It doesn’t happen that I travel for work often but when it does your mind get all the benefits. Well of course it depends from a lots of different variables but in general: Your mind reads things with a different prospective. You’re outside your daily environment, your daily chaos, your daily Q&A session and your daily neighborhood. It’s in this situation that your best ideas arrive. Take note of them.

Meetings Are Toxic

// September 10th, 2010 // No Comments » // General

There's nothing more toxic to productivity than a meeting. Here's a few reasons why:

  • They break your work day into small, incoherent pieces that disrupt your natural workflow
  • They're usually about words and abstract concepts, not real things (like a piece of code or some interface design)
  • They usually convey an abysmally small amount of information per minute
  • They often contain at least one moron that inevitably gets his turn to waste everyone's time with nonsense
  • They drift off-subject easier than a Chicago cab in heavy snow
  • They frequently have agendas so vague nobody is really sure what they are about
  • They require thorough preparation that people rarely do anyway

For those times when you absolutely must have a meeting (this should be a rare event), stick to these simple rules:

  • Set a 30 minute timer. When it rings, meeting's over. Period.
  • Invite as few people as possible.
  • Never have a meeting without a clear agenda.

The first step is to start

// September 6th, 2010 // No Comments » // General

…The truth is that you don’t need learn anything new in order to begin. The most important thing is simply to start.

Start making something. If you want to learn web design, make a website. Want to be an entreprenuer and start a business selling web based products? Make an app. Maybe you don’t have the skills yet, but why worry about that? You probably don’t even know what skills you need.

Start with what you already know

If you want to build something on the web, don’t worry about learning HTML

, CSS, Ruby, PHP, SQL, etc. They might be necessary for a finished product, but you don’t need any of them to start. Why not mock-up your app idea in Keynote or Powerpoint? Draw boxes for form fields, write copy, link this page to that page. You can make a pretty robust interactive prototype right there with software you already know. Not computer saavy? Start with pencil and paper or Post-it Notes. Draw the screens, tape them to the wall, and see how it flows.

You probably don’t even know what skills you need, so don’t worry about it. Start with what you already know.

You can do a lot of the work with simple sketches or slides. You’ll be able to see your idea take form and begin to evaluate whether or not it really is something special. It’s at that point you can take the next step, which might be learning enough HTML to take your prototype into the browser. The point is, go as far as you can with the skills and tools that you have.

Avoid self doubt

Many times the reasons we don’t start something have nothing to do with lack of skills, materials, or facilities. The real blockers are self-criticism and excuses. In the excellent book, Drawing on the Right Side of the Brain, the author, Betty Edwards, discusses how we all draw as kids but around adolescence, many of us stop developing that ability.

“The beginning of adolescence seems to mark the abrupt end of artistic development in terms of drawing skills for many adults. As children, they confronted an artisitc crisis, a conflict between their increasingly complex perceptions of the world around them and their current level of art skill.”

At that age kids become increasingly self-critical and equally interested in drawing realistically. When they fail to draw as well as they know is possible many give up drawing at all.

This feeling continues into adulthood. We want to design a website or build an application but if our own toolset doesn’t match up to the perceived skillset we never start. It doesn’t help that the internet gives us nearly limitless exposure to amazing work, talented individuals, and excellent execution. It’s easy to feel inadequate when you compare yourself to the very best, but even they weren’t born with those skills and they wouldn’t have them if they never started.

Do—there is no try

People who succeed somehow find a way to keep working despite the self-doubt. The artist, Vincent Van Gogh was only an artist for the last ten years of his life. We all know him for masterful works of art, but he didn’t start out as a master. Compare these examples from Drawing on the Right Side of the Brain showing an early drawing compared to one completed two years later:


Vincent Van Gogh Carpenter, 1880 and Woman Mourning, 1882

He wasn’t some child prodigy (he was 27 when he started painting), he learned his craft by hard work. If he’d listened to his own self doubt or despaired that his skills didn’t compare to Paul Gauguin’s it’s likely he never would have even tried.

This is all to say that there are many things that can get in the way of the things we should be creating. To never follow a dream because you don’t think you’re good enough or don’t have the skills, or knowledge, or experience is a waste. In fact, these projects where there is doubt are the ones to pursue. They offer the greatest challenge and the greatest rewards. Why bother doing something you already have done a hundred times, where there is nothing left to learn? Don’t worry about what you need to know in order to finish a project, you already have everything you need to start.

via Signal vs. Noise

There’s Nothing Functional about a Functional Spec

// August 30th, 2010 // No Comments » // General

Don’t write a functional specifications document
These blueprint docs usually wind up having almost nothing to do with the finished product. Here’s why:

Functional specs are fantasies
They don’t reflect reality. An app is not real until builders are building it, designers are designing it, and people are using it. Functional specs are just words on paper.

Functional specs are about appeasement
They’re about making everyone feel involved and happy which, while warm and fuzzy, isn’t all that helpful. They’re never about making tough choices and exposing costs, things that need to happen to build a great app.

Functional specs only lead to an illusion of agreement
A bunch of people agreeing on paragraphs of text isn’t a true agreement. Everyone may be reading the same thing but they’re thinking something different. This inevitably comes out later on: “Wait, that’s not what I had in mind.” “Huh? That’s not how we described it.” “Yes it was and we all agreed on it – you even signed off on it.” You know the drill.

Functional specs force you to make the most important decisions when you have the least information
You know the least about something when you begin to build it. The more you build it, the more you use it, the more you know it. That’s when you should be making decisions – when you have more information, not less.

Functional specs lead to feature overload
There’s no pushback during spec phase. There’s no cost to writing something down and adding another bullet point. You can please someone who’s a pain by adding their pet feature. And then you wind up designing to those bullet points, not to humans. And that’s how you wind up with an overloaded site that’s got 30 tabs across the top of the screen.

Functional specs don’t let you evolve, change,and reassess
A feature is signed off and agreed on. Even if you realize during development that it’s a bad idea, you’re stuck with it. Specs don’t deal with the reality that once you start building something, everything changes.

So what should you do in place of a spec? Go with a briefer alternative that moves you toward something real.
Write a one page story about what the app needs to do. Use plain language and make it quick. If it takes more than a page to explain it, then it’s too complex. This process shouldn’t take more than one day.

Then begin building the interface – the interface will be the alternative to the functional spec. Draw some quick and simple paper sketches. Then start coding it into html. Unlike para- graphs of text that are open to alternate interpretations, interface designs are common ground that everyone can agree on.

Confusion disappears when everyone starts using the same screens. Build an interface everyone can start looking at, using, clicking through, and “feeling” before you start worrying about back-end code. Get yourself in front of the customer experience as much as possible.
Forget about locked-in specs. They force you to make big, key decisions too early in the process. Bypass the spec phase and you’ll keep change cheap and stay flexible.

A “spec” is close to useless. I have never seen a spec that was both big enough to be useful and accurate.
And I have seen lots of total crap work that was based on specs. It’s the single worst way to write software, because it by definition means that the software was written to match theory, not reality.
-Linus Torvalds, creator of Linux (from: Linux: Linus On Specifications)

Article: On jQuery & Large Applications – rmurphey

// August 27th, 2010 // No Comments » // General

On jQuery & Large Applications – rmurphey
http://rmurphey.posterous.com/on-jquery-large-applications


On jQuery & Large Applications – rmurphey

I’ve been thinking a lot lately about JavaScript applications. As my skills have evolved, I’ve had the privilege of working on more actual applications, and I’ve gotten further and further from clients who want to add a bit of Ajax or bling to an otherwise fairly traditional web site.

The most interesting applications I work on are client-side intensive: the server is responsible for providing data as JSON to the client, and most everything else — templating, state management, data management, site navigation, and of course user interaction — is left to the client side.

It’s a lovely way of writing an application. There’s no need for me to touch server-side code; in some cases I work with a server-side developer to decide what the data they send will look like, but in others I just take what an API already provides and make it work. I get to use the same templating framework across projects, regardless of server-side technology, and I can prototype complex interactions before the server side even exists.

This is a land where HTML, CSS, and JavaScript are almost all you need, and I like it. I’ve become a firm believer in moving giant hunks of functionality that used to belong to the server over to the client. For a variety of reasons, I think it’s clear that this is where most interesting web development is headed, to the extent it’s not already there.

This style of building an application changes the front-end development game. In fact, “development” may no longer be an adequate description; we’re moving into the realm of engineering, here. We’re not using JavaScript to add a bit of bling to our sites — a slideshow here, some Ajax there — we’re architecting an application, damnit. We can’t just write some procedural code that binds a bunch of anonymous functions to some events and call it a day; if we do, I can tell you from experience that we’re going to end up with a steaming pile of unmaintainable crap.

Among a host of questions presented by these sorts of applications, some of the most interesting to me are:

  • What are the units of functionality that will make up the application?
  • How will those pieces be organized into units of code?
  • How will those pieces communicate with each other?
  • How will dependencies between components be expressed and managed while adhering to the principle of loose coupling?
  • How will components manifest themselves in the DOM? Do they need to?
  • How will we persist data across URL and page loads?
  • How will we manage communication with the server?
  • How will we make sure users only see the data they’re allowed to see?

At the risk of making a broad generalization, this isn’t the way today’s average JavaScripter learned to think. The mantra of jQuery, the most popular JavaScript library on the internets, is “get some elements, do something with them” — perfectly terrible preparation for analyzing an application from a perspective other than the DOM. And, IMHO, therein lies a tremendous problem.

As more and more application logic moves to the browser, I’m eager to see the JavaScript community rise to the challenge, but instead it feels like the opposite is happening. People with little understanding or appreciation of these questions are taking on projects that demand these questions be answered. The result is a land of fragile code that gets the job done while giving the finger to the next developer; a land of code so tightly coupled, so deeply beholden to the DOM, so blatantly not reusable or extensible or maintainable as to render every subsequent commit a complete crapshoot, as liable to cripple the application as not. The viability of the project is threatened, and so is the reputation of JavaScript.

We are better than this. JavaScript, even that old-fashioned browser kind, is a language worthy of respect, not a thing to be dreaded. But — and here’s the sentence I have struggled 10 months to realize and an hour to write: in order to prove that we are better than this, we must make abundantly clear to the budding developers, to the project managers, to the enterprises, to anyone intending to build a remotely complex JavaScript application, that there’s more to JavaScript than jQuery. The questions are bigger, the answers more complex, and the relevant skills, alas, a bit harder to come by.

We have to make clear that, in fact, jQuery is but a hammer. When it comes to building these intensively client-side applications, we’re talking about building skyscrapers, for god’s sake. The problems solved by a hammer are the least of our concerns.

It was just a few months ago that I gave a presentation on building large jQuery applications. I emphasized jQuery’s role as strictly a DOM and Ajax tool, and demonstrated a few other tools — John Resig’s simple inheritance, James Burke’s RequireJS dependency management and build tool, Jan Lenhardt’s mustache.js — that one would want to bring to the table for such an undertaking.

But to what end do we assemble said hodgepodge of tools? Is it just so we can continue to “use jQuery”?

jQuery’s API is, indeed, dead-simple, but we are smart people! We are building skyscrapers! When it’s time to write a complex application, and we need all of these things that jQuery doesn’t offer, can we not learn to use another hammer — learn that dojo.place('<div>I am new!</div>', oldDomElement, 'last') means the same thing as $('<div>I am new!</div>').appendTo(oldDomElement) — if learning it gives us access to legions more functionality than jQuery even aspires to provide?

Do we assemble this hodgepodge because finding jQuery developers is perceived as an easier task than finding practitioners of another library, even though someone saying they “know jQuery” is little indication that they will know how to work with the assembled solution?

Do we do it for the plugin ecosystem — full of code of varying quality and maintenance — even though many of the large application needs addressed by those plugins are addressed by other libraries as well, and sometimes better?

And when we do it, when we assemble this collection of tools ourselves, what risks are we accepting? What price will we pay down the road to maintain three or five or 10 different pieces from three or five or 10 different authors, with different release cycles, no guarantee of compatibility or maintenance, and no central project thoughtfully considering their future?

I’ve wrestled with these questions for months, agonizing during sleepless early-morning hours over how to advise clients on the answers. I’m the co-host of yayQuery, a contributor to the jQuery Cookbook, and, I’ll venture to say, a decently respected member of the jQuery community. I did not arrive at this conclusion lightly, and I have few illusions it will be well-received, or even heeded.

But I’ve grown weary of people championing a tool that simply does not answer the big questions I see in project after intensively client-side project. I’ve grown weary of those same people dismissing tools that answer those questions handily and have been answering them for a while now. I cringe when clients tell me they’ve chosen jQuery because it was “easy,” and then watch them predictably struggle with all of the questions it does not answer. And I’ve found I can’t continue to bite my tongue when people recommend jQuery as an enterprise-grade solution while failing to acknowledge these questions, let alone answer them*.

I do not want to see jQuery go away. The simplicity of its API was undeniably instrumental in the rise of JavaScript as a language these last few years. It is a perfect gateway drug, and I greatly enjoy watching people transition from “get some elements, do something with them” to the elegant patterns of JavaScript itself.

jQuery is an entirely appropriate answer to so many questions, but it falls so short for large applications, forcing you to assemble such a tenuous toolkit of your own, that it simply isn’t a viable answer — or, in my opinion, part of an answer — for large applications. If we hope to continue to gain respect as a community, we ought to admire jQuery’s immense contributions, but we must not be afraid to accept and make very clear its limitations. We do otherwise at our peril.


Don’t split into silos…

// August 26th, 2010 // No Comments » // General

I never believed that a developer (in this example) should be a
front-end/back-end ONLY guy…

There’s no such thing and in my opinion if you’re hiring in this way
you’re not doing yourself a favour and sure won’t be your smartest
decision!

Was reading the “Getting Real” ebook by 37signals…when this topic
came out so here’s a summary:

Too many companies separate design, development, copywriting and
marketing into different silos. While specialisation has it’s
advantages, it also create a situation where staffers see just their
own little world instead of the entire context…

Don’t let things get lost in translation.

Even better, hire people with multiple talents who can wear different
hats…the end result will be a more harmonious product.