.NET Discussion

.NET Issues, Problems, Code Samples, and Fixes

State of the Coder: Code Complete 2, Promo Codes, BlogEngine.NET


I just recently purchased Code Complete 2 by Steven McConnell, and am quite excited to read it, especially after all the coding I’ve done recently.  I’ve heard some great things about the book, and being a self-taught programmer, I’m pretty excited to learn the right way to do and think about some things.  I can’t really review it yet (as I’ve read maybe 4 paragraphs in the preface as of this writing), but I will share some of the tips that I glean from this work as I get through it (more regularly than I have been doing).

I’ve been working on a few projects here, some for business and others for pleasure, and they’ve kept me busy. One of which is the building of a Promo Code engine into my site at www.columbussupply.com. Let me tell you, it’s no easy task, especially since PayPal does not accept negative amounts (pretty hard to apply a discount!), but I’m sure I’ll figure it out in time.  The problem has three parts: 1) how to display the discount to the user (easy), 2) how to track the promo/prevent it from being abused (harder), and 3) how to transfer the information to PayPal/Google Checkout so that the transaction appears seamless to the user (hardest).

This third part has gotten me stuck a little. I don’t want to change the display to the user, but I need to find a way to transmit the discount to PayPal. One idea was apply the discounted amount to the last item in the cart (that has a price higher than the discount) with a note on it that mentions the promo code. That may work, but it may be confusing and is definitely kludgy. Anyone have any ideas how to combat this?

As for my pleasure work, I’ve been hacking away furiously at the newly released 1.4.5.0 version of BlogEngine.NET, which has been pretty fun, for my Ultimate Frisbee team’s website, www.madcowultimate.com (as of this writing, there’s nothing there, but there will be very soon). BE.NET is a great open-source blogging framework that is very well-designed and somewhat easily customizable. The official version is in C#, but there’s also a VB.NET version floating around. I considered the VB.NET version for a bit, but I decided to stick with the C# version for a few reasons, the main being I realize I need to learn C#, and that some of the techniques they use in this app are so advanced that I wouldn’t know what they were in VB.NET or C# or even English. So far I’ve had pretty good success and I’ve learned a whole bunch about the language as well as good coding practices. I would suggest that even if you don’t want to use it, you should download it just to look at how it was built (how often do you get to peek at the work of professional .NET coders?). 

I’ve discovered (reported, and corrected!) a few bugs, added some new features, built my own theme, and created my own widgets (somewhat) successfully. I’ve also opted to use the MySQL option included with the app, which has been awesome for me because that’s the DB I’m most comfortable with.  Overall, I’d rate this app very highly because there are a ton of features that you can use (even though I probably won’t use half of them) and it is so easy to modify.  Occasionally you may have to dip into the Blogengine.Core if you REALLY want to customize things (such as create your own data access methods), but so long as you don’t mess around too much, you should be fine.

Anyone else having a good ol’ time with BE.NET? I’d like to see your work!

Advertisements

August 15, 2008 - Posted by | ASP.NET, Books, C#, Google, MySQL, PayPal, Tips & Tricks |

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: