I just came back from a weeklong training session with java/JSP programming and have a couple of things to discuss.

FYI, I've been a long-time CF programmer (first version of 3.1).  I've dabbled in UNIX shell scripts, perl, ASP, VB, and Pascal (yes, Pascal!) in my past incarnations, and hands down, I have found CF to be the best for me.  It is the most intuitive programming language I've encountered so far.  That opinion hasn't changed after my intro to java/JSP.

Anyway, here goes:

1) Since CFMX 6.1 is now running off of jrun, is it reasonable to see it as a huge and complicated set of JSP custom tags?  JSP seems to behave very similarly to CF -- you write the code in a .jsp file and the compiler creates a .class file after the initial run.  There are a ton of custom tags for JSP, and after sifting through them, it seems like CF can be seen as a large custom tag.

2) To quote Hal Helms:

http://www.halhelms.com/index.cfm?fuseaction=writings.displayOnScreen&writing=TenReasonsCompaniesLikeJava.htm

"Java is a high-performance language. Java with JSP (similar to ColdFusion for presentation) is over 10 times faster than using ColdFusion. A single JSP server can handle 10 times the number of simultaneous requests that ColdFusion can."

I found this very disturbing, but I can see how this could be true.  In JSP, the equivalent of a CFOUTPUT of a form field is as follows:

<%= ${form_field} %>

or

<% request.getParameter("form_field") %>

Either one will do the job, but when this code is run through the runtime compiler, you see two very different code -- the former is some form of an evaluate function (which, like Evaluate() in CF, will no doubt take more processing power) while the latter goes through unchanged, i.e., will be faster.  So this got me thinking about CF in general.  All the minute, annoying things that java requires help it run faster.  In CF, you can simply declare a variable without regard for type -- <cfset var = "name"> and <cfset var = 0> are both valid statements.  But let's think about that for a second.  Since java requires that variables be typed, is it not plausible to think that CF code will run less lean, since there will now have to be extra code to sort this out?  This is pure conjecture on my part; I have no idea.  Since CF can be seen as a custom tag that generates code, who really knows how efficient this code-generating is?  Is that why Hal says JSP is 10 times faster than CF?

3) I'm considering running MachII (after this class, I'm fairly convinced of the whole MVC thingy).  Will running something like MachII make my applications faster?  Or is it just a way to organize big projects so they don't get out of hand?

4) Is there a way to optimize CF code so it runs the fastest?  I know, for example, that virtual Query function is dog-slow, and that structures are lightning fast.  Are there any other tips?  Should I be utilizing more CFSCRIPT throughout my code?

No matter how much performance increase java/JSP offers, I find the whole language ridiculous.  Then again, I find most computer languages ridiculous.  Why shouldn't the parser be smart enough to know that a variable is a certain type without having me specify it?  Why do I need to worry about case sensitivity?  You may just call me lazy, but when I saw CF, I saw a language that was intelligent.  It took the silliness out of programming and let me do what I really wanted to do.

- Sung
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to