Gorilla3D

Blogs of my work and thoughts

Subscribe to RSS feed

Is Open Source worth it? Proprietary to the rescue!

I work for a company that gives the source code of the project, to their clients. The client can do whatever they want with it*, yet the company is still labeled as proprietary. The ONLY reason it falls under that is because the customer cannot resell the application. It is not locked to a server, or core, or even anything else other then the client cannot mass sell the software that was built. They can sell the company and the software can be sold with it, but that's it. Every day there is a fight over open source and the company. Yes we use open source software, yes we give you the source, yes you can go hire anyone you want to work on the source code and yes the company will be there in case anything goes wrong.

Now what I see over and over and over again are client picking open source solutions and thinking it was the right choice. The reason the client chooses open source software are to have proven solutions, to have a community to fall back on and to have a developer base to pull from. However what will happen is the client will choose the open source software, get the work done they need and leave the solution alone. This is where problems start to happen.

If you leave any software alone for 5 years things start to happen. You grow as a company, your needs change and then that same community, that same developer pool to pick from will fade. So your only solution is to find someone to work on your project and the thoughtful cost saving times quickly catch up to you. Now if you had decided to stay up to date, then those plugins start to rot, the parts that made the software useful. As the software progresses, the community moves as well. Your interface changes and you quickly realize that this perfect work of open source software isn't ... perfect. In fact there are a lot of hidden costs you do pay, mainly in time.

The cost of your project, is only the beginning. If you put $30,000 into your application then expect $30,000 more in maintenance, updates and hosting expenses in the next few years. Many clients shoot their money like a shotgun when it comes to software. This is a big mistake as they should be investing their money as a steady stream of water. What you think customers want, and what you think sells, will come to haunt you. You need to be able to accept change, be flexible and if your software isn't able to change or be flexible as you are, then you're going to run into a brick wall. The concept of open source vs proprietary doesn't even matter, if you have to go through hell to make a simple change then that solution was a bad choice. No one, not even myself can make the right choice for you, but I can leave you with this advice.

Everything you think you need is really unneeded. Process defeats and over comes software limitations. Spend that money in other areas to help your business, design, marketing, new hires. You'd be amazed at where you could be and how fast you can move if you think simple.

Why choose Railo

The past year and one half I had to deal with cold fusion. Everything I read about how horrible cold fusion was really was true. Everything was highly unorganized and source code formatting just wasn't working at all. Coming from PHP it was over all a big nightmare. On top of that reading XML as logic was very frustrating. During that time I had found Railo, to run a few things in CFML.

So now I have a new project, a shopping cart. I choose Node.JS as my platform, hoping I'd get huge amount of speed from asynconous programming. Roll forward a few weeks later and its ugly points started to show. I had choosen Jade as my template language which generates JavaScript code out of their template (it's really fast). However to really make use of it's code generation it really needed to be cached. Caching the template amounted to many hours of work just to get it working. Most the time was spent finding decent logic to update the cache of a template. Seemed easy enough but reading a template was asynconous and then certain templates relied on other templates. So getting the needed templates recached, and in a synconous way proved to be a pain. Ever more so turning my code base into a pile of crap just dealing with caching and non-asynconous tasks (like scaling a lot of images, one at a time) when all I wanted to do was program the logic of my shopping cart.

So I took a step back and asked, what if someone else wanted to edit something on this website besides me? Could I still get the speed of Node.JS while making it easier to edit? I had jumped into Microsoft land with Web Matrix and started to really like the plateform. In a click of a button I could have a C# web project, not only running but hosted as well. However that quickly hit the crapper when Web Matrix crash. I re-installed, deleted started files and nothing good would come of it. So I tried to manually get the project running via command lines. I finally gave up, and for the reason that if you don't have the tools needed, then editing this site would be hard for anyone else.

That is when Railo poped back into my mind. As horrible of idea of Cold Fusion was there are many points Railo has that makes it designer and developer friendly. On top of that, using markup as a template language is already what HTML already does. So anyone working on HTML are already very close to Cold Fusion Markup Language. On top of that getting Railo to run, is a double click away (using jetty) and running on all major platforms! The bigger pluses come from its cache system, not just template cache, but any cache you want. It can hook into memcache and you'd never need to change your cache code. However the most important part was being able to escape CFML for the end all of logic. All complicated non-markup logic can be done in CFScript, which is very much like javascript (another big plus), but it could also be done in Java. However there is a even more, because everything is running under Java in the first place you can now use languages that run on the JVM, like Jython (Python), JRuby (Ruby), Rhino (JavaScript), etc. Instead of <cfscript> it could be <cfjython>... So why not use an blazing fast template language (Cold Fusion ermm Railo) that has proven itself for many year. Why not use something that can scale, be open source and make it easier for designers?

I am not here to sell you Railo, after all its free. This does bring me back to why I had the many negative views on Cold Fusion. Those views were really about the developer using the tool. Much like when you work on a PHP project that was outsourced and resulted in pile of crap. Use the tools wisely and issue like this won't happen. I think Cold Fusion, as much of a dying language it may be, have a perfect role in Web Development. It's just sad to see projects like the I had to work with for a year and 1/2 to make me think its unsuitable. So for my next project and any project after I am choose Railo over Php, over Node.JS, or Python and Ada when it comes to web development and really for the most important reason, ease of introduction and productivity.

If you want to take anything away from this blog post, it is that Railo is a very productive platform to work on. It may not be as fast as NodeJS but not having to be stuck in an async model is worth some speed lose. In reality if you really want a fast site, then cache is important, as well as a great programmatic design. If you are able to do that then the same speed you'll receive in NodeJS are the same if not faster in Ralio.

My thoughts on CFML and Jade

What is CFML?
CFML or "Cold Fusion Markup Language" is just what it says. More importantly it is very mature and complete language to use for templating a website. Miva Merchant is another example of a mark up language that comes very close to CFML. Now CFML comes in a few flavors, as in what it takes to parse CFML files. Adobe has their own tools and there are free and open source tools like Railo. Using XML tags to transform markup is nothing new. There are even projects like XSLT which is a very complex beast.

What is Jade?
Jade is a very new template language used in the increasingly popular JavaScript language. There are even ports to other languages like PHP, Python and others. Jade is along the lines of programming in Python, which the exception that you can use pure html in your Jade template if you were too lazy to convert them to their Jade counter parts. In Jade there are no end tags, no curly brackets to tell when a element starts and stops. This is all laid out by tabs, just like in Python. Now in the world of Python, space is beautiful. Which makes Jade very appealing.

What logic based templates matter!
So why would I even remotely associate these two templating languages when they are anything but the same? Well my friend, prototyping in a template language will be your best friend towards rapid development. This is why PHP is used so much. In between some random strain of HTML you could have the most glorified logic even know to mankind. You were able to do that with out slapping your head against logic-less template engines. Both Jade and CFML can give you that world, as ugly, and wrong that decision may be.

Examples!
So lets dive into some examples:
CFML
<cfif StructKeyExists(item, "options")>
    <cfloop collection="#item.options#" item="i">
        <cfset formItem="#item.options[i]#" />
        <cfif not StructKeyExists(formItem, "type") or formItem.type eq "select">
            <cfset hidden = StructKeyExists(formItem, "depends") ? "display: none" : "" />
            <label class="custom-select" for="#formItem.name#" style="#hidden#">
                <span class="custom-text">#formItem.title#</span>
                <select id="#formItem.name#" name="#formItem.name#" required="#formItem.required#">
                    <option value=""> - Select One - </option>
                </select>
            </label>
        </cfif>
    </cfloop>
</cfif>

Jade
if item.options !== undefined
    each formItem, i in item.options
        if typeof formItem.type === 'undefined' || typeof formItem.type === 'select'
            label(class='custom-select', for=formItem.name, style=typeof formItem.depends !== 'undefined' ? 'display: none' : '')
                span(class='custom-text') #{formItem.title}
                select(id=formItem.name, name=formItem.name, required=formItem.required)
                    option(selected, value='') - Select One -


Now both of those are horrible examples, but the perfect examples at that. Data "could" be there or it could not. You're going to need to loop through the data at some point as well as set custom attributes to html elements. This is life in the world of templates. Also take note that you are not saving any indentation steps, at all. You may also notice that although Jade is more compact, it is highly unreadable. You really need to site there and scroll horizontally to even understand remotely what it is doing. Personally I like a very verbose language. It is one of the reasons I love Ada so much. You might save time in typing but you'll lose time in going back to maintain what you've written.

How to get Ada AWS 2011 install on Windows 7

1) Download untar / install GNAT 2011 & AWS from Libre Ada Core. You wont be able to install AWS yet, but GNAT can be installed as it is an installer.
2) Download and Install MinGW from MinGW on Sourceforge.
3) Run "MinGW Shell", just search from the windows start menu, or go to "All Programs" -> "MinGW" -> "MinGW Shell".
4) Change the directory to the place where you had decompressed AWS source code. Example:
cd "C:\Users\joseph\Downloads\AdaCore\AWS\aws-gpl-2.10.0-src"

5) Run
make setup build install

6) This will install, however it will be broken. Locate aws_lib_shared.gpr, I found this file at "C:\GNAT\2011\lib\gnat\aws\aws_lib_shared.gpr"
7) Edit the line
LIBZ_Path := "/c/GNAT/2011/bin/../lib/aws/native/static";
to be
LIBZ_Path := "/GNAT/2011/bin/../lib/aws/native/static";
Here is the final file:
project AWS_Lib_Shared is
   for Source_Files use ();
   type SSL_Library_Kind is ("relocatable", "static");
   SSL_Library_Type : SSL_Library_Kind := external ("SSL_LIBRARY_TYPE", "relocatable");
   LIB_Path := "";
   S_SSL_Lib := "";
   R_SSL_Lib := "";
   S_CRY_Lib := "";
   R_CRY_Lib := "";
   S_TLS_Lib := "";
   R_TLS_Lib := "";
   S_GCR_Lib := "";
   R_GCR_Lib := "";
   --  libz
   LIBZ_Path := "/GNAT/2011/bin/../lib/aws/native/static";
end AWS_Lib_Shared;

8) Compile the hello_world in "aws-gpl-2.10.0-src\demos\hello_world". This can be done in the regular command prompt, you are not required to use MinGW shell at any point after you have completed step #7. To compile hello_world, just run "gnatmake -p -Phello_world"

Well, that's it for now. I had looked around and it seemed like there are much more complicated ways of doing this so I hope this is the easiest of them. Good luck on your next Ada AWS web server project!

When to use Dojo, MooTools or jQuery

This is not a war about which framework is the best. These are very mature and powerful libraries to use. This is also based on my experience and not my readings.

Dojo

Dojo's biggest strength is it's UI, Dijits. Both jQuery and Mootools lack a complete UI solution. Dojo also has a very organized modular system and while large, it can be fast. With its 1.7 release you can now load modules when needed and not when the browser is loading the entire page. It also has a very strong Mobile UI, being more mature and extensive then jQuery's Mobile. I feel that if you want a very enterprise level framework that's akin to ExtJS then this is probably your best bet.

jQuery

jQuery's roots are in quick results. An easy API that lets you traverse the DOM to get work done. It's biggest strength is it's community. I've never taken a liking to jQuery, however it's UI is simple and get your projects moving fast. Another plus is it's documentation, which is why many designers and entry level developers pickup jQuery.

Mootools

Mootools is focus on clean API and object oriented design much like traditional languages. While Dojo also has a class system, Mootools seems to shine when it comes to OOP. It's a much better library to keep your project in line for long term development. Mootool's UI is rather lacking since there is no offical UI for it. However just about every MooTools plugin is extraordinary flexible, if not, then written well. So making making changes to plugins are easy enough. One of the biggest complaints of MooTools is its issue with global scope. It attaches to to every element extending those objects's ability to be much greater. While I do like that feature it does make working with other libraries a little bit harder. There is a pure server edition which is a better option to pick if you only want the OOP aspect and tooling of MooTools without it's DOM aspects.

My First iPhone Game Part#3

So after a lot of procrastination I made some progress. I have basic scene logic, which is clearing up all resources and loading the resources needed for the next scene. A scene can be a game menu, or the game itself. As for finding out if it was possible to remove an image or view, its a big nope. Basically you'll have to reuse existing views you've already created and for images, just swap them out. This is a big issue, but if you think about it, at least your application will not crash because your trying to access an image that is not in memory.

The Map

After that I moved onto the map, which presented a bit of an issue. DragonFire SDK does not let you write a c structure to file. In fact it must be a char*, array of characters. So whats the problem? Well let say I have a map 4x4, this will be represented with 16 characters to save to file. Now think, how many letters can you fit inside a single character? Well, if you guess it, then its one character! The max range of one character is 0 to 255 in a decimal format. Oh wait, it can't be that because its not unsigned char* your working with, its (signed) char*. So the max range is -128 to 127, which is still 255 possible types of tiles. The most logical step is to just convert the tile id from an integer to a char*. So an unsigned short, let say 15,000 is 2 bytes, which will end up being 5 chars hence 5 bytes. Congratulations you just limited yourself to 2.5x smaller the size of possible max map size! I am not very happy with that result. Sticking with 255 possible tiles is not a solution for me. I want more then 512, 1,024, 5,000, heck 32,767 possible tiles would be a perfect number right? So here are the steps I took to at least write the map to file.

First I get the tile id, and convert it to a string. However when you convert an integer to a string you don't have a fixed string size. This becomes an issue when you want to have simple logic to grab the first 3 numbers in the integer, and then the last 3 numbers. So for now after the number is converted I force a length of 6 bytes to overcome this.
//-- Convert tile id to a string
short numberLength = 0;
std::stringstream out;
out << map[i];
tileString = out.str();

//-- This helps prevent an overflow of two chars
numberLength = tileString.length();

//-- If I don't resize to a fixed size, then substr will fall out of range
tileString.resize(6);


The basics are, split the one number into two numbers and if the first number is greater then 255, then push the remainder onto the second number. This becomes an issue with numbers like 999, as it will fall over to the second number with a value of 744 which is greater then 255. So to get around this, I just have some basic logic, if the number is smaller then 5 digits, then just chop the number in 2 digits each rather then 3 digits each. Limiting the char to 2 digits for number smaller then 10,000 allows me to utilize the full range of numbers up to 32,767. It could go even higher, but 32,767 is a very decent number that I will not hit any time soon.
//-- Split the string number into two parts, so they each fit in a char

//-- Part One
int one, two, placeholder;
int start, stop;
placeholder = 0;
start = 0;
stop = 3;
if (numberLength < 5) {
	start = 0;
	stop = 2;
}
if((std::istringstream (tileString.substr(start, stop).c_str()) >> one).fail()) {
	one = 0;
}

//-- If this number is too big then add the remainder to the placeholder
if (one > 255) {
	placeholder = one - 255;
	one = 255;
}

//-- Part Two
start = 3;
stop = 3;
if (numberLength < 5) {
	start = 2;
	stop = 2;
}
if((std::istringstream (tileString.substr(start, stop).c_str()) >> two).fail()) {
	two = 0;
}

//-- Apply any placeholder
two += placeholder;

//-- Save to map
mapStr[i * 2] = one - 128;
mapStr[(i * 2) + 1] = two - 128;


Other then that, this concludes another part into my iphone game progress. I have not had any more force quits when running on my iphone after compile by the DragonFire SDK build server. Oh I did notice there are a few undocumented functions like FileDelete. I am still a happy with DragonFire and can't wait to finish my map loader and saver. I think the next post will be my map editor, which will most likely be browser based, which PHP code on the backend to pack the binary maps.

Still reading? Probably a good reason why. This is because you want to tell me on how wrong I am about being able to get a short integer to fit into 2 bytes, and still being able to decompress it. Well my friend you are right. I have no way to read back a tile id, if the value was shifted between two bytes. And it took me a day to sleep on it to even think about this. So here is the resulting code to resolve this issue. I ended up having to use one extra byte.

//-- Convert tile id to a string
std::stringstream out;
out << map[i];
tileString = out.str();

//-- If I don't resize to a fixed size, then substr will fall out of range
tileString.resize(6);

//-- Split the string number into trhee parts, so they each fit in a char
int digits[3];
for (int d = 0; d < 3; d++) {
	if((std::istringstream (tileString.substr(d * 2, 2).c_str()) >> digits[d]).fail()) {
		digits[d] = -1;
	}
	
	//-- Save to map
	mapStr[(i * 3) + d] = digits[d];
}


I instead need at least 3 chars, 3 bytes to compress a short into. Each byte will go up to 99, but no more, fitting perfectly into a single char, 3 times. This means I can have a max tile id of 999,999 tile ids. This much more then the 65,535 possible ids in a short, but again this will do. The resulting code is much more compact and well simple. This will make my maps 50% smaller then before but I still save 60% in memory compare to using one byte per number.

So the big question is how big of a map can I fit into memory before I need to read in a new map? Well as long as I keep the number of layers low, let say 5 layers. The first layer will be the ground tiles. The second layer will be decoration. The third layer will be characters / npc. The fourth layer will be walls and object the character will go behind and the last layer will be for clouds. I really don't need to describe the last layer in a map, this will be auto generated. So then, what will one map size be? Well let's try this:

x = (256 tiles * 3 bytes) // The x will always hold the tile id.
y = 256 // the y stuff?
z = 4 // layers

x * y * z = 768 kilobytes of memory

My First iPhone Game Part#2

So I started to draw some thoughts on controls. It would be nice to have the player just press and drag the character to where they want. This would act a lot like Google Map's little yellow man. I have always found it painful to implant controls on top of the game screen, because there is no physical indicator to tell your finger is not longer in the bound of the control, its hard to know until your character stops. Then your lost for a few seconds seeing what finger is doing the wrong thing. When in a stressful situation its so easy to have this happen promoting death and frustration to the end user. There is always the notion of walking in a game, but if your just dropping your character everywhere you lose that delay. I am expecting to implement that delay by the screen panning to the center of the character. While the screen is panning you'll lose the ability to move your character. I could also super impose a limited drop range. This could be effected by the weight of items in your bag, or special attributes like dexterity. It would also work in multi-player situations, as the the screen is panning the character would really be moving on the other player's screen. It would be interesting to see as this is a lot like chess. You'd have to expect where the other opponent would be moving to, to cast your spell, shoot your bow, or run from.

I've been messing with the DragonFire SDK a bit more and still pondering the question of how to manage views, images, text, etc when you don't need them other then making them invisible. I've been busy wrapping the SDK into c++ classes. Their SDK is c based, so although you can use c++ with it, you're not in a very good position unless you do extra work like I am.

Here my c++ wrapper work on their SDK
Shabb::View v = Shabb::View("Ball.png");
v.getWidth();
v.setX(23);
v.setTouch(OnTouched);


Here is the c code for the same functionality as above.
int v = ViewAdd("Ball.png", 0, 0);
int width = ViewGetWidth(v);
ViewSetxy(v, 23, ViewGety(v));
int TouchHandle = TouchAdd(0, 0, ViewGetWidth(v), ViewGetHeight(v), OnTouched, 0);
int ViewSetTouch(ViewHandle, TouchHandle); 


I've also went ahead and upgraded to their Ultimate Iphone package since I've been reading about bad experiences with the SDK. I've been down this boat before (Titanium Mobile SDK) and so I would like to test on my device early before I complete the game and find out something I did, needs to be junked. It took a little over a day, to register my device (just like their website says). I used their contact form to email them and 3 days later no response. So I just emailed them directly and 10 minutes later I got a response. Their site states 6 hours, so overall that is a great response time. I did get a quick demo to compile on their server. I successfully installed it on my phone and overall excited to see it really worked. Again coming from Titanium Mobile SDK, setup is so easy and really just amazing. However the build process is very tedious. Once your ready to test on your device, you upload it to their server you get the file in about 10-20 seconds. Make sure you click and spam the "Check Status", because refreshing the page will have you sitting there for hours. Once I got the demo running I started on my own game. I quickly found it crashing on my device and not the emulator. After 2 hours of zipping, uploading, unzipping, dragging, replacing and rerunning, I got it to not crash. It was over a stupid printf call.

Here is what I had:
	std::map<std::string, Shabb::View>::iterator p;

	for(p = sviews.begin(); p != sviews.end(); p++) {
		std::string name = p->first;
		Shabb::View v = p->second;
		v.hide();
		printf("Deleting: %s\n", name);
	}


Here is the resulting code that worked:
	std::map<std::string, Shabb::View>::iterator p;

	for(p = sviews.begin(); p != sviews.end(); p++) {
		std::string name = p->first;
		Shabb::View v = p->second;
		v.hide();
		printf("Deleting: %s\n", name.c_str());
	}


Now with the visual c++ compiler, the output of the printf resulted in funky characters. I thought nothing of it, just was a weird thing. Well turns out, it wasn't just a fluke, since it resulted in a crash on iOS. There is not a compile error, and I don't receive the log from the build system when completed. Overall this was about 2 hours of work, I felt like a real programmer, "Real programmers don't use debuggers". Obviously its not a fun process, hopefully I will become better at this and avoid stupid mistakes.

I would love to see their starter SDK free as I can see a huge up taking on this when it comes to making games even on the PC. Their SDK is lightweight, simple and so far is great.

Until Next Time,
~ Joseph Montanez

My First iPhone Game Part#1

I made a bold move from android to ios a few months back. Overall I am very happy with the move. I think the biggest win over is never having a phone that lags. Anyways I started game devlopment on an android device which had become overly complicated for no reason. This game was for my girlfriend and well, it went no where. So now we both have iPhones and it is no longer is possible to make her a game. I have always been a Linux and windows guy. So I did some searching for a way to make games for ios without an intel Mac OSX. I found dragonfire sdk, a way to make games on the iPhone on a windows machine with visual studio, c or c++.

Right now I've only purchase the starter kit for the iPhone, mainly because I was unsure about the development. It took about 5 minutes to get started and it became appearnt that this was about the easiest game develment process I've ever been apart of. The sdk has a very small set of functions it's like when I was learning quick basic. Even with the limited function set, it's just the right amount to do real work. However I am currently running into one major issue. When you add a graphic, view, text, button... How do you remove it? I tried deleting the pointer but that just segment faults the program. So for now the only work around I have to work with is to set the item to invisible and then reuse it later. So if I load up 3 views and then just need one, I hide those two. However if I now need 4 views, then I'd grab the 2 empty ones and create one more view.

Anyways that's my development so far. I really do like the dragonfire sdk, so hopefully in the next post I can provide a better outlook on use of the sdk and provide a little bit information on the game I am working on.

Free Pascal Templates / Generics / Containers

,

No matter what you want to call them Free Pascal has had them since 2.2, before Embarcadero's Delphi compiler had them. Creating your own generics in Free Pascal can be a bit cumbersome especially when you just want a container to use. So FPC has created the FGL unit that has the basics to get real work done. Here is an example:

{ Compile with "fpc list.pas" }
program list;

{ fgl contains the templates we need. }
uses
	fgl;

{ We have to create a type using the template }
Type  
	TIntegerList = specialize TFPGList<Integer>;

var
	{ Now we have a list container! }
	NumberList : TIntegerList;
	I, Item : Integer;
begin
	I := 1;
	{ Create the List }
	NumberList := TIntegerList.Create;

	{ Add some stuff to the List }
	NumberList.Add(I);
	NumberList.Add(23);

	{ Iterate through the list }
	for Item in NumberList do
	begin
		WriteLn('Item: ', Item);
	end;

	{ Destroy the List }
	NumberList.Destroy;
end.

Why choose NodeJs / RingoJS over PHP

I've tried a LOT of other languages for web development. Its become apparent that a web application, or more importantly a web service will be the glue that holds together a company. I've used PHP for over 6 years, pushing the language into areas it wasn't designed for. The issues I have been running into for the last 6 years has to do with client side development. At this point minus php GTK, you have to deal with a browser. That browser will have javascript. That javascript will have a lot of overlapping code. However that code is different because its in another language. For example, form validation will need to be written in JavaScript (client side) and in PHP (server side) for security and accessibility reasons. There are a few ways around this. First off you could use something like Zend Forms with Dojo. This Library will save you from writing the javascript part, but there cost is complexity. The average programmer, will not be able to move quickly from the start. Second, you could use a php to javascript transcoder. A transcoder will convert PHP into javascript, so if you've used Coffeescript, then your using a transcoder. Transcoders can save you a lot of time, however unless you know the environment, it will put you in debug hell. Third use another language that also use transcoders. Pascal and Haxe are both languages that can produce PHP and Javascript. They give you static programming which helps a lot in not making stupid mistake. However you do move even further from the platform, making it hard to debug.

So far I've mainly describe how to avoid writing javascript. Its not that the language is a bad one, but its use in server side development has never been a great one. The tools that are in a language like PHP are far better then javascript. So yeah I should share a common ground with code as long as I can use the same programming language in both the client and server side, but I lose efficiency with not have the libraries I need.

NodeJS

NodeJS just keeps getting better. Its recent release adds Windows support, and clustering. I've used this in a recent project for one main reason. My team knows javascript and we needed to write apart of a web application's functionality to meet a higher scale of connections. The downside is that my ability to share code between the browser and nodejs was limited to passing JSON objects. Making the statement that you can reuse a lot of code is not really helpful. There is a lot of abstraction that needs to happen before it can be useful. For example, it would be perfect to just write SQL in the browser that will produce an ajax call to the server to execute. That same client code can be moved into the server and be smart enough to not have an ajax call. The same with image editing, dom parsing, etc. These higher level activities become really hard to share between the client and server. Its almost stupid to think we have to really program like this. That browser, should be the server too and NodeJS is making it easier, but really just think about it. An online game will most likely use the same language for the client it makes and the server it runs on. So if the server is C++, then the client will be C++.

Ringo JS

The only reason I want to bring up Ringo is because there is a big problem with NodeJS. NodeJS can be helpful for larger scaled applications but an event loop is flawed (how nodejs works). The way you have to write an application is completely different, since everything needs to be asynchronous. For a server its deadly to lock your only process to serve one client. Now you might think, well in the browser its been working fine, but the browser is only ever wanting to do one to two actions at a time. So you can afford blocking actions. The server maybe processing over 1,000 actions.

So where Ringo falls into the picture is the ability to normalize programming. You can gain the speed needed write applications faster, without investing the frustrations and extra work of asynchronous programming. Ringo lets you make the mistakes, since they can always be fixed later.