I don't really like ColdFusion .NET comparisons. A better comparison would be ColdFusion to ASP.NET, or ColdFusion + Java to .NET. But, having said that, ColdFusion developer Jose Diaz works for a company that migrated from ColdFusion to .NET (yep, I know, not overly smart). And Jose, having been exposed to the simplicity of ColdFusion before being forced to do things the hard way, created cfdot.net to compare code for common tasks.
- DateDiff. The .NET equivalent of the posted CF code would be: (date1 - date2).Days; The posted code is fundamentally different from the CF code.
- sleep(). The CF code shows just the actual sleep() call, but the c# version shows thread creation, everything. Not exactly like-for-like.
I've worked in both CF and .NET extensively. These sorts of comparisons are just misleading and aren't doing anything to give CF any more credibility. If people are going to do a 'comparison' it'd be worth studying up on the subject matter first.
Coldfusion:
dayOfWeek("date")
.NET:
DateTime dt = new DateTime(2003, 5, 1);
Console.WriteLine("The day of the week for {0:d} is {1}.", dt, dt.DayOfWeek);
A more fair comparison would be:
dayOfWeek(date) == date.dayOfWeek
.Net, JAVA, FLEX, PDF, OFFICE, SHAREPOINT all are powerful libraries, and CF is the only language can put all libraries together. CF is the glue for all mentioned libs.
So the question is why we are comparing?
Why we are not making all work together?
On the point of .NET being more verbose than CF, I don't necessarily agree. If you are up on all your C#, and using ASP.NET MVC, I'd say most code is similar length, and sometimes even smaller than the equivalent CF. Once you introduce Linq into the mix for working with collections, CF doesn't stand a chance.
Example - return all items in a string array containing the letter 'a':
CF:
<cfset results = ArrayNew(1)>
<cfloop from="1" to="#ArrayLen(myArray)#" index="i">
<cfif myArray[i] CONTAINS "a">
<cfset ArrayAppend(results, myArray[i])>
</cfif>
</cfloop>
C#: var results = myArray.Where(x => x.Contains('a'));
I tried to submit some fixes, but the submission form is broken...
I have a used a cheat sheet whenever I am transitioning between MySql, MSSql and Oracle. This is a similar kind of thing.
I guess other people do too. Also if things could be done better, it might be good to suggest improvements
I think the site is great. There is always better ways. This is not a site from my understanding trying to start a fight
as to which is better ColdFusion or DotNet. (we know CF is better...LOL) This is for helping beginners in C# and DotNet.
If you are a C# expert then you may not need this site.
I say thanks for your time and good job.
We all have our likes and dislikes about look and feel so just be happy he does not look at your site and decide if it looks
good or not. :)
Big Nate Sr - The CFNut & DotNet/SharePoint Guy.
This discussion seems to be about which language is better (and everyone is entitled to their opinion), but there has been no mention regarding speed of development. I work in a shop where .NET and ColdFusion development coexists and I see the different ways applications are built and deployed. The .NET developers work more hours and have a much more rigorous build/deployment processes; the ColdFusion guys work on a larger number of projects and have the advantage of working on more diversified solutions, all while having a relatively normal work week.
Keep in mind, both technologies have their pros and cons. You can do things in .NET that are faster (and sometimes not even possible in ColdFusion) and vice versa. I've worked on projects where both technologies were used and find that ColdFusion is much easier to work with. I don't think that one is better than the other; I think it's all about your individual preference, the direction of your company and what makes your development efforts successful .
The premise / MO of this site was to show what you can do with less code over .NET - it was a "fluff your feathers" over a technology which was being eradicated due to technical ignorance. It performs a function of showing you what you can do in each language and hey if it swings more people to the CF camp then great! ;-) It's an educational resource more than a fight picker but I can see why it may appear to be the latter in some eyes.
You will always get fanbois and indeed if you had to choose, a smart person would choose the best tool for the job - be it CF/NET/PHP/Perl etc.
However.....sadly, the fact is - outside of Adobe and current ColdFusion users - CF has an horrible reputation (one I fought against everyday) - in fact it was laughed at in some cases by people who deem themselves as "real programmers" - it's not taken seriously. The situation is not helped that Adobe charge a huge sum for the software - it isn't cheap at $7,5K where .NET or other "programming" tools are free (this may seem like a disgruntled cost/consumer issue but if you have been in meetings when you need to justify an upgrade to the latest software for the next business critical feature and you table it will cost circa 20K to upgrade a farm - it's laughable) - it's hard to win an argument of "I need X licenses for CF at $X" when an org would be better suited to hiring a person at that cost and you may gain more as a business.
Just my $0.02 from experiencing things in the battlefield ;-)