Friday, January 23, 2015

When people drive technology (and not the other way around)

As a technologist I've always been an advocate for technology. Technology that makes people life better, less expensive and more beautiful. Technology that breaks geographical and cultural barriers. Technology that creates jobs and creates opportunity.

Some 20 years ago, I actually chose a career in technology because I believed in the concept. And where others see technological obstacles, I tend to see opportunity.

I some fast 20 years we were all witnesses of some huge technological moves that forever impacted the world: the PC was invented, the Internet spread out, mobile devices got born etc. etc.

But, while some things that I call "technology popularization" and "democratization" happened, we keep seeing resistance to technology. We keep running into underfunded projects. And we keep running into places where technology runs people rather the other way around.

We believe people should create useful, easy to use, totally white hat, high impact, inexpensive technology. For other people. Period.

So, as people who create technology every day, we are taking this liberty to open up a dialogue with other developers, users and members of the business community.

We are raising awareness, as many times we see technology either underutilized, utilized in a wrong way or simply ignored.

It's almost like a manifesto. I would like to:

(1) Have people drive and create technology to the benefit of other people

When you create a mobile application that retrieves geo location aware data from a database, do it so you can make the user's life easier. Maybe he/she is a new in town and does not know where to pick up pizza from. Maybe he/she is looking for a doctor in his neighborhood. Maybe he/she wants to see menus and prices of all italian restaurants in a 5 miles radius.

We, the people (or the programmers), created that app to help other people. They, the people at Google, created that Map API that allows for that. They did it to help other people.

And, as long as these apps will work well and people will be able to find what they are looking for, we will all do well business wise too.

But never start with the business or with the money in mind. Have that as a reward of a very well done job. A job that helps out people.

(2) Never create technology just for the sake of technology: always address a problem

How many times have you ran into dumb, copied or redundant systems? Into crappy apps. Into things that bombard you with random ads? Or into things where you do not see any practical sense (such as a corporate CRM that requires sales agents to insert sales leads that already exist in another CRM of the same company).

How many times have you seen companies putting out products that serve no purpose or products they do not believe in. I've seen many. I've seen accountants web pages that look like a 3rd grader's work and do literally nothing. I've seen in-house databases that nobody ever used. And I've seen exotic features that people were literally afraid to touch. "NEVER push that button!" told me a sysadmin one time :)

Never create technology just for the sake of showing off technology. Create technology that serves a purpose: save people time, save people money, make their work easier.

(3) Be careful with letting previous developed technology "choose" your users or customers

"This is how we always did it." You hear this dangerous statement all the time. And in organizations of all sizes. The fact that you used to it bad, buggy and inefficient are definitely not good enough reasons to keep doing it.

Even worse is to recruit personnel or chase customers just based on a certain technology. "We are targeting Microsoft users." or "We only recruit for Windows programmers" are examples of very simplistic ways of looking at things. Nothing against Microsoft here (we totally use and build products based on their technology every day). Just an example.

So try and see the big picture. And do not be afraid to change technology if your users or customers will benefit from that change.

(4) Leverage the beauty and power of technology

Instead of starting with a generic / negative statement like "We do not need this type service.", "We do not have the approved budget to approach this." or "Our customers are not familiar with this type of technology" please take a moment to reflect on some things.

How can you leverage technology? Why investing in good well implemented, easy to use technology is never an expense and is always an investment? How can you make 1,000 times fold what you are making right now by implementing a technology?

I'll just give one example: a real estate company continues to market in their neighborhood by mailing out business cards and fliers. They spend countless hours having staff producing the written content, putting everything in envelopes, sticking stamps on and manually sending thousands of pieces of mail out. What if they had a mobile app that will actually drive potential buyers to their doors? How much more impact full and productive will that be?

(5) Remain curious and up-to-date with technology 

Technology always changes but that should not intimidate you. See, things are actually not changing that fast as they seem to be. There are somehow always the same fundamentals- try to understand those a bit and you will be able to easier see the big picture. There is always a database- somewhere. There is always a cloud- somewhere. You always have some apps- somehow. And you also have a smart phone, a desktop and maybe a laptop. The rest is just ... pushing buttons :) [of course I am simplifying things but it's something like that.]

So please, I urge you to remain curious and to keep learning and playing with new technological things. Weather it's your new iPhone and you just take pictures of your broken refrigerator parts to send them to your contractor or it's your new PC with a new awesome flat screen where you lookup things on the Maps, whether you are new on Facebook and you are trying to figure out how to post a "selfie" while staying in line for coffee or whether you want to see how you can enroll your kid in a new health insurance plan in less than 10 minutes there is always opportunity to learn and exercise technology.

Give technology a chance and technology will not let you down ...

Life with technology is absolutely beautiful Planet Earth! Let's keep it that way together.

Make it a great day!

Adrian Corbuleanu
Miami Beach, FL
http://wittywebnow.com

Wednesday, December 17, 2014

Angular.js

There is a lot of demand in the tech community for AngularJS. Many companies currently maintain sophisticated data intense web front ends and would like to migrate to Angular. Some others are looking into starting new projects. They heard about Angular and they wonder if they should start straight on Angular or just implement a traditional Javascript/JQuery solution. And there are other companies that are already on Angular, they love it and want to expand on it!

I decided to write this article as the technology is relatively new and there is a certain learning curve for decision makers and IT personnel. Business decisions and productivity can very well be influenced with this technology.

AngularJS is a web applications framework developed by one of the teams at Google in 2009. They were experienced front end developers who felt a need to simplify both development and testing of front end components / web based user interfaces.

Angular is based on a MVC (Model-View-Controller) architectural model which basically divides the application in three different components:

- the model = captures the behavior of the application

- the view = displays an output of the application (such as a chart or a graph on the screen)

- the controller = accepts input and converts it into commands

The controller usually sends commands to the model to update its state or to the view to change its presentation, the model notifies its associated views and controllers when it was a change in the state and the view requests info from the model to update its presentation to the user.

So, in short, Angular works by reading the HTML page with its embedded custom tag attributes. These attributes are interpreted as directives instructing Angular to bind input and output parts of the page to a model that is described with standard Javascript variables.

AngularJS is designed to:

- decouple the UI from the Application's Logic
- decouple the client side of the application from its server side
- provide a structure to the sequential operations of designing UI, writing business logic, coding and testing
- reduce the difficulty of testing (by the way the code is structured)

Angular presents the programmer with very powerful directives that allow for re-usable custom HTML-type of elements. Here are some of these directives:

- ng-app = declares the root of an angular.js application
- ng-bind = sets the text of a DOM element to the value of an expression
- ng-model = establishes a two-way data binding between the view and the scope
- ng-view = handles JSON data before rendering templates
- ng-controller = specifies a JavaScript controller class that evaluates HTML expressions

Here is a version of a "Hello World!" type of application in AngularJS:

<script type="text/javascript"
     src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
----
<!DOCTYPE html><html ng-app><head>
  <title>Hello World in AngularJS</title>
  <script type="text/javascript"
   src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script> </head><body>
     Textbox:
    <input type="text" ng-model="mytext" />
    <h1>Hello {{ mytext }}</h1>
</body>
</html>

The ng-app attribute basically tells Angular to be active in this part of the page. The ng-model attribute binds the state of the textbox with the value of the model (which is mytext). In a two-ways binding way, when mytext value changes Angular automatically changes the model with this value. And if we change the model's value Angular will change the value of mytext.

In conclusion, AngularJS presents the following advantages and opportunities in comparison with traditional JavaScript/jQuery programming:

- enables the programmers to create software quicker and with less effort
- delivers code that is easier to maintain and expand
- improves testing experience
- encourages good programming practices
- allows for easier, smoother collaboration with your team

Examples of applications where AngularJS is a great choice are:

- single or multiple pages web applications / front ends prone to future expansion
- complex, data intense applications
- web applications where the front-end developers do not have access to the back-end
- detailed, "grid-type" front-end applications such as financial applications or applications for accounting firms
- any other kind of application where html rendering in the browser makes sense

Examples of applications where AngularJS would not be the best choice are:

- highly computational / mathematical applications
- games

Make it a great day!

Adrian Corbuleanu
Miami Beach, FL
http://wittywebnow.com

Notes: to document for this article I used the following online resources.

1. http://wikipedia.com
2. https://angularjs.org
3. http://viralpatel.net
4. http://jeremyzerr.com

Monday, December 8, 2014

Node.js

Node.js is an open source runtime environment / platform that allows advanced programmers to build scalable, high-performance network applications.

Since lately there is a lot of node.js buzz in the Miami start-ups community, I decided to write this blog & explain the technology in a little more details. This blog does not want to be a comprehensive a node.js manual but it will give new developers and business community an idea about this relatively new technology.

Node.js gets implemented server side (i.e. on a Linux machine), it's based on javascript and it uses an event-driven, non-blocking I/O model which is very good for data intensive real time applications.

Node.js was created by an individual by the name of Ryan Dahl in 2009. It is currently gaining popularity and it is used by some large companies like Microsoft, Yahoo, Walmart, Groupon and Paypal.

The story says that Dahl was inspired after looking at a large file upload progress bar on Flickr. The browser could not assess what percentage of the file was uploaded and it had to query the server to retrieve that information.

Node.js can keep many connections alive without having to reject the new incoming connections. It can be compiled on the linux server and, many of these enhanced packages/libraries, it can also be downloaded as a pre-compiled library/binary. Combined with a  document database (such as MongoDB) node.js offers a unified javascript development stack.

Here are a little more details about the philosophy of non-blocking code:

Blocking code looks like this (in some form of pseudo code):

Read file from Filesystem {
Store content
Print content
}
Do something else

Non-blocking code looks like this (in some form of pseudo code):

Read file from Filesystem {
Whenever you complete, print content
}
Do something else

While apparently there is not much of a difference between these two different ways of serving things, if you sit down and draw time diagrams of these calls you will notice significant differences in performance.

Let's say we have 2 calls: one that takes 7 seconds, the other one takes 3 seconds.

When you run these two different calls in a blocking manner they will be sequentially served and the total time to process them will be 10s. When you run the same two calls in a non-blocking manner they will be served in parallel and the total time to process them will be 7s resulting in a 30% improvement in performance. The more concurrent calls you have, the more you will improve.

Syntax wise, on a standard linux machine:

Blocking

var content = fs.readFileSync('/path/to_filename');
console.log (content);
console.log ('Keep going');

Non-blocking

fs.readFile ('/path/to_filename', function (content, err)) {
console.log(content);
}
console.log ('Keep going');

Please notice the difference in the names of the system functions, readFile for non-blocking (or async) vs. readFileSync for blocking.

This example is just illustrating the concept on reading a file but similar code constructions can be built to consume web services, start/stop web servers, refresh web pages in real time etc. With node.js the events treated in the loop are always asynchronous. Typical blocking operations such as calls to web services / apis, reads / writes from / to databases or calls to extensions can now be accelerated.

Here are some types of applications you can build using node.js:

(1) Chat servers
(2) Social media networks
(3) Fast files upload solutions
(4) Ad servers
(5) High volumes e-commerce sites
(6) Collaboration tools
(7) Mobile apps that talk to a db via an API

Here are some types of applications where node.js is not the best fit for:

(1) CPU intense applications / algorithmic applications [i.e. it won't be the best idea to write a chess game in node.js]

Make it a great day!

Adrian Corbuleanu
Miami Beach, FL
http://wittywebnow.com

To document for this article I used the following online resources:

1. http://nodejs.org
2. http://codeschool.com (node.js for dummies)
3. http://stackoverflow.com
4. http://wikipedia.com