How I got started in ColdFusion
Posted: August 1st, 2011 | Author: bluewebtechniques | Filed under: ColdFusion, Railo | No Comments »The Beginning
The Beginning
Since the new year of 2011 hit I have been procrastinating to blog about some goals that I have set to accomplish before the end of the year. There are in fact a few goals that have been met already (thank GAWD) but many more of coarse that are still a work in progress. Let’s do this!
Goals with blue font have been met already.
In my 3rd blog about Coldfusion development I will be going over what a structure is, why use a structure, how to create a structure and how to use the items that exist in a structure.
What is a ColdFusion structure?
The simple answer to this is that a structure is a variable that can hold a set of data. By set of data, I mean more than a single value can be stored into a structure by specifying special keys for each value. This may sound quite dounting but I promise you that it will clear up and become more understandable once you see what a structure generally looks like.
In this post I am going to explain what the <cfparam> tag is, why it is needed and of coarse how to use it.
What is the <cfparam> tag?
“Tests for the existence of a parameter (that is, a variable), validates its data, and, if a default value is not assigned, optionally provides one.” – ColdFusion 9 Docs
Huh? To clarify, the <cfparam> tag is pretty much used as a way to give a variable a default value if the variable has not been defined.
Why is it needed?
This is my first of many blogs that I will be posting with some ColdFusion tutorials. Sure sure, there are many available already but I’m going to go through with this no matter what mmk.
Starting off with my first session, I am calling it ColdFusion Obj 1 <cfset> and will begin by explaining the purpose of the <cfset> tag and how to use it in a few different ways. Easy stuff, you’ll see….
What is the <cfset> tag?
It’s been quite some time since I’ve written a blog about anything really. I’ve been VERY busy with freelance work as well as personal work. Enough about that, it’s time to get back into the game of blogging. I was actually going to shut down this blog since it gets more visits from bots than anything else but decided not to shut it down and start using it as a form of personal learning and study materials. Lately I have been showing a bunch more interest in Java/Tomcat development and have progressed significantly in object oriented programmed. For the next few blogs to come, I will be kicking off a some simple tutorials for ColdFusion development and my own personal learning of Java/Tomcat development. The ColdFusion posts will start out from the extreme basics of the language and then will progress to the more technical parts of the language. I have seen and know that there are many ColdFusion blogs already available but why not join the party.
So I heard a while back that the C programming language is similar to PHP. Of coarse the gears in my brain started turning (maybe you heard the wood burning) which meant that I had to give it a go. After Googling some reference material for the C language, reading some tid bits I definitely saw a resemblance between the two languages with some obvious differences. Now after reading and thinking that it should be a snap to toss a simple command line app together in C I started up my favorite simplest text editor and started coding and in basically no time I had a very simple command line calculator app written in the C programming language, with some basic logic of coarse because I’m cool like that
Obviously I’ve been messing around with XML a lot lately. Never done as much work with it as I’ve been doing these past few weeks but I’m really liking and finding it very easy to get a hang of working with it. Not only that but I’ve been finding out exactly how useful and of coarse powerful XML is in application development. I guess you can say this has something to do with why I decided to toss together an incredibly easy PHP class to parse a WordPress RSS feed. Before writing it I did a little searching to see what else was out there and really couldn’t find anything that was solid enough to grab my interest. So I figured, why not push my XML fiddling a bit further. Below is the script I tossed together to parse your WordPress RSS feed as well as control how many posts are displayed.
This is a subject that I have personally been fiddling around with for a few weeks now and I am very aware that putting configuration data into XML files has been around for a long time. To be honest though I have never gone that route when writing my web apps. I normally either make a specific PHP, CFM, or bla bla file and toss my application setting variables into there. I know that by me doing that does not make the app easy to upgrade and may actually cause problems down the line. Thus the reason of my sudden interest in tossing the app data into an XML configuration file. Oh!, The XML is easy to write no doubt, and it’s pretty straight forward to make additions and updates to the file but what if you plan on creating a form that will be used to update the config file. Things can get somewhat dicey and mildly confusing if you have not ever done anything like that before. As I found out, it’s quite simple and cleaner in my eyes at least.
Well, I have NEVER touched a line of JSP until about 2 days ago. I did what every developer does when they gain interest in a new language, search, search and search for tutorials and examples of using the language that actually pertain to the REAL world and not just the “Hello World” clan. I’m talking, having at least a simple form that can take user values and actually do something with them instead of outputting a string of “Hello World” to the screen. Enough of that Hello World stuff already, it’s annoying, we wanna see some real stuff. This is why I figured to toss a simple example JSP and form logic together real quick. This took me about 5 minutes together, maybe even less.