Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts

Tuesday, May 24, 2011

Games, Algorithms and Code

Thought of publishing a new post with links to some of our earlier posts to help the users who have joined us from syndicate sites we have recently got listed into.



BTW, all algorithms, some code we produce, analysis in solving some gaming puzzles etc are in the coding blog which is iq-games Our starting puzzle Towers of Hanoi was just complete there (with a staggering series of 10 posts!) That series takes one deep into the world of Hanoi Towers with general cases (what we know most is just a one specific case of the puzzle), multiple towers etc After analyzing the puzzle and sharing ideas and explaining of algorithms, finally the source code has also been shared there, have fun! For absolute beginners on towers of Hanoi, this link should be the starting point. Those who already know the puzzle and the code to solve the basic case of it, can start from here to dig deep. More game analysis, algorithms and code for different games/puzzles will appear in this blog, stay tuned....

At this blog we have discussed about the future of Thin Client and Javascript. We placed our bets on web application to over take desktop applications and similarly languages like Javascripts together with technologies like HTML5 and AJAX are poised to become next big things in the programming world. Like to know more ? hop in!

Newest programming Language! Ceylon!! will it overtake Java ? what's the secret reasoning behind naming it as Ceylon ? (of all names for god's sake!) read Here to find more...

Can meditation help improve programming skills ? What's in common with programming meditation and Chess ? You will find few more questions and even fewer answers in here.

Finally, what we are about. The Free for all online gaming site!

Tuesday, April 19, 2011

Ceylon - The New programming language to take on Java !


News of the day (oh well, may be yesterday) is that the newest upcoming programming language to take on Java's enterprise market share could be Ceylon. A big thank to my good friend Damith for putting me on this news.

Yep, you heard it right. (Check the date of this post if you don't believe me. See, it's not April 1st!) The very first thought to spring out screaming is why that particular choice of name ? Well, I think it's a easy guess (and I'm taking a personal risk of being wrong here).

Folks at Sun Microsystems used to drink lot of coffee while developing the new programming language they intended to take on C++, when they were faced with the task of choosing a name for it, they choose the place where their favorite beverage is coming from. Java. So I bet good folks at RedHat are drinking tea and buckets of it! May be it is the ultra healthy Green Tea. Well, good for them! at least they have got their beverage right, Ceylon Tea!

Back to the language itself : Some have rushed to call Ceylon the (would be) Java Killer. Although the creators of Ceylon themselves are more cautious and pragmatic. Oh, I forgot to give the original article yet. Here it is.

According to the Gavin King (as mentioned in the article above) lead of the Ceylon team at RedHat, New language will have following goals : It would run on the JVM and feature static typing, automatic memory management, and built-in modularity. 

Following current problems in Java were also given. Tied too much with XML, absence of a good way to design a user interface, A lack of language-level modularity, issues in Java meta-programming, Java SE (Standard Edition) SDK lacks modernization and is bloated etc.


In one of my earlier posts I made a case for Java Script (or something similar with a sexier name) to be the next big thing in programming. I was prepared for comments like "JS, r u sure? Java and JS are miles apart" or in that line of thinking. The given article says : "Java also has survived amid competition from dynamic scripting languages such as JavaScript". Well, at least the official comparisons have started to appear on that count. We will see more and more items on this line of thinking in the months to come...

Back to Ceylon vs Java. Now then here are my interpretations :
1) Language is being made by a very capable team at RedHat who are already "unapologetic fans of Java" So it's a safe bet (unless they make some really bad design decision upfront) that the new language will be a better one than Java. When Subversion team wanted to build on existing CVS and make a better one out of it, they did it, for instance. These folks know the strengths and weaknesses of Java so this part is a safe bet I guess.

2) The point above does not in any way imply Ceylon will beat Java at the enterprise software market. Being just a better language is not enough for that! Developers should have a very compelling reason to switch over to a new language. I think Ceylon will not beat Java in a hurry and become the top language in that sector in any time soon. There is simply too much inertia for Java right now. Unless.... well, lets get back to that in little later.

3) I'm not sure how important it is to have a "good way of designing a user interface". While it is certainly a good thing to have, I think the days of thick clients are on decline. To be the best future language, this user interface design part (assuming they mean thick client user interfaces, like in Java Swing) will not contribute that much. However it will be hugely important to have a light weight framework (MVC preferably) to develop web applications, may be that should be very close or built in to the language components it self, or may be the language should make it really easy for others to develop such frameworks. Web applications are going to be the future, current Java frameworks (struts, JSF etc) suck.

4) Having a JVM and automatic memory management is a must these days nothing surprising there.

5) To beat Java at their own game, one need some revolutionary new features, aspects or paradigms. Let's see whether the new language has got any. May be they have few cooler stuff hidden on their sleeves but if they have I didn't hear King mentioned any yet. Let's see what we mean by revolutionary changes.. How did Java beat C++ ?

Java had cool features C++ could only dream of. Java introduced (or got it right and made it popular) memory management,  a huge issue in C++, a JVM a very novel concept which gave them the theme "write once runs everywhere" (or "write once debug everywhere" depending on which camp you are in), garbage collection etc  These were Huge improvements in those days that C++ folks have migrated en mass.

What would we like to have in a future language which would embarrass Java ? Here is my List, for more see in here :
1) Dynamic language features (such as in LISP, Ruby) lot of meta programming.
2) More support for scripting. macros etc
3) Do away with Type Safety and statically bounded types (this would be a  tough one for a enterprise language)
4) Inherent support for web applications. (Java introduced JSP, where to go from there?) and AJAX in particular.

Success of Ceylon being a Java Killer will depend on those factors (and also probably few others I have missed) I think. So far I haven't heard much on those lines.

Ceylon would be a better language but will it be better enough to convert Java followers, that's the question!

However, there is no doubt that the King and his team at RedHat have got the most important thing absolutely right. The name!! that will certainly give the new language some wind initially. (partisan thinking here, take no notice! :-) )

Going to have my cuppa now.. and I like the green type.

(Image source http:/www.decidetostayfit.com)

Sunday, March 13, 2011

Destiny of the Thin Client and Java Scripting


Applications which run on web browsers are getting expanded by the day. Some are things which (just few years ago) we didn't even believe was possible to have on a web browser. Anyway, the purpose of this article is not to debate the life time of desktop applications. May be some other day... but not today.

For the arguments sake, let's just say that there are more and more applications now running on top of a browser (thin client), Hence in future there will be many many apps written in scripting languages which runs on browsers.

Let me share with you few experiences I had recently come across on the programming front, the thoughts they generated and their conclusions. To make it bit interesting, I will disclose the conclusion first, then we would discuss the reasons for it.

Conclusion (my prediction for future) : Java Scripting (or something similar) is destined to conquer the programming world!

there... I said it! Some might say Java Scripts have already conquered the world.

For others, here are my reasoning :

Like mentioned before there will be more number of web based applications/products in future than desktop applications. This client is winning the war against the thick client. Javascript is designed to run on thin clients, the platform which is most common and will be most supported in future. (if not already!)

Programming is now moving once again towards dynamic, loosely typed languages which offer more flexibility and productivity to developers.

This is why people embrace new languages like Ruby, when C++ like languages are increasingly looked down upon. Strongly typed is no longer considered a good thing, not necessarily. Steve Yegge has apparently become so frustrated with Type Safety that he has written this little (well...,  long actually) story about TS (Type Safety). Power of dynamic programing languages is very attractive and top programmers are already either  migrated, migrating or considering doing it. Here migration is from C++, Java .Net worlds into the worlds of Ruby, Haskell, Lisp etc. To me it seems like the Virtual Machine concept is the only thing which keeps Java alive right now. They have the best VM so far designed, as soon an alternative VM comes for another language (or one which supports multiple languages) things would start to look more interesting.

Java Scripts are dynamic, not strongly typed and very flexible. A language which has a huge potential when compared to the existing giants like Java, C++ etc. There is a common perception that Java Scripts is really simple, naive, not even real programming. This perception is set to change dramatically in the coming few years!  As for a little example, consider how easily you can pass a function as a parameter to another function in java scripts. Read this (With Joel's skillful way of hammering a point through) as well for the ways that can be important in modern programming. I think Java Script has got the basic concepts right in contributing towards building the next big thing in programming languages.

Reasons ?

1) Ajax and so called Web 2.0 - Ajax (and it's fancy but unfortunate marketing term Web 2.0) has made a mental shift in web aplication programming. User freindly, fast, smooth dynamic applications are now the norm and expectation. Web application is supposed to be very interactive and super fast isn't it ? almost like a desktop application. Well, that's how peoples expectations have shifted.  Think about the effect of this shift on programmers. Ajax means more and more javascripts. More and more advances and cool javascripts. Good skills in Ajax and Javascripts is now becoming a must for a web developer while old giant frameworks like Struts are made to look bulky and outdated in comparison.

2) JQuery : what do we think about javascripts as soon as we hear the word ? a very unreadable spagetti, old C like code, which is somewhere between html and proper programming. Series programmers will not making their hands dirty with that jargon.... well, that was how it was until few years ago, Things are changing now and the change will grow even more rapidly in coming few years. Jquery is a good example for neat, organized library of javascripts. Some vital, so far missing component to popularize this technology. This is a sign of things to come. More and more cool and smart libraries like Jquery will apeear and that will shift the Javascrip language into a new level in terms of usability, re-usability, readability, efficiency and all.

3) V8 & Nitro : Other vast improvement is made from the side of Javascript rendering engines. Google's V8 in Chrome and Apple's Nitro in Safari seems best out there right now but Firefox is not far behind either. This will provide the necessary muscle to run JavaScript code faster and will act as a catalyst to fasten the growth of the technology. More and more tasks will be feasible to run on a browser using JavaScript to power them.

4) HTML5 : HTML5 (and the new element canvas, among other things) is a cool technology which is clearly the future of HTML. This will raise the profile of thin client applications in to a new level. It will also increase the role of javascripts

5) Problems in other rival technologies : Adobe Flex, Macromedia MS Silverlight and other technologies all have problems. None of them as popular, well known and available as Javascripts are. None of them are as readily available everywhere. More importantly, none of them are as commonly accepted by all as javascripts. Problems between Apple and Adobe on iPhone Flash support is just a one example. HTML5, Ajax and improves version of Javascript is well poised to take over the dynamic application development on thin clients.  That will also provide standard compliant, universal, free alternative for all.

6) Anatomy of a modern web application : When we look at modern web applications which offer lot of dynamism, interactivity and finer smoothness of operations for the users, one trend become noticeable.  More and more interesting and smarter code is being written at the front end. Less and less smarter critical code is being written in the back end.

     Now, I 'm not saying all cool, critical code should be written in the front end in javascripts. What I'm saying is that we are used to the notion that almost all activities of a web site happen in the back end and only the dumb, non-critical, display related activities are done in the front end. This thinking is chanigng now. (probably not as fast in enterprise applications as opposed to all other applications, but enterprise applications in themselves is loosing the significance, well. we will discuss that in some other post.) What I find is with the use of Ajax, Jquery and with all other nice feature we could provide to the user using those, we find much more code is being written in the front end. Much more than there used to be! This fact requires recognition and that will also lead to more attention to front end code. (Will put up a seperate article detailing this based on our own development experiance) Skills of writing good Ajax/Javascripts code will be more appreciated while more and more frameworks and technologies would appear to solve the development problems of these parts in web applications. What will all this lead to ? it will raise the profile of Javascripts and it will come to the forefornt of technologies.
 


However, there is a one last improvement remaining to happen. We will need a new name for Java Scripts! Already JS is very different than how it was until few years ago but the perception of it is yet to get updated. If it is to be the new and next big thing, it will surely need a much better marketable name that JS. Any suggestions ?