Wednesday, December 7, 2011

Why go native?

... When you've got HTML5?
That's one question I get asked a lot in the past year.

When you've got so many cool new features in HTML5, and want to save development costs, is there any reason at all why your application should be native?
Why write for several platforms, go through the whole approval process (Difficult with Apple, less so with Android)?
Why maintain more than one environment, expert types, development environments? (And yes, I know about Flash Air Mobile, Aptana and Phonegap. And no, I don't consider them as 'native'.)

Well - There are several reasons why you would want to go native.

First reason to go native would be performance.
If you have long tables to present, large stream of information, graphics (Like dynamic maps), you might be better off native.

Second reason is better usage of your device's resources - Camera, GPS, accelerometer - These are all supported/ to be supported in html, but would not work as well as they would with native interface.

Third reason is UI conventions - When programming for a device, it's best to use its native components for UI. Simply put, your users would find it easier to set preferences and options, and learn the application in the visual language the device uses. HTML5 would never look better than a native app, especially in small mobile device screens.

Final reason would be control. You want your users to be focused in your application, rather than have four browser tabs in parallel. You might not want your users to be able to simply 'browse out' of your application (Without doing a proper cleanup...).

There's also a way to enjoy both worlds:
Applications can talk to their 'web view' programmatically: Actually, the only way to spawn a software keyboard in 'editable' divs (Like web based rich text editors do) was by wrapping your site with a small app, and have the javascript 'invoke' the keyboard via the app.
That means you can wrap a web view with a thin app, and that way get all the focus to your app.

So before you jump to HTML5, which is an obvious answer to which platform you choose, think it over a little bit - Maybe native is the way to go.

In the meantime, I'm really having fun exploring Xcode. It's not that bad, once you're used to the workflow. Of course, this isn't visual studio for windows phone (I consider VS to be the best IDE, with WP no exception), but for now - It's fine.

And, finally, here's an interesting article about a small, smart and very popular company. Instagr.am is one of the coolest companies I know. Click the link below to understand why.
What powers instagr.am


Tuesday, November 22, 2011

Go Xcode yourself

Got a new Macbook Air 13". It's a neat machine, and osx feels great, even for a windows fan like me.
Office for mac is cool, Webstorm is working, and now I'm brushing my unix skills (Installing mysql and activating the built in php and apache), and setting up my work environment.
The good ol' x40 will remain in the family, and go to my older brother.

Another thing I got a mac for was to begin learning iOS development.
Xcode is the official iOS IDE, and after a little bit of fiddling, I still haven't decided whether I really hate Objective-c, or really misunderstand the language.

The principal is supposed to be simple - Drag and drop stuff to the view, write the outlets (Bad name), write some code and then connect them (By doing lots of ctrl+clicking).

But the Objective-c language is, well, quite weird. And the whole concept is a little more complicated than windows phone IDE, FLEX, or even Android.

I will update more about what I've learned once I do some real programming (Some web request and more elaborate controls stuff) rather than just connecting a slider and button to a label...

In the meantime, I'm really, really enjoying the Air's form factor and great performance. Only minor disadvantage - 13" screen with 1440x900 display = Really really small fonts in some web sites.

Thursday, November 10, 2011

From MVC to MVP to...


MVC used to be the buzzword for client development.
Implement the model, bind it to the controller and the view, or get a framework to do that for you, and there you have it - A fast client, connected to the server, great way to deliver your application.

Or is it?
I have never seen 'clean', by the book, MVC implementation. The controller and view logic gets mixed and messed up after a couple of iterations, binding makes manipulation of data formats hard, view business logic gets implemented in controller, controller code gets implemented in the view (Sometimes because of binding), and after a while the whole code gets impossible to understand and maintain.

So what do you do?
Find a simpler paradigm, which would work!
MVP says a simple thing:
- The model stays the same. Handle data and communicate with the server/ container/ host/ whatever.
- The presenter does all the work. Business Logic, View Logic, Validation, string formatting, whatever the user does NOT do interact with.
- The view handles GUI. There's no relation between the view and the model, the presenter takes care of that.

Now let's take this a bit further, and create inheritance based MVP component:
The View extents the presenter, which extends the model, et voila!

Now you have a simpler paradigm which could actually work and expend, you can rewrite or use different views (Different devices, for example) and have your factory create the client class according to the device...

As for frameworks - There are a lot of frameworks which would do the trick, though most of them do not use the inheritance paradigm. And anyway, I like to program my own frameworks, and use 3rd party frameworks to simplify specific infrastructural tasks (Like jax-rs for REST servlet implementation, or jQuery for DOM manipulation).

So next time you hear MVC/ MVP - try to see if the inheritance model suits you. You might be surprised how simple things could get...

Wednesday, November 9, 2011

Bye bye flash.

In July, I published a comparison between FLEX and HTML5, and a quick follow up a week later, stating that Adobe is going HTML5.
Well, it seems like Adobe finally realized, that there is no way to make the Flash VM run over a mobile platform without either killing the machine's performance, or draining its battery.
The FLEX platform isn't dead though - Adobe is making its Air platform run as a VM for native applications, both in Android and iOS (And, of course, desktops). But as far as the web goes - Flash goes where Microsoft's Silverlight platform goes - Into the history books.

http://www.wired.com/gadgetlab/2011/11/adobe-kills-mobile-flash/

Wednesday, November 2, 2011

Open source support pays off!

I know JetBrains for a while now.
At Time To Know, it's the tool of choice for our leading development group. (The other one is using Flash Builder).
My team uses Eclipse and Aptana for web development, but it is far from being a good HTML/ JS/ CSS development tool - Even Developer Studio is much better than Eclipse.
Luckily, JetBrains has an open source program, that gives you a one year free license of their products for your project. I've tested PHPStorm, and it's a really, really cool tool for PHP and web development. Got my license, and liked it so much, that we're getting it for my whole team now.
Only problem - you need a strong PC to run it, but on the other hand, most IDEs these days are.
I'll be testing zend studio soon as well.

So thanks JetBrains. Open source support pays off.

Another small update about simple gallery management: A fifth site is in the works, plus we're over 100 downloads so far, which is relatively nice (I don't promote that project too much...).

Sunday, September 25, 2011

Back from NYC... Chart talk.

I've just finished some work, requiring charts. After some research, I found that the only free 'complete' tool for html charts is the Google Charts API. A neat Javascript library, which enables you to create charts - Basically you create a data table structure, add some customization options, and the API generates the chart as SVG markup, and 'plants' it as an iframe inside the designated DOM element.
You can also hook some event handling, there are value tips, and lots of customization options.
Not to be confused with the Google Charts Image API, which is a little different:
The Chart Image API is generated via a GET/ POST URL request from Google servers, and is an image. It has more formatting options and better graphics, but is not interactive, and transfers your data via Google servers, something I am not too happy to do.

Though not everything is perfect with the Charts API, and there are few missing features (The ability to have 'zones' in a line graph, the ability to have more than one line in a combo chart etc.), it is good enough for most uses, and actually goes in line with the simpler look web applications are taking today.

So the next time you consider spending money on interactive charts, consider these tools. They will look better on your iPad, that I promise.

Tuesday, August 30, 2011

Of programming and expectations

We all have a lot to learn.
My first programming job was a 'lone' programmer in a group of testers, writing telephony test simulators.
The activity was successful, and after two years I found myself with two workers, making wonderful stuff happen, and changing the way my company works.
After trying, unsuccessfully, to be a beta program manager (Too early for a 25 year old kid...), I was given another programming job, this time under a guru.
The first two months were looking quite good. Re-brushed my c++ skills, got my confidence back, made some stuff happen.
Then came the evaluation talk.
And I got my ass handed over to me.
Seems that I wasn't quite that good, according to my boss. Messy, hard to control, over confident, lots of bugs etc.
I was quite angry after that conversation. Felt like kicking his ass. Luckily for me, I had the whole weekend to relax. And then I understood something. This was actually my first job programming. In the phase before that, I had no one to tutor me. I got great results, but I was the one setting the expectations, as there were none...
So instead of explaining how wonderful I actually am to my boss (Who obviously thinks a bit different), I need to give up my ego, and start learning from him. He was not the one they would fire if I'm not up to par with his expectations...
So I've asked him to accompany me in my next mission, step by step, and make sure I will not fail.
Break down my mission, set expectations and success criteria for each mission.
I know how to write code. I just need to align myself to his methods. And who knows, I might even learn something.
In that particular case, I've learned a whole lot. Both professionally and personally.
The past year I had to give up on a good programmer which chose the other way. After he got handed over to another group, he decided to quit, in the middle of a version.

There are many types of programmers. But the ones team leaders like the most, and are most likely to promote, are the effective ones: The ones who can make the biggest impact, not necessarily the most efficient ones, the hard working, or the more thorough ones. These are great qualities, but they are not enough.

I will elaborate more on how to be an effective programmer from both the manager and programmer perspective, in my next posts.

y.

Sunday, August 21, 2011

Tip: The JSP surgery

So, you've invested a whole lotta love and money in your java based web server.
And it's fine. Really.
But now it's time for an overhaul. The UI is dated, and you want to bring some fireworks back.
The problem - Your team has changed, it's been a while, and all your team has done so far were some bug fixes and some features. And the web layer is written in good ol' jsp - No one really knows how to rewrite it. Recently I've encountered a similar project - All the team left, the design was terrible, but I couldn't make changes to the back-end, only the jsp files.

What do you do?
My suggestion is to divide and conquer!

Here's a quick recipe on how to transform your server script code into a web service.

First off, see which data you need the server to really generate. Usually, it would be user details, a data table, plus some attributes.
After that, have your jsp code generate JSONs instead of html or javascript code.
This shouldn't be that hard.
Analyze all your code, and prepare new jsp files for each type of data needed. Use the current jsp function calls - There's no need to rewrite the java layer: All these files should do is write a JSON response. You can use Arrays.toString(), or a JSONArray, or you can generate the JSON explicitly from object attributes.


Then you can begin writing your client from scratch, and use these jsp as a web service. You may later write some Java servlets to replace them, or (Better off) use jax-rs to completely get rid of the jsp.
Step by step, you'll see your web application transform into something a lot more comfortable to use and maintain. A real web service, without rewriting your back-end. And when you do get the time to update your server, you'll be able to do it with only minor client modifications.

Have a good development week, and stay tuned for more!
y.

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.

Thursday, June 30, 2011

+1

Thanks to Inbal Baron for adding me :)
Some notes:
- Getting started is easy. Just go over EVERYONE you've ever mail anything from your gmail, and add whoever you choose to the appropriate circle. The problem: If I could do the same with my facebook contacts, transition would be a lot easier.
- The concept is a mix between twitter and facebook. Seems like they've tried taking the best of both worlds. That's quite cool.
- The network is not working well on iPad. That's deliberate. Everybody knows you can't do rich text editing via iframe in tablets. So you have to use the 'mobile' web client for iPad, which is lame. It sucks.
- You'd think that after the buzz flop, google are going to be extra careful about privacy, people still don't trust google. We'll see how that evolves.
- The new Google toolbar looks EXACTLY like Twitter's. This is no coincidence.
And, final comment about this - This is not THE next big thing, sorry. My assumption is that the next big thing will not only be social, but physical as well.

Small tip:
Here's one more thing to do if you want SEO advantage...
Add a '+1' button is very simple.
Check out the instructions here.

Tuesday, June 28, 2011

Artichoke site is up!

You can check it out.
http://www.myartichoke.com/

There will also be a like button there, soon.

Next online - Another site (Also based over the same infrastructure), and the new management version.

Saturday, May 21, 2011

The Thinkpad affair

I own a good old IBM X40 laptop, bought for me by Verint when I was working there.
This laptop had 40GB drive, centrino processor, and 1GB of RAM.

It has a great keyboard and screen, but was really, really slow due to a very (4500 rpm) slow hard disk. Booting XP took ~3 minutes, and the 6 cell battery was dead after 6 years, and was only good for an hour or so of very weak performance.

But I wasn't prepared to get a new one.

So I've decided to upgrade it.
First, I got a 64GB HD from ebay (140$, incl. shipping) and a new 6 cell battery (48$).
Then, I installed windows 7.
There's a problem with windows 7 and centrino drivers, so I couldn't get the laptop to enter standby mode.
This was solved by following the exact directions found here.

So, what did I get?
for less than 200$, my laptop is better than anything at that price.
It will be usable for a couple more years, and it's still one of the lightest/ comfortable laptops around.
The SSD is quiet, and takes less power - Along with the new battery, it now runs over wifi for 4.5 hours! 2.5 was the most I had with the old HD.

Great deal.

Friday, May 20, 2011

We've been indexed....

Google have indexed this blog, which means we've gained another link to Einat's site. BTW - This site should be reposted, as it has a link to myartichoke (My wife's site).

The next projects:
- An update to Maya's site. Should be an easy one.
- Another dynamic site, to which I will add 'updates' section support in my simple gallery management project.

Monday, May 16, 2011

Looks like we're gaining ground

Einat sarig reich is up the charts!
Check this out.

Hebrew search is still not so good...
2nd page only, but at least we're getting somewhere.


Quoted search, by the way (Query exact name) works better.

We'll update next week.

Monday, May 2, 2011

... Second post

Well, looks like the einat sarig reich SEO is advancing... A little bit.

Page is now 5th when querying her name, though in Hebrew, there's not much (yet).

Webmaster tools, of course, does not show any keywords processed.

I'm gonna re post the site, see if we'll make any advancement there.

In any way, because the site does not contain Hebrew content, but does contain Hebrew keywords, google doesn't process the Heb. keywords.

Saturday, April 30, 2011

First entry

In which i can see that rte and ipad do not work well.... Knew that already, but still hurts.

First site:

Einat sarig reich is a talented, well established photographer from Ramat Hasharon.

Site is written in plain html and js, back end is php, based on my simple gallery management open source project.

Actually, this entry is also for trying to see how my SEO works. Goddady's SEO tools are ok, but they don't really do the job - There's a major problem with Google indexing their sitemap files, because they use redirects messages (302) to the file - Google then fails to download the sitemap because of that.

Enjoy