Reply to topic
loftboy
Forum Regular

Joined: 24 Jun 2004
Posts: 1129
Location: Colorado
Reply with quote
Yeah I don't do any enterprised sized stuff.
I have my own lil way i like to framework.

and yes I like it quick and dirty, I don't want to spend more than a week on a site, I get bored, that's one reason why I don't go 4 an enterprised sized job, just doesn't interest me. I like fresh content all the time.

Some of the bigger ones I do I will use a more OOP framework. But most ppl on my lists are enterprise coders and they manage just fine, some maybe even use .net or java at work but for their own stuff use cfm.
bobum
Elvis Fanatic
Elvis Fanatic

Joined: 16 Nov 2004
Posts: 746
Location: Montgomery, AL
Reply with quote
I can imagine where a non-enterprise level guy would favor something like CFML or PHP over .NET - I can absolutely understand it.

In those kind of site, there's no need for a lot of OOP and the power and flexability that comes with it. But I've seen plenty of shopping cart apps etc written in CFML so they must be doing it somehow. I just haven't yet seen where it's going to be easier/faster than .NET...

Ya gotta admit - the code that Hal wrote and the code that I wrote are night and day...
That .NET class is pretty sweet & streamlined...
loftboy
Forum Regular

Joined: 24 Jun 2004
Posts: 1129
Location: Colorado
Reply with quote
well see what some of the cfm pros come back with on your ?.

The cfm carts arent to tough, ok this is a bad example written by a cfm novice but he has almost his whole cart working off this one cfc, well i think he has a shipping one as well but here it is

<cfcomponent output="false">
<!---Initialize cart --->
<cfset VARIABLES.cart = StructNew()>
<!--- Initialize a cartID number --->
<cfset VARIABLES.cartID = RandRange(1000000,9999999)>
<!--- Add this cartID to the db so we can track abandonments. When a shopper finishes a sale
we'll add the cartID to tblorders. If we have cartID's in tblstartedcarts that aren't in
tblorders, they ditched our cart. Sad --->
<cfquery name="addcartID" datasource="#APPLICATION.DSN#">
INSERT INTO tblstartedcarts
(startedcartID, startedcartdate)
VALUES (<cfqueryparam cfsqltype="cf_sql_integer" value="#VARIABLES.cartID#">,
<cfqueryparam cfsqltype="cf_sql_date" value="#DateFormat(Now(), "mm/dd/yyyy")#">)
</cfquery>

<!---ADD method - the cart item contains ONE PRODUCT and a few other details,
like quantity, price, shipstatus, subtotal--->
<cffunction name="Add" access="public" returntype="struct" output="true" hint="add an item to the cart">
<!--- Three arguments - prodID,qty,price --->
<cfargument name="prodID" type="string" required="yes">
<cfargument name="quantity" type="numeric" required="no" default="1">
<cfargument name="price" type="any" required="yes">
<cfargument name="shipstatus" type="any" required="no">

<!--- Is this item in the cart already? --->
<cfif StructKeyExists(VARIABLES.cart, ARGUMENTS.prodID)>
<!--- Then just add the additional qty to it, then re-subtotal the item. --->
<cfset variables.cart[ARGUMENTS.prodID].qty = variables.cart[ARGUMENTS.prodID].qty + ARGUMENTS.quantity>
<cfset variables.cart[ARGUMENTS.prodID].subtotal = variables.cart[ARGUMENTS.prodID].qty * variables.cart[ARGUMENTS.prodID].price>
<cfelse>
<!--- Create a new structure in our cart. Everytime a new item is added, a nested structure is added --->
<cfset variables.cart[ARGUMENTS.prodID] = StructNew()>
<cfset variables.cart[ARGUMENTS.prodID].qty = ARGUMENTS.quantity>
<cfset variables.cart[ARGUMENTS.prodID].price = ARGUMENTS.price>
<cfset variables.cart[ARGUMENTS.prodID].shipstatus = ARGUMENTS.shipstatus>
<cfset variables.cart[ARGUMENTS.prodID].subtotal = ARGUMENTS.price * ARGUMENTS.quantity>
</cfif>
<cfreturn cart>
</cffunction>

<!---UPDATE method --->
<cffunction name="Update" access="public" returntype="void" output="false" hint="Updates an item's qty in the cart">
<!--- Two arguments - prodID and qty --->
<cfargument name="prodID" type="string" required="true">
<cfargument name="quantity" type="any" required="no" default="1">
<!---If the new qty is greater than 0--->
<cfif ARGUMENTS.quantity GT 0>
<cfset variables.cart[ARGUMENTS.prodID].qty = ARGUMENTS.quantity>
<cfset variables.cart[ARGUMENTS.prodID].subtotal = VARIABLES.cart[ARGUMENTS.prodID].price * ARGUMENTS.quantity>
<!--- if the new qty is 0, remove the item from the cart --->
<cfelse>
<cfset StructDelete(VARIABLES.cart, ARGUMENTS.prodID)>
</cfif>
</cffunction>

<!---REMOVE method --->
<cffunction name="Remove" access="public" returntype="void" output="false" hint="Remove an item from the cart">
<!--- One argument - prodID--->
<cfargument name="prodID" type="string" required="true">
<cfset StructDelete(VARIABLES.cart, ARGUMENTS.prodID)>
</cffunction>

<!---EMPTY method --->
<cffunction name="Empty" access="public" returntype="void" output="false" hint="Remove all items from the cart">
<!---Remove all items from the cart--->
<cfset StructClear(VARIABLES.cart)>
</cffunction>

<cffunction name="GetCart" access="public" returntype="struct" output="true">
<cfreturn cart>
</cffunction>

<!---PROD COUNT METHOD - Tally up the cart item count --->
<cffunction name="GetCartProdCount" access="public" returntype="numeric" output="true" hint="Show total of
cart content count">
<cfreturn StructCount(VARIABLES.cart)>
</cffunction>

<!---CART SUBTOTAL METHOD - Now tally up the cart $ total --->
<cffunction name="getCartSubTotal" access="public" returntype="numeric"
output="true" hint="Show subtotal of cart in dollars">
<cfset var cartTotal = 0>
<cfloop collection="#VARIABLES.cart#" item="thismerchID">
<cfset cartTotal = cartTotal + VARIABLES.cart[thismerchID].subtotal>
</cfloop>
<cfreturn cartTotal>
</cffunction>

<!---GET TAX RATE METHOD -Retrieve the appropriate taxes by calling shopper.cfc and finding out
what state this shopper is from. If the shopper is in NC, .07% will be applied. --->
<cffunction name="getCartStateTax" hint="Runs a query in the db to check which state
the shopper is from, and applies the appropriate tax" output="true">
<cfset var shopperinfo = SESSION.shopperinfo.getcartownerinfo()>
<cfset var thestate = shopperinfo.b_state>
<cfquery datasource="#APPLICATION.DSN#" name="getstatetax">
SELECT stprv_Code, stprv_Tax
FROM tblstateprov
WHERE stprv_Code = '#thestate#'
</cfquery>
<cfreturn getstatetax.stprv_Tax>
</cffunction>

<!--- GET TAX AMOUNT METHOD --->
<cffunction name="getCartTaxAmount" hint="gets the tax amount for the state retrieved
in getcartstatetax function" output="true">
<cfset var statetax = getCartStateTax()>
<cfset var cartsubtotal = getCartSubTotal()>
<cfset var taxamount = cartsubtotal * statetax>
<cfreturn taxamount>
</cffunction>

<!---GET FINAL CART TOTAL METHOD -retrieve the subtotal and tax from our other methods
- then add together.--->
<cffunction name="getFinalCartTotal" output="true" hint="Tally up the final
total of the cart * tax" returntype="numeric" access="public">
<cfset var taxamount = getCartTaxAmount()>
<cfset var cartsubtotal = getCartSubTotal()>
<cfset var finalcarttotal = cartsubtotal + taxamount>
<cfreturn finalcarttotal>
</cffunction>

<!--- GET CART ID METHOD --->
<cffunction name="getCartID" output="true" hint="get the cart ID number"
access="public" returntype="numeric">
<cfset var cartID = "">
<cfreturn VARIABLES.cartID>
</cffunction>
</cfcomponent>



how i am currently doing this is by making a template page, splitting it in half and making a header and nav and footer pages and running them out of the application.cfc with the header & nav on applicationstart and the footer at onrequestend. SO all i have to do is make a div with the main content.

then i have tags set up to do each function i want and I just include those like such

Code:
<div id="pagecontent">
<h1>hi bozo the clown here are you messages from today</h2>
<cfmodule name="getmesages.cfm">
</div>



and that could be the whole page
bobclingan
Forum Regular

Joined: 16 Sep 2004
Posts: 271
Location: Abingdon, MD
Reply with quote
yes. the website is http://www.cfunited.com.

It starts tomorrow.
Josh
Forum Regular

Joined: 01 Apr 2004
Posts: 1029
Location: Felton, Delaware
Reply with quote
Well, I've been researching the CFC vs ASP.NET Class thing and I've come to my original conclusion that a CFC is at best the equivilent to a cross between an include and an ASP.NET User Control. And no, I'm not on good crack. Do your homework and you'll see very clearly how similar these things are.

Yes, it bears a few things similar to a class, and can even take on a somewhat similar looking structure, but is in no way shape or form a class. It doesn't even support all methods or properties commonly associated with a class. The best CF can do is to leave Java to taking care of the classes. Yes, CF / CFC's can communicate with and use already declared classes created with Java, but they can not in fact create a class. Not with CFScript or CFTags. That must be done with Java.

I've presented this on a few other forums as well, and the CFers seem to be dodging this either not knowing about higher level programming or just unable to admit defeat in this area Wink I mean, even Javascript (client side, I know, but still very useful) supports classes. PHP even has better support of classes (talking about native CF Structured stuff like CFScript, CFTags, etc.) now, even though not fully supporting common structures and methods that define a real class.
loftboy
Forum Regular

Joined: 24 Jun 2004
Posts: 1129
Location: Colorado
Reply with quote
well i been way to busy to give this any additional thoughts.

ok and if thats so josh then in the real world what good does that do you?

heres what I know, i'll make over 20k this month without giving a rats azz about whether or not cfm can write a "proper" class.
I'll be done and gone working on the next project before you get done writing your "proper" classes. I will also have the choice of where and on what I can run my "improper" classes, it will also give my customers choices of where and on what they can run their projects, it also gives them extra $$ that they save in dev time to add more features to their site or use towards additional marketing.

also at least around here I see there are a lot of .net jobs available and they pay between $25 - $40 an hour and the cfm jobs pay around $45 - $80 an hour, just sayin................

and again you go back to if you want a proper class then right it in java and I don't know why u can't get over that, it's a part of cfm now and every bit as valid to use as it would be in .net, it just gives you the advantage of using RAD when you don't need the extra stuff and then it gives you the full power when you do need it, it's not a very hard concept to understand.
bobum
Elvis Fanatic
Elvis Fanatic

Joined: 16 Nov 2004
Posts: 746
Location: Montgomery, AL
Reply with quote
I think what Josh is getting at is the fact that you have sung it from the mountain tops that CF can do anything that .NET can do and well...that obviously isn't the case. If you have to leave CF to use Java for common programming structures then CF is lacking in that area. .NET webbies may be getting $25-$40 an hour and your CF guys may be getting $80 but I know that as a C#.NET web applications developer I am, right now, staring at a 5000 hour, $2.5mil contract. That's $500 an hour. And I am debating on weather or not to take it. So the money depends on the market you are in - not the platform you are developing for.

I don't think any of us are saying that CF is BAD...just not the be all and end all that you tout it to be. .NET isn't it either and I think ALL of us would agree on that. I think the point that Josh and I are getting at is that in the sense of a traditional, strongly typed, truly object oriented language CF doesn't add up.

Why does that mean anything?

As web sites continue to grow and web applications continue to get larger and more complex, laguages like Java and any of the .NET laguages become more and more relevant. Sure you can build dynamic sites with CF, you can do it with PERL or Classic ASP as well. But building complex, enterprise level applications is definately not what those laguages were designed for. You can certianly do it, but it might be easier done in a language more geared toward solving those large, more complex problems.

And you may say "Well I don't ever write anything that complex so CF is perfect." and that may be true, now...but if you ever decide to use or create a robust content management system (phpNuke, dotNetNuke, Rainbow, Drupal) for a site you are building, or even any of the newest forums (phpBB, vBulletin, CommunityServer), those have become so large and complex that they would require the power & flexability that an OOP language provide.

PHP has been stretched to it's limits writing apps like the above mentioned ones and if you ever dive into the code for those it can be a nightmare to figure out. As such the PHP devs as of PHP4 implemented OOP into the language and enhanced it in PHP5. It's just the way things are going. Either you get on the bus or you'll be left behind.

If you can do OOP in CF that's great - but if it looks like the examples that were presented earlier in this thread - you can have it. I think that's what we are boiling down to. Take a look at CF's competators, .NET, Java (yes, a competator), PHP, heck even OOPERL. None of those are tag driven, none require some component to make a class, you don't appear to have to jump through hoops to do common OO tasks like you appear to have to do in CF.

To sum up - for me personally to take a new language seriously it has to at least look like it is heading in a technological forward motion, and that it can at least keep pace with it's closest competators in features and robustness. CF appears, to me, to be stuck in the past with it's CF tags and reliance on Java to do any of the heavy lifting that modern web apps will require. If I am mistaken, please, show me.
Josh
Forum Regular

Joined: 01 Apr 2004
Posts: 1029
Location: Felton, Delaware
Reply with quote
I've never worked and made $25/hr on any programming job I've done. About 8 times that is the best I've mustered in this area, and my avg is about 4 times that. But I wasn't talking money... that's out of the scope of this thread.

Im not saying CF won't get you from A to B, but you said that it could do things that it really can't. Im also not taking Java out of the equation... I just think it's counter productive to have 2-3 "versions" or "ways of doing things" when all these other languages provide you with one. I guess that's where CF's quick learning curve comes in though. I know people that've picked up CF in a matter of DAYS. and the people I'm referring to have no real world programming experience. That could be very valuable for alot of people. But it could also hold them back from using advanced programming methods.

Now, I use classes all the time. And user controls Wink They save me a TON of time not having to rewrite code that I've already written. Write once, use many. And right now I'm working on one app for a real estate co that would be assinine to do without classes. Why slam soemthing out real quick when you can spend 15 extra mins on creating a few classes that in the end will save you a few hours of work AND provide you with a very scalable and flexible means of expansion and/or modification of the application?
loftboy
Forum Regular

Joined: 24 Jun 2004
Posts: 1129
Location: Colorado
Reply with quote
I do understand what you are saying but it seems ppl cant get over cfm and java being together now, you tend to still think of it as like using html with js and that it is not. CFM is a j2ee product that gives you choices of what you can use and when you want to use them.

It comes down to this, there are 2 major platforms anymore, java & .net, it's just as easy to learn java as .net but when using java with cfm it gives you additional options for RAD development which .net does not have, it gives you or your clients a choice of which platform they can run on which .net does not have. You can just as easily write your classes in java as .net's classes and run them straight through cfm, its all compiled to same java byte code. And just as easily i can ask you things like wheres the whole document search engine in .net where as cfm have verity built in, or gateways, or blah blah blah.

After all .net basically "borrowed" most of their stuff from java so I guess you can say that .nets classes are just a rehash of javas classes and its nothing that .net developed or came up with.

actually i wont fight u on it anymore it's pointless and besided I prefer that there are more .net ppl out there because it makes it that much easier to get get gigs away from them, I have yet to lose a bid to anyone using .net or php, so I am happy Smile and if i want to use proper "classes" I can and if you want to use RAD you can't Wink
loftboy
Forum Regular

Joined: 24 Jun 2004
Posts: 1129
Location: Colorado
Reply with quote
http://clearsoftware.net/client/index.cfm?mode=entry&entry=3AD583EF-E081-2BAC-69DEECDEFD01C4BE
bobum
Elvis Fanatic
Elvis Fanatic

Joined: 16 Nov 2004
Posts: 746
Location: Montgomery, AL
Reply with quote
LOL - now that's a succinct way of defending your position on a topic "I'm not going to play anymore because, well, I just don't wanna play anymore!"

RAD exists in most platforms today Lofty...Dreamweaver does .NET RAD very very nicely as does Visual Studio.

Can you develop Java inside of a CF IDE? Can you develop CF inside a Java IDE? If the answer is yes then I'll buy your claim that CF and Java are tied together at the hip. If you have to switch development environments to develop one or the other then your argument falls apart and I still look at it as having to learn two technologies in order to do something that countless others can do by themselves.

And Classes are not a JAVA or a .NET thing - they are a PROGRAMMING construct...any language worth it's OOP salt, be it Ruby, Python, PERL, Java, any of the .NET languages, or Pascal etc., will have a class implementation, inheritance and polymorphism.

Now don't take this next question as a flame or anything - but how much programming have you done Lofty? Is most of your coding limited to what I call the "Select Insert Update Delete" type apps, or have you done any OOP development? Again - I am just asking for reference sake...if the SIUD type stuff is where your experience lies then we may be asking the wrong questions.
bobclingan
Forum Regular

Joined: 16 Sep 2004
Posts: 271
Location: Abingdon, MD
Reply with quote
I hate to get sucked into this argument, but I would like to point out that you can do CF development and Java development together using the Eclipse IDE and the CFEclipse plug-in. Macromedia just recently joined the Eclipse foundation and is working with the cfeclipse team to improve the plugin.
bobum
Elvis Fanatic
Elvis Fanatic

Joined: 16 Nov 2004
Posts: 746
Location: Montgomery, AL
Reply with quote
Ok - that answers one question. Thanks Bob
dvduval


Joined: 08 Jul 2005
Posts: 12
Reply with quote
I've used CF and .net, but the price of developing in either language was always more than PHP. For me at least, it seems I just keep coming back to PHP. Smile
bobum
Elvis Fanatic
Elvis Fanatic

Joined: 16 Nov 2004
Posts: 746
Location: Montgomery, AL
Reply with quote
Are you using PHP5 dvduval?
never ending discussion of .NET vs CF
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 5 of 6  

  
  
 Reply to topic