

How to launch in a month, scale to a million users - ljlolel
http://www.jperla.com/blog/post/how-to-launch-in-a-month-scale-to-a-million-users

======
revorad
_We implemented a library that could create complicated AJAX interactions by
writing 0 javascript, instead just adding a few extra HTML tags to code._

I don't understand what this means. Can you please explain how this works?

~~~
gregdetre
It's a clever idea:

\- In your html, you annotate objects (e.g. a button) with the '.actionable'
class

\- Then provide a set of arguments in the html alongside, e.g.

    
    
            <div class="kwargs">
                <!-- replace #money with the output from /user/3/money/create -->
                <input name="type" value="replace" />
                <input name="target" value="#money" />
                <input name="url" value="/user/3/money/create" />
            </div>
    

\- The library then parses the html of .actionable objects, and automatically
creates the relevant jQuery bindings for you. In other words, you define the
behavior in html, without having to write any custom javascript.

We're experimenting with a few ways of extending this on Memrise (Spencer
Davis gets most of the credit here). It's early days, but we're an ajax-heavy
site, and devolving certain kinds of basic, repetitive functionality to html
feels natural and simple. And, by adding new handler types to the library, it
becomes much, much easier to create reusable widgets that we can sprinkle
throughout the site.

P.S. Currently, most of this work is still on a development branch that will
be live within a couple of days.

~~~
imwilsonxu
Pls correct my if I'm wrong.

I see the idea: 1) Write htmls (with some rules, e.g. add '.actionable' class)
2) Library turn them to js codes.

Benefits: 1) Write zero js codes. 2) Make basic and repetitive functionalities
eaiser.

But, just wondering, why don't you wrap codes which deal with basic and
repetitive functionalities into js functions then reuse them, but write a
library to turn htmls codes to js codes?

My question is, html has its job and js has its, too. Is it a good idea to mix
them?

~~~
gregdetre
It's a good question. I don't think I'll have an informed opinion until we've
experienced what it's like to work in this way for a while.

But:

\- Joseph Perla's suggestions are usually good

\- It just feels better to me... Maybe because it's easier to auto-generate
html (e.g. from a Django template). Maybe because now many of our pages won't
need _any_ javascript. Maybe because all the custom logic is in one place
rather than spread over the html and the javascript. Maybe because writing
javascript is harder than html :)

------
iamelgringo
The much more important question is, how does one get a million users. Most
startups never figure that out. Focus on that, scale later.

------
endlessvoid94
The influx of posts about "how to scale" is noticeable. Are more startups
having this need? Or are more of them prematurely optimizing?

------
guimarin
Nice post Joe. Good to see you sharing some of that knowledge.

~~~
pandeiro
I found it helpful as well.

