Showing posts with label programming-language. Show all posts
Showing posts with label programming-language. Show all posts

2013-08-10

99 $items on the $container ...

Do you know the song that goes like:

99 little bugs in the code
99 little bugs in the code
Take one down, patch it around
~
117 little bugs in the code
...

That was about some funny facts we are experiencing some days.

Now something more didactic:
http://www.99-bottles-of-beer.net/


2010-07-01

Software development platforms wars as a movie theme

Summer break make me think about funny side of life.

Check this parody "Java 4 Ever" movie trailer, set in reality of dominance and war between development platforms .



Relax and consider that development platform is only a one of choices for a bigger purpose.

2009-06-08

The best programming language 2 - Simple case tale

The University needed temporary solution for generating list of quiz questions, chosen randomly from data prepared in structured text file. The scope of application was nothing comparing to "Enterprise Systems", so I treated it as a kind of entertaining enterprise.

The core characteristics were:
  • simple logic
  • UI forms for getting parameters from user
  • printable or saveable formatted questions list
  • low burden installation and use (get it on pendrive or download ready to use).
  • main constraints: short time and possibly low cost.

I started looking for similar open source products, but not found needed functionality. So when I checked myself for Not Invented Here syndrome, I started thinking about custom solution.

There were many ways of implementation. I thought about preparing windows exe file with included required dependencies (no installing additional Java, .Net, Python or other runtime).
I started playing in "prototyping with Python"- it was fun and things were going smoothly. But I stopped before making UI. Plain old console was "too lame" for final users, so I planned GUI with TkInter included by default in python installation to avoid porting to windows executable problems.

I get core set of functionalities, but user interface still was barely specified. Then I get many additional requests about "last minute" changes in UI forms (and probably not the last). The second "economic" option was to implement the whole application in Java Script and HTML running under web browser. Every computer has web browser suitable to run that kind of application so there are almost no installation and portability issues. Implementation time should be short too. To speed up things I have changed data format from flat file of records into JSON structure. Porting logic was fast too. The most time took me making forms working.

First version was not so fancy and needed some GUI tweaking like formatting, changing labels and headers. In a case of any further UI changes other people knowing HTML could make fixes instantly. The extra feature was possibility of "deploying" the little application on a web server as HTML page. Saving result to file wasn't working directly. Making it really automatic needed interacting with browser security policies for access to local file system. We decided that it will be still usable if user use copy-paste technique, and place formatted result in external text editor. The default usage was printing questions on paper so nobody saw problem there.

Everything is working as designed, and shows that web browser should be treaded as good platform for small applications. Sometimes little prototyping gives better insight on a whole system.

2008-11-12

Younger programming languages and frameworks are better

I have short talk with young student of Computer Science. He said he prefers .NET framework and C# more than Java, because Java seems outdated. I've seen those kind of preferences for some time in new generation of young programmers. I've asked what makes Java so outdated. He said about first release year (sic!), and mess in Java libraries, legacy API and so on. I've no time to ask for more details, but many of those pros and cons come probably from rumors and hypes. Good point for .NET marketing.

Younger programming languages and frameworks are potentially better. It's true for most popular (chosen by ,majority so in some way best) languages supported by community and commerce. Standing on the shoulders of existing giants - in that case language frameworks, gives better opportunity to make better API and add more practical features. New languages and frameworks are addressing most popular trends for its time (like WEB 2.0 and AJAX now). Other possible positive outcome would be cutting of all legacy code (good and bad one), and start everything from scratch, that would tend to include new ideas. All that needs many people, hours of work, and money.

So taking that assumptions and having big support - about every 10 (5?) years it would allow to produce new "cool" language that young generation of programmers will choose.

What is the important thing for developers? It's better to be open for new ideas and be ready for changes. What is good tool for work today, would be old in next 10 years.

2008-09-29

Mature programming languages and internationalization

Have you ever tried to implement application using character encoding other than Latin 1? What is deal with that? If you are using modern development platforms like Java or .Net - it just works. Let's omit other problems caused by bad implementation of internationalization issues in framework/library. Multilingual application scenario is simple - use internal UTF character encoding, allow transcoding from external systems at the API level (I/O operations with text files, databases etc.) - and your application will be able to write messages in most standardized character sets including Russian and Chinese.

What about other popular programming languages? Take for example Python 2.5 - recent version that could be used in production environment. It supports UTF strings processing, and character transcoding- but be aware - there are glitches and unimplemented UTF features, causing bad UTF processing. To get it work you have to use (sometimes ugly) workarounds. Here is nice presentation about these issues. There is hope that developers from open source community will fix that till let's say version 3.0.
Ruby is in better situation- as a younger language it has more properly adressed internationalization issues at the design stage. I suspect there is still more work to do.

What about old work horse of web applications development- PHP in newest stable version 5.5.2. It came a long road, but still have problems caused by legacy of non integrated separated libraries. It has long list of options to set encoding like internal encoding, http input output encoding, and many more affecting single libraries.

So what about using mbstring module (multibyte string representation) , setting UTF as internal encoding and sticking to it. Situation is worse than in Python- many even simple string functions can't process multibyte strings in proper way. The Solution is to write own workarounds or use third party libraries like PHP utf8. Here is good list of PHP internationalization issues. Last week I have checked xml import support for old PHP application- it caused problems with Latin2 encoding. The reason was simple: The XML SAX parser supports only ISO-8859-1, UTF-8 and US-ASCII encodings.

Such low detail problems could potentially take a lot of precious project time. So if your next application will use character set other than Latin 1, you should consider good internationalization support by chosen development and production platform.

2008-02-25

Blending scripting languages in modern enterprise environment

Is your company using "enterprisey" technologies like Java or .NET? Do you want to use flexible scripting languages like Python or Ruby?
There are interesting possibilities for popular and "mature" programming languages like those above. Many popular languages has implementations that work under Java or .NET environment, like Jython, JRuby, IronPython, IronRuby and others. It's quite old thing but it still worth mentioning it. The main problem with such solutions is their maturity and completeness, so checking and quick research is needed before doing decision.

You can also find implementations of old veterans like COBOL and REXX for new platforms. There are also single platform languages that have cool features of scripting languages like Groovy or beanshell for JVM.

Additional languages are primarily used in configuration, defining custom and complex business rules, adding Domain Specific Language features etc. Word of warn - do not create local Babel Tower by multiplying number of existing languages in single project. But it's nice to have to have one scripting language blended into main project platform.

Other case is porting applications from scripting to target platform. Constraints are narrow - all used third party libraries have to work on both platforms, so additional work is needed often. Practical example - here is interesting tutorial how to deploy web.py python application under Jython and JVM.

2007-11-12

Weakly typed languages need more testing

I have to written and managed some projects using scripting languages. Those languages often have no strong typing or have duck typing like in python. This is their strength on one way, and weakness on another because it's easier to break the code giving mistaken parameter. Most of this errors are visible after running a buggy code.

Some of older programming languages have built coarse in error messages like in PHP or old ASP family. It doesn't help during debugging and can be really frustrating indeed.

Automatic testing is good, everybody can say even if they don't use it. So it's best to use unit testing specially for that kind of code. In that way simple errors caused by non checked and mistaken parameters can be easy found and unit functionality is checked also.

So once again I say- automatic tests are good. Scripting languages like python, perl or php need automatic tests as additional "safety net". Comparing code written in weakly and strong typed language both covered with tests both may have equal quality, so there is no real typed language quality advance over non typed one.Good tests are what gives you quality and confidence.

So next time if you are going to code something think about- how to test it.

2007-09-09

The best programming language - choose the right tool for the job.

Is there the only one ultimate programming language, what is the best match for every application?

Some of folks may say- "Yes, It's L**. I've used it for X years in production environments and there is nothing in the world better than that". But it's not yet another thread about java vs c++ vs python vs ruby vs php [vs pick_your_language]...

Look at the current situation of existing programming languages. There are probably more programming languages than ever before and they are still evolving, what is IMHO good thing. An evolutionary criterion here is mainly market demand. It regulates need for that kind of tools and the most obsolete ones are vanishing.

Most of the programming languages start existence as a project of small group of enthusiasts or scientists. One person driven projects are quite usual. When it gains wider audience as good candidate for programming environment there is a moment when market influence kicks in.
From business point of view software production process must be optimized to get needed set of features, using possibly smallest resources and time to get final product of desired quality.
So there is economical pressure to keep (man time cost)/(product quality) ratio low.

What is programming environment? The main element is of course programming language concept with its constructs, and a set of basic framework libraries. It must be implemented, so it goes with tools like compilers, interpreters, virtual machines, debuggers and other preparing software to run and monitor software in target system. On the other end there are Integrated Development Environments boosting programmers’ productivity. All of these elements are used during software production process which has strategic impact on software cost and quality. The total cost and quality depends on the combination of lower level facilities of programming environments (I am excluding people skills).

All programming environments have some sweet points there and sometimes hard to reach or lack of other features somewhere else. So there is no one simple and effective tool for creating software.

So how to choose best one for your needs? Productivity depends on domain and size of application, architecture, speed of elementary analyze-write-compile-test cycle, easiness to create small and clean code, good debug information, matching tools power to programmer skills and other minor factors. These factors should be evaluated during short "evaluation runs" to get the complete picture.

How to collect such valuable metrics? We need productivity measuring features seamlessly hooked up into existing tools used during software development and maintenance. Having recorded software feature production time metrics and process structure can give us very valuable information. It gives possibility to look back, find weak points of process and try to improve it. Or, you would try to compare metrics in context of features and application character for different programming languages and choose the best for your needs. But we need tools to acquire those metrics. Some of commercial tools are going into that direction, and I think it's time to incorporate that into platforms supporting creation of open source software and sharing information with wider audience.

There is a very long way (if any exists) to one leading programming environment with simple but powerful programming language and well designed set of libraries etc. We have different competing programming environments find their market niches today. Evaluating and selection of best solution isn't trivial task. But if you can - think about it and choose the right tool for the job.

Maybe one day there will be one ideal small and complete programming language with good framework library, with scripting for small programs and support for big enterprise application features, with changeable features and many sets of well designed libraries and frameworks. Sounds like utopia for me, but who knows?