Sunday, August 14, 2011

Three nice tips for web developers.

Actually, two basic dev tips and one neat resource site.

First tip is regarding dynamic HTML. We've been encountering some rendering performance problems with huge tables, and after some investigation, here are some pointers:
  • Do not use tables. They're bad for you, especially large ones, and nested tables. By the way, YUI creates lots of inner tables. You can read some more with this link, top answer has some great detailed arguments for you. I know it's a corny advice, but there are lots of frameworks out there that use tables, even gwt.
  • Do not create each dom element separately - If you need to create a very large table/ chunk of html, it's better to create a huge html string and then insert it into dom for processing, rather than use the dom to create each element, and the append them. Think of it as using 1000 'native' calls from a VM rather than 1 long call. The overhead for each dom element is huge.
  • Establish a maximum size for a list and browse through results. Google does that with search results, why don't you? You can cache results in javascript, or keep an index to the query and go back to the server to fetch the next n entries, but displaying one thousand items for a user is highly ineffective. 
Second tip is rather basic - Regarding server/ client processing and separation. As we're moving towards cpu consumption related billing rather than permanent hosting, we need to rethink what we do on the server and on the client side. The main principal would be having the server perform validation and data (model), and do the rest in the client:
  • Your server code should not create html. It should either create status/ session/ json, but not html. This is just a waste of server cpu. It speeds up server response, and when written well, makes client experience better. It scales a whole lot better.
  • You must think of your client and server modules as replaceable. This means that if you're writing a server, imagine that you need to write two completely different (Say html and iOS) clients for it.
  • If you're afraid that competitors may reverse engineer your client html/ js/ css code, you can always minimize it, or get an obfuscator.
Final tip is this site. Microsoft is putting a lot of effort these days - It's great to see them as the underdog. You'll find Azure php sdk, nice html5 references, and lots of useful resources. Check it out. I'm considering Azure for a project I'm working on, the php sdk seems quite cool.

Have a great week!
y.

Tuesday, August 9, 2011

Some updates...

Here's another one:
http://www.pninas.com/

Design was pretty straight forward, One page is all I needed (index.html + index.js).
I think I'm improving... This one was quite easy and fun to do.

In other notes, the simple blog is shaping up. In the beginning, I thought about how to differentiate the system from, say, um, Blogger... And decided on focusing on these features:

  1. No Rich Text Editing. (So we'll be iPad compatible that way)
  2. One file attachment per post. User can then decide what it's going to be.
  3. Sample (Reference) viewer should be nicely designed, and with a separate (Maybe inline?) CSS.
  4. This time, try github for hosting. Just for fun.
In the meantime, Simple Gallery Management has gone through one more phase of update - Adding an attachment option for news post. You can get it here.
Tagging is there, but I haven't written the link between tags and items... Just being a bit lazy, I guess :)


There's another project shaping up, but I'm trying to think if it has commercial potential...
Stay tuned.

Wednesday, August 3, 2011

Start up Psychology: Of NDAs and meetings.

"But first, we need to sign this NDA agreement..."
You've seen the social network, right?
If you're meeting a lot with entrepreneurs, you might hear this a lot.
Every one wants to protect their most valued asset - Their wonderful idea that might change the world. And because most of them only get one shot at this, the one thing they fear the most is that some talented bastard would steal their idea, and get to the market before them.

So you're meeting with the ambitious young man/ woman/ team, and before they tell you how they might change the world, they pull up an NDA document, with thousands of words, all making sure you won't be stealing their precious idea EVER.

I've got a few small tips, that might help with that matter:

  • An NDA document might buy you peace of mind, BUT it won't really do the trick if someone really wants to steal your idea. Especially if it works. Big companies have big lawyers, small entrepreneurs usually don't. You can explain that to your partner.
  • Try to get that document before the meeting. It's hard reading every paragraph when you're in a coffee shop. You won't be able to assess the risks.
  • Ask for a time limit on that document. Three years is enough. You'll never know when you'll end up, or you might implement a similar idea in the future.
  • Declare a possible conflict of interests before hearing the idea. Tell the founder that you might stop the presentation in the middle - If you've heard a similar idea before, or consulting to a company with a similar idea (Even technologically), you can stop the meeting (Just don't do that AFTER you hear everything), and invalidate the NDA. Protect yourself in that matter.
And, most important - Go with your instinct. If you don't feel comfortable with the NDA, or with your potential partner, you can stop the meeting any time, and depart politely. 
It's more important to have fun and to work on something you believe in.

Tuesday, August 2, 2011

Adobe is going html5... Update on flex/html showdown

In perfect timing with my previous post, Adobe has pre-released Edge, which is probably the base for their next-gen authoring tool, which creates animations and interactions in html5 standards.

So after Microsoft put Silverlight to rest, looks like Adobe flash is on its way...

Friday, July 29, 2011

FLEX vs HTML5... The showdown.

I've been asked this question more than a few times lately, so I've decided to write some notes comparing between the two platforms.
I am currently leaving out other competing environments like gwt (not good enough), silverlight (why would you?) and javafx (not nearly there).
But first off - Before comparing between the platforms, you should be focused on your needs and target devices:
Does your application require heavy graphics processing? Animations?
Is it supposed to run over smartphones and tablet devices? Netbooks? Power desktops?
Are you able to deploy your application to app stores? Do you have the budget to target several platforms?
What are your performance goals?
Perform that analysis, and you will be able to compare between the two, and find the platform that suites your needs.

So, without further delay, let's begin:

Ease of development:
Advantage flex. Though html is very easy to learn, deploy and even debug, flex can be faster, especially with form based apps. flex has a nice WYSIWYG editor, with fast link to simple code. flex also has great built in graphs and charts, to which data could be easily linked. html is gaining ground, though, with new and better development environments in the pipeline.

Performance:
Advantage html. html is 'native' to browsers, while flex runs inside a browser, over a virtual machine. flex has several garbage collection problems (To which you need to go deeper into actionscript studying), is very cpu and memory greedy, and even takes more time to initialize and load.
If you need to run over tablets and netbooks, html should be the way.
If you do go with flex, consider this: Internet Explorer 8 and up has the best flash performance (According to several benchmarks I've performed). Chrome and firefox are slower, and android web browser is even slower then that.


Deployment:
Advantage html. This one is easy. flash needs a plugin. flash doesn't work over iOS. Flash builder 4.5 is supposed to have an iOS 'workaround' - running flex apps over iOS air runtime environment. IE10 is supposed to be closer to webkit browsers that to IE9, which will bring less browser compatibility issues.

Richness and graphics:
Advantage flex. Though html5 and css3 bring canvas, svg, effects and some other great stuff, flex and flash are still better. html is gaining ground here, though - there are lots of neat canvas javascript libraries out there.


Interop:
Advantage html. Need to open an office document via your app? A java applet? Can't do that on flex.

Documentation and development environments:
For flash builder, you will need a license. Knowledge base is quite large, but not nearly as large as html. To develop html, all you need is a notepad and a web browser.

To summarize:
In my opinion, html is the way to go. Faster, better performance in most cases, cheaper development and setup. Runs over every device, and besides - Everybody wants to develop better and faster browsers, rather than faster flash players...
So on the overall, for now, html wins by points.
But as the time goes by, html is getting better and better. So unless you're doing something that requires the flash platform or requires flash graphics, go with html.

Tuesday, July 19, 2011

New Simple Gallery Management Version available

This is it... Finally.
Finished work on it last evening, and here it goes.

I've added some nice GUI (click and edit like flickr) for it.

It's still not 100% done - Tagging and some more features would be added, but all the basics are there!

You can get it here:

sourceforge.net/projects/simplegalleryma/files/

... And, of course, it's 100% free (MIT license).

Enjoy!

Monday, July 11, 2011

"Never underestimate the bandwidth of a truck full of backup tapes"

Said Andrew S. Tanenbaum, back in '96.
Netflix's CEO, when asked about their concept of sending DVDs and return envelopes to subscribers, quoted him as inspiration - Back in 2002, I was in Boston , lecturing about telephony switches test simulators, and discussed that quote with a manager from Intel when speaking about big bandwidth networks and the fact that they might replace physical media, eventually.

Few years down the road, and looks like Amazon were listening: http://aws.amazon.com/importexport/.

Thanks to Boaz Ziniman, zend's cloud expert, for the link.