Learning a new programming language

I recently had to learn Coldfusion. It is always fun for me to learn a new programming language. It makes me think in different ways to solve a problem and it introduces me to new programming techniques. It fosters my creativity.

In case you don’t know Coldfusion, here is a sample:

<cfif session.status eq "connected">
<cfoutput>
<ul>
<cfloop from="1" to="arrayLen(session.links)" index="i">
<li><a href="#session.links[i].href#”> #htmlEditFormat(session.links[i].text)# </a></li>
</cfloop>
</ul>
</cfoutput>
<cfelse>
<p>
You do not have sufficent access for this page.
</p>
</cfif>

Just like ASP and PHP, Coldfusion application sources are usually a mix of programming directives and (X)HTML code. Upon request, the application server execute the programming directives and returns the corresponding (X)HTML to the browser. One of the strengh of Coldfusion and one of its first selling point is the ease of use to create database-driven web applications. For exemple, listing and displaying some entries in a table is as simple as:

<cfquery name="entries" datasource="myDataSourceDNS">
SELECT
*
FROM
entries
</cfquery>
<cfloop query="entries">
<cfoutput>
#entries.name#<br />
</cfoutput>
</cfloop>

I am still far from mastering the language, but I have already found some shortcomings. I wanted to translate a polyline encoder for the google map api. I managed to complete a Java to Coldfusion translation and test it correctly. I found out there was some numerial errors caused by rounding used in the internal representation of decimal numbers in Coldfusion. My polyline was showing correctly on the google map near the start of the path but it was slowly moving away the further it went. I finally decided to use the original Java implentation. The latest versions of Coldfusion are built on Java and it is quite easy to integrate objects between the two.

I am still learning a lot even if I am done with my degree and I like it. Like most of my fellow programmers, learning is a process I had to master quickly in my life. This is just the beginning.

Comments 1

  1. Matthew Cabot wrote:

    Interesting.

    I’ve had the same problem with Coldfusion with another algorithm where there was many numerical computations.

    Posted 09 Feb 2008 at 12:52 pm

Post a Comment

Your email is never published nor shared. Required fields are marked *

CAPTCHA image