Programming

Make dynamic amount of columns with PHP

by Greg on Apr.02, 2006, under PHP, Programming

Below is a demonstration of how I created variable amount of columns in a table listing.  In this example I was creating a picture gallery and using template files, so you can see even more than the dynamic columns, but anyway…

The only bit of important info here are these two snippets of code:

//Every x iteration based on GALLERYLISTCOLS, when 0, start new row

if (($c % GALLERYLISTCOLS)==0) {

$sdelim = $gll_startdelim;

} else {

$sdelim = ‘ ‘;

}

//Now, when x iteration is x - 1, then end the row (GALLERYLISTCOLS - 1)

if (($c % GALLERYLISTCOLS)==(GALLERYLISTCOLS - 1)) {

$edelim = $gll_enddelim;

} else {

$edelim = ‘ ‘;

}

It is using the modulus operator.  And when we reach every x amount of columns, specified by GALLERYLISTCOLS global var, we make the $sdelim and/or the $edelim = the template row delimiters. (<tr> or </tr>) This makes the new row.  If we set GALLERYLISTCOLS = 4, then we make 4 columns.

There are a lot of variable coming from external sources, so you’ll have to figure it out from there, but at least you can get the idea.  (and more importantly, I can view this and remember how the hell I did it!)

—————————————

$gll_start= readFromFile(TEMPLATEDIR.’/gll_start.tpl’);

$gll_startdelim= readFromFile(TEMPLATEDIR.’/gll_startdelim.tpl’);

$gll_item= readFromFile(TEMPLATEDIR.’/gll_item.tpl’);

$gll_enddelim= readFromFile(TEMPLATEDIR.’/gll_enddelim.tpl’);

$gll_end= readFromFile(TEMPLATEDIR.’/gll_end.tpl’);

//////////////////////////////////

///  Show the main gallery

$gallinks = “”;

$webgallery=WEBGALLERY;

$webgallerythumbs=WEBGALLERYTHUMBS;

require_once ‘DB.php’;

$db =& DB::connect(”sqlite:///$sdb”);

if (DB::isError($db)) {

die($db->toString());

}

$sql = “SELECT imgid, imgname,imgthumb,imgcategory,category,imgcomment FROM vw_gallery where category = ‘$gallery’”;

$res = $db->query($sql);

if (PEAR::isError($res)) {

die($res->getMessage());

} else {

$c = 0;

$rc = $res->numRows();

$parsedresult = ”;

while ($res->fetchInto($row)) {

$imgid = $row['0'];

$imgname = $row['1'];

$imgthumb = $row['2'];

$imgcomment = $row['5'];

$imgcomment = str_replace(’\\”‘, ‘”‘, $imgcomment);

$imgcomment = str_replace(”\\’”, “‘”, $imgcomment);

$thispage = “$me?imgid=$imgid”;

/*

Here we want every x amount of iterations.

Ex. If GALLERYLISTCOLS = 3, then every third item.

$c is the current iteration of records. 1,2,3,4,…

So, when the modulus of $c and 3 is equal to 0, then

we have a group of three and should start a new row.

Modulus meaning, 3 goes into $c with x left over.

If current rowcount is 17, then 3 mod 17 = 5 with 2 left over.

Soon as we hit 18, 3 goes into it 6 times, with 0 left over,

making it another group of three.

To get start of col amount we to (($c % GALLERYLISTCOLS) == 0).

To get the end of the col we need one less than GALLERYLISTCOLS.

And we have (($c % GALLERYLISTCOLS) == (GALLERYLISTCOLS - 1)).

(the max leftover, else it would be 0)

*/

//Every x iteration based on GALLERYLISTCOLS, when 0, start new row

if (($c % GALLERYLISTCOLS)==0) {

$sdelim = $gll_startdelim;

} else {

$sdelim = ‘ ‘;

}

//Now, when x iteration is x - 1, then end the row (GALLERYLISTCOLS - 1)

if (($c % GALLERYLISTCOLS)==(GALLERYLISTCOLS - 1)) {

$edelim = $gll_enddelim;

} else {

$edelim = ‘ ‘;

}

$parsed = $sdelim . $gll_item;

$parsed = tplParser(’{gll_thumbsrc}’,$webgallerythumbs . ‘/’ . $imgthumb,$parsed);

$parsed = tplParser(’{gll_comment}’,$imgcomment,$parsed);

$parsed = tplParser(’{gll_imageurl}’,$thispage,$parsed);

$parsed = tplParser(’{gll_imagename}’,$imgname,$parsed);

$parsedresult = $parsedresult . $parsed . $edelim;

$c++;

}

echo($gll_start.$parsedresult.$gll_end);

}

Leave a Comment more...

Retrieve or return an output parameter from a Mysql stored procedure in Zope

by Greg on Apr.02, 2006, under Databases, Programming, Zope

Zope 2.7.6 - Mysql 5.0.7. I have always thought that output parameters from stored procedures were not useable in Zope’s ZSQL methods, but a few minutes ago is suddenly occured to me that I could do it by using the “sql_delimiter” function in Zope. To be quick, put something like this in a ZSQL method:

call sp_test(@y)
dtml-var sql_delimiter
select @y as thecount

(put the <> around dtml-var sql_delimiter)

This works perfectly! I simply return a count in a simple sproc, but it’s exciting because this makes it even more useable! I LOVE ZOPE! (and now the MySQL has stored procedures, I LOVE MYSQL!)

Sample code if you want it:

— Here is the stored procedure —-
— This simply returns the parameter vout
— as a count.

DELIMITER $$

DROP PROCEDURE IF EXISTS `fb`.`sp_test`$$
CREATE PROCEDURE `fb`.`sp_test` (
out vout int
)
BEGIN
select count(*) into vout from blogs;
END$$

DELIMITER ;

— Here is the ZSQL Method —

call sp_test(@y)
dtml-var sql_delimiter
select @y as thecount

(put the <> around dtml-var)

Now you should note… for some reason, in MySQL Query Browser you can’t issue the commands:
call sp_test(@y);
select @y as thecount;

It wont work. But you can do that at he command line client just fine.

Also, you cannot do this AND return a recordset in the same procedure. It works from the command line client, but not in the ZSQL method. So, you will be limited to only return parameters this way.

Leave a Comment more...

Python Script/ZSQL - Alternate data over 2 columns

by Greg on Mar.31, 2006, under Linux, Programming, Python

Here’s a quick post based on a Python Script I made in Zope to display the data from a ZSQL method in a 2 column table layout. Not that big of a deal, but I wanted to save this because it took a little bit of thought and some learning.
(My original code is all mess up on this, I’ll try to find and repost it.)

## Script (Python) "genlodinfo" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=itemid ##title= ## # Example code:  ################################### """  Author: Greg Fischer  1st Byte Solutions - greg@1stbyte.com   Date: 9/24/05   License: You are free to reengineer  rework, recode, redistribute, resell  or alter this  code in any way you see fit, but you   must give credit to my original work  and you must provide this same license  to those that may receive your distribution  if you do. (just leave my name on it,  and you must offer the same freedom  in your work, that's all)   Purpose: This script will gather  from a zsql method, cat the records  into address records (with exra info),  then generate a table with alternating  rows. In other words, it will fill the table  from left to right, then down a row, 2 columns  wide. """ ###################################  def iseven(n):    """Return true if n is even."""    return n%2==0  def isodd(n):    """Return true if n is odd."""       return not iseven(n)  # Import a standard function, and get the HTML request and response objects. from Products.PythonScripts.standard import html_quote request = container.REQUEST RESPONSE =  request.RESPONSE  rs = context.sql.ap_lodging(itemid) rownum = 1 x = [] for r in rs: 	ritemid = str(r[0]) 	rtqstart = str(r[4]) 	rtqend = str(r[5]) 	rstreet1 = r[12] 	rstreet2 = r[13] 	rcity = r[14] 	rstate = r[15] 	rzip = r[16] 	rnotes = r[18] 	 	lodstr = rtqstart + ' - ' + rtqend + '
' 	lodstr = lodstr + rstreet1 + '
' + rstreet2 + '
' 	lodstr = lodstr + rcity + ', ' + rstate + ' ' + rzip + '
' 	if rnotes <> '': 		lodstr = lodstr + rnotes + '
' 	 	x.append(lodstr)  table = '' tablee = '
' tr = '' tre = '' td = '' tde = '' if len(x) >= 1: c = len(x) listing = '' cur = 0 for addy in x: listing = listing + '' #first build the addy with starting table elements #first record only if cur == 0: listing = listing + table + tr + td + addy + tde #Now check if this is an odd seq item, #just add a new cell and end the row if isodd(cur): listing = listing + td + addy + tde + tre #if this is an even item, it should be on a new row #and NOT the first item if iseven(cur) and cur <> 0: listing = listing + tr + td + addy + tde #all good, but if last record, then end row #else skip and loop to previous isodd and #add a new cell(which ends the row as well) if cur == (c - 1): listing = listing + tre #if this is the last item, end the table if cur == (c - 1): listing = listing + tablee cur = cur + 1 else: listing = 'No records' return listing

And you return the results simply by calling the script in your dtml. something like: dtml-var “path.to.script(itemid=itemid)”

As always, I hope this help someone else out there, not just myself! Good luck!

1 Comment more...

My top three web design requirements

by Greg on Mar.23, 2006, under Programming, Web Design

Recently I asked myself, “If I had to pick 3 things that are most difficult in web design to achieve, and achieve all at once, what would I pick?” I thought about that and decided it really boils down to these three things: ( I may rephrase them later )

  1. Visually acceptable.
  2. Quick to load
  3. Accessible

If I can get all three of these things to match up, then we’re in good shape.

Let me explain briefly about this. At first you might say, “Duh!” Well, here’s how I define them.

Visually Acceptable

I really have 3 sub items that I must, must have in my designs, or must work around somehow as a limitation. Of course, to me it is unsaid, that you should strive for cross-browser compatibility. I am willing to live with a few graphical errors in Safari, because it is still visually acceptable. Such a very small percentage of the visitors use it on my sites. Even Opera, but I noticed that more and more, if it looks good on Firefox, it probably looks very close, if not just like it on Opera. (using fairly recent versions)

  • I must always provide a graphically pleasing design that aligns images to the pixel. Having an image that is sliding over a single pixel can look terrible. Though, sometimes, if the bottom right corner of the page has a single pixel issue with colors that are hard to make out, then I don’t fuss too much. But I don’t like it.
  • The layout must stretch according to my content. NOT WINDOW SIZE! Unlike all the CSS fans out there, I don’t utilize all CSS layouts because of the limitations in browser standards and the box model. The box model does not allow my dynamic content to stretch out the layout as needed. Liquid CSS layouts are not the same. So I use a hybrid layout, using a single table to wrap, maybe an inner 2 column table for my content, but other than that, it’s all divs. (new blog on just this topic later)
  • Image transparencies! UGH! GIFs just don’t look good enough, and Internet Explorer does not support transparent PNG’s. PNG is an awesome image format, and the lack of support by the most widely used browser causes me to design around this limitation.

Quick to load

Do I really need to explain this one? Well, let’s just say, this is where I like CSS more. The more I can load into an external CSS file, the better. I can use them on tables too. But, being able to specify “header art” as a whole, even if it’s a larger image, is faster than loading many smaller images. So, I strive for this always.

Accessible

Yes, this is for those of us who have a hard time with all our graphics, small print, and visual layouts. When I create anything, I like to allow for larger fonts the visitor might adjust to on their browser. This can cripple the graphic layout if not done correctly. Screen readers for the blind, also, must be accounted for. Tables, as far as I can tell, do NOT deter from their use. (maybe I am wrong, and if so, someone please show me.) The section508.gov website is all table based.

To make things more Accessible, I try to have cleaner markup code (more CSS), give resizable fonts, list “title” and “alt” properties in my tags, and provide skip navigation.

1 Comment more...

My new opinion on AJAX

by Greg on Feb.18, 2006, under Programming, Web Design

So I’ve spent the last 6 months learning more about Javascript and how to use different AJAX libs. After trying to create some apps using it, I can say this. It is best used either in small doses on basic web apps (bloggers, forums, forms), or use it extensively on a proprietary web-based app.

So far I have found it is very cool and helpful to run some simple graphics effects and XMLHTTPRequests for single form fields or small forms, but designing the “single page” web app isn’t quite suited for standard web site right now. I say that for on simple reason, useability. Yes, useability. People have it so implanted in the mind on how to operate a web site, when you stray from the standard practice (like back buttons, urls), people don’t like it. Sure, you can deal with the back button issue, but why work so hard to do that when it’s so fast to do things with a new page.

I just find that using AJAX to compliment a web site form works best for now. However, say you want to build a complete application running over the Internet, then doing things the AJAX way might make things interesting. But, you’d have to rid yourself of the toolbars and run the app in a clean window, because you will be forcing the useability into your app, not into a web browser. (even though it still runs in your browser)

Leave a Comment more...

Get ZMySQLDA to retrieve MySQL Stored Procedures

by Greg on Jul.06, 2005, under Databases, Programming, Zope

Quick, before I forget!!

Tired of “can’t return a result set in the given context” errors when calling stored procedures in Mysql 5?

The ultra fast how-to on returning records from a multi-column multi-record stored procedure in Mysql 5 using Zope/Python!

In the ZMySQLDA, edit the db.py file and add the lines below in the _parse_connection_string function:


 #added by Greg Fischer retheoff at gmaildot com on 07/05/2005
 # Wanted an option to use 'client_flag' in connection string
 # to utilize MULTI_RESULTS and thereby retrieving full
 # recordsets from  Mysql 5.x
 # There is most likely a better way to implement this,
 # but this solved my isssue for now.  (what if you have
 # more than 1 client_flag?)
 if not items: return kwargs
 kwargs['client_flag'], items = int(items[0]), items[1:]
 # End addition


Like so…


def _parse_connection_string(self, connection):
kwargs = {'conv': self.conv}
items = split(connection)
self._use_TM = None
if not items: return kwargs
lockreq, items = items[0], items[1:]
if lockreq[0] == "*":
    self._mysql_lock = lockreq[1:]
    db_host, items = items[0], items[1:]
    self._use_TM = 1
else:
    self._mysql_lock = None
    db_host = lockreq
if '@' in db_host:
    db, host = split(db_host,'@',1)
    kwargs['db'] = db
    if ':' in host:
        host, port = split(host,':',1)
        kwargs['port'] = int(port)
    kwargs['host'] = host
else:
    kwargs['db'] = db_host
if kwargs['db'] and kwargs['db'][0] in ('+', '-'):
    self._try_transactions = kwargs['db'][0]
    kwargs['db'] = kwargs['db'][1:]
else:
    self._try_transactions = None
if not kwargs['db']:
    del kwargs['db']
if not items: return kwargs
kwargs['user'], items = items[0], items[1:]
if not items: return kwargs
kwargs['passwd'], items = items[0], items[1:]

#added by Greg Fischer retheoff at gmaildot com on 07/05/2005
# Wanted an option to use 'client_flag' in connection string
# to utilize MULTI_RESULTS and thereby retrieving full
# recordsets from  Mysql 5.x
# There is most likely a better way to implement this,
# but this solved my isssue for now.  (what if you have
# more than 1 client_flag?)
if not items: return kwargs
kwargs['client_flag'], items = int(items[0]), items[1:]
# End addition

if not items: return kwargs
kwargs['unix_socket'], items = items[0], items[1:]
return kwargs

Now, when you create your database connection object in Zope to Mysql 5, you use a slightly different connection string:
db user passwd client_flag
The client_flag is 131072 as specified in the CLIENT.py of MySQLdb for Python. (it didnt work for me to just use the constant MULTI_RESULTS.)
It will look like this:
adatabase auser apassword 131072

On Linux, this worked great. I cant get it to work on Windows. Probably need a newer version of _mysql.c from the mysql-python developers. (just a guess)

In Python, if you just want to connect, use the client_flag option in your connection string: (watch the wrapped lines)


cn = MySQLdb.Connection(db=adb, host=ahost,
user=auser, passwd=apw, client_flag=131072)

Worked great, again on Linux! But on Windows, I still get the “can’t return a result set in the given context” error unfortunately. If I find out how to get around that, I’ll post more.

This is a QUICK FIX! It is in know way the proper solution and will most likely cause some other problems, but it works and I needed the sprocs on Mysql! So, use at your own risk. And good luck!

Edit 7/06/05 2PM:
This *was* working. I ran in to a problem after creating a more complicated procedure using multiple statements. I then received an error in Zope stating something about releasing a lock. ?? I duno. I’ll test it in Python directly and see if it’s just my corny DA fix.

Edit 7/06/05 5PM:
Ok, it works, but I need to do more testing. You NEED TO USE A DASH in the connection string. Like so:
-adatabase auser apassword 65536

Also notice I am using 65536 as the client_flag. Using this specifies MULTI_STATEMENTS, and implies MULTI_RESULTS.

Leave a Comment more...

Why I use Zope and not ASP.net?

by Greg on Mar.02, 2005, under Business, Networking, Programming, Web Design, Zope

In 2002, I saw an article on Devshed.com about Zope. What they described intrigued me greatly. The whole “Everything’s an object” idea was fascinating. I proceeded to www.zope.org and downloaded Zope version Soon, I was in heaven as I discovered a new passion.

Before I get into this too much, you should know that I am not a Software Engineer. I am not an educated person. I have no formal training or computer science degree. Everything I have learned regarding programming, I learned on my own using books, the Internet, and practice. The thoughts I express here are strictly based on my own observations, opinions, and desires.

I originally started web design learning HTML and Javascript, of course, but soon realized the importance of server side code. So I ran into ASP and coming from a little experience in VB 6, it was easy to pick up. Then I found Zope. As much as I liked and enjoyed working in ASP/VB, I still found some tasks to be a little cumbersome. After testing Zope, it just made sense. For about 2 years I worked in ASP off and on, then about 2 more years in Zope.

This isn’t a story about why I switched from ASP though, it’s about not using ASP.NET. I purchased VB.NET 2003 in the summer of 2004. For six months I worked with web forms in .NET. After that, I concluded that it was better for me to use Zope. The keywords here are “better for me.” I gave ASP.NET a shot because I wanted to be sure I was working with a good platform for me and my clients. Doing so allowed me to compare what I learned in the previous ASP and in Zope. (From here on out, I will call ASP.NET, .NET.)

.NET is a great platform, and it’s very powerful and capable. It’s also very widely used and has a huge community of support. I really can’t say anything negative about it, except that it is too big and complicated. The things I might say that are drawbacks, are not necessarily negative as all platforms or environments have drawbacks. One drawback in .NET is the size of it. Many times I have found myself drowning in the overload of information and NOT finding what I wanted. Another drawback would be, from a web development standpoint, deployment. Deploying web applications in .NET is a pain. You cannot simply copy your application directory from a test server to the production server without running into path issues, or maybe some odd configuration at the ISP’s IIS server. As a result, when my clients want a simple change, I put them off because I have to do so much more work just to test some code and publish it.

I love the Visual Studio IDE and Intellisense. (That is what it is called, right?) Also, having the full procedural language, and having it separate from the HTML code is nice. Although, I have since learned that I like the integrated DTML mixed right in with the HTML better, but that is really only my preference. (Sounds like another blog to write)

In .NET, the compiled code is a benefit because even as complex and bulky as the .NET framework is, it is quite efficient during runtime. (for those uninformed, in .NET you must compile your code. In the older ASP, you simple edited the text file and ran it.) This compiling of code is partly a blessing for its runtime speed, but during development and deployment, it’s a curse. It just slows you down.

I would suppose in a large scale, corporate application, the compiling of code and separation of code and presentation is a benefit. And I suppose that the .NET framework would work better for web applications with thousands of concurrent users. But, that’s not what I do. That’s not what my clients want or need. My clients have less than 100 employees. (way less) 99% of what they need does not require the full scale, bloated capability of .NET. In fact, actually in my opinion, I believe that everything a small business would need for web applications, can be accomplished using Zope with the same performance as .NET, overall. Though you might find some things are faster in .NET, some are faster in Zope, so *overall* it’s a wash.

Concerning the speed of development, I would have to say Zope is faster, *overall*. There are some things that are faster in .NET as Microsoft has done a decent job helping the developer along with several pre-built objects. The problem is that when you want to customize the pre-built objects you run into problems trying to figure out how to use them in your own customized way, and since you almost always need to customize to suit your clients’ needs, that slows down development time greatly. So in this respect, I would have to say Zope is faster to develop in, but not in all cases as I have mentioned.

One of Zope drawbacks is that in order to work with it and be efficient you have to understand it. You have to *get* it. There are some concepts you have to understand. I suppose that’s no different in learning things like database design or programming in general, so maybe it’s not really a drawback after all. The concepts I am referring to here are really the relationship between DTML documents and DTML methods, and all other objects in the Zope database. But that is the beauty of Zope isn’t it? Zope is an application server that is really a database serving web objects. Everything in that database is just that, an object. How they all relate is the magic. It’s magic because they give you this framework to build upon, you take all the objects, design them and piece them together, and BAM you have an application.

During development, you inevitably run into code that needs debugging. I am split on this one. .NET is pretty good for debugging code. It has nice call stacks listed if you want and of course the IDE helps by allowing you to step through the code and see what your variables contain during runtime. Zope also has tracebacks and error logs allowing you to find an error. Neither platform has improved my development process enough over the other, so I would have to say it’s a tie.

Management. Zope is hands down, no contest, the winner here. .NET, as I stated erlier requires some tinkering to deploy and the code requires compilation when changed. This is a real pain when you want to move fast. The Zope server is easy to manage and quite reliable. The objects you create and develop are easily imported and exported and moved around making deployment a snap. In addition to all this, if you want to make a fast text change on a site, heck even a quick coding change, you simply log into the Zope Management Interface from any web browser on the Internet and make your changes. The changes are immediately available and if you just happen to need to revert from those changes, Zope has versioning built in and you can rollback the changes.

DTML. There are many people out there who would say DTML is no good. I completely disagree, particularly from a small business perspective. That’s a whole other debate and blog, so from my perspective and keeping with the relevance of this article, I will keep this simple. DTML allows you to easily create your application around your HTML and provide dynamic content. It looks like HTML, in fact I would describe it as super-charged HTML that executes on the server. .NET separates your code from your HTML. If you like that, or need it in some cases, then Zope is not for you. (unless you use ZPT, but I don’t) Because DTML is mixed within your page content, it’s quite easy to follow. This in turn speeds my development time.

.NET might have a full-blown development environment giving you a lot of power, but Zope does have Python scripts, and if so desired, external methods and products. Because of this, I wouldn’t say .NET has any additional capability over Zope. I am not a computer science guy though, so someone might argue that this is not true, but from my perspective, and for my clients needs, it is true.

.NET does not have or run an object database or use acquisition. This is what gives Zope its power. And again, someone might argue that Zope’s acquisition is no good, but for me, it rocks! I haven’t had any problems with it. It’s just one of those things in Zope that need an understanding of the concepts of object relationship.

.NET needs Windows. Not that this is bad, but limits options and makes it more expensive. I like options, makes it more useful to my clients. But, you should know, my favorite server setup for Zope is to run it on Windows 2000 or 2003 with Microsoft’s SQL server using the Egenix Zope DA for ODBC. With version 8 of Postgresql, I might be moving towards that though.

Zope connects to any data source I have thrown at it, and it will run on other platforms than Windows. (Linux) On a downside, Zope needs a licensed ODBC adapter on Windows if you use Zope 2.7 or higher, and on Linux you need licensed ODBC if you want to connect to Microsoft SQL server. This is not true when using MySQL or Postgresql on Linux, there are free database adapters available.

Well, let’s recap. I’ll list the pros and cons as I see it and how they fit with my needs.

Zope Pros

  • I love DTML and how there is no separation of code and content.
  • Python scripts, external methods, and products.
  • Easy to manage and deploy. Nice Zope Management Interface useable from any web browser. This also makes quick updates, actually quick.
  • It can do everything I need and ASP.NET provides me with no feature I need over the features of Zope. In other words, for my needs, Zope can do anything .NET can.
  • Easy to learn.
  • Easy to extend.
  • Runs on Windows or Linux.
  • Object database with custom object properties and acquisition.
  • No compiling of code.
  • Extensive database connectivity.

Zope Cons

  • No IDE. This would be nice, but since it’s quite easy to use a decent text editor connecting to FTP or WebDAV, it’s not needed.
  • Debugging could be a little better, but I don’t really have problems with it. Tracebacks and event logs are easy to use.
  • Need a licensed ODBC adapter for running with MS SQL server. You need this with Zope 2.7 and higher, it’s worth every penny, but would be nice if there was newer, free one available.
  • Not as widely used as other technologies. (Zope server use on Netcraft.com has doubled from 2/04 to 2/05 though, so that’s nice)
  • Documentation is a little lacking. (this is getting much better though)

.NET Pros

  • Nice IDE for development. Even the Web Matrix IDE is nice, but I much prefer the Visual Studio one. At about $100 for the Standard version of VB.NET, I can handle it. (but that wont connect to the full SQL server, you need to use MSDE)
  • Nice debugging. This is partly due to the use of Visual Studio though.
  • Great for enterprise application development with many developers.
  • Many pre-built objects for development.
  • Huge user base.
  • Tons of documentation and usage examples.
  • Full VB or C# language available. (or others too)

.NET Cons

  • Too much information, too big. It’s often easy to get lost when trying to find a solution. This is a huge problem for me. When you do actually find the items you are looking for, it’s got pretty good documentation though.
  • Deployment is a pain.
  • Code needs to be compiled. (makes deployment harder as well as other things)
  • Quick updates are a pain, because of the compiling of code.
  • Pre-built objects are nice and are documented fully. Well, not fully, because if you need to do something customized, which you always do, then documentation is lacking. This is a big deal to me because trying to customize something takes way longer than it should. So, this is a con.
  • You must use Windows.
  • No object database or acquisition.

Just to be a little more complete too, here is why I don’t use ASP. (The older ASP)

  • No object database and acquisition.
  • Database operation is a little more of a pain. Not that it is not doable, just more difficult.
  • SSI is available for dropping in code objects, but not anywhere near as nice and easy as using Zope DTML Methods or Python Scripts.
  • While it is easier to deploy than .NET, and updates are quick, and it’s not compiled, there is no easy management interface and it’s not easily done from any web browser. Again, it’s just easier in Zope.
  • The code is sort-of integrated and useable like DTML, but DTML is way easier, particularly when using databases.
  • I wouldn’t say that ASP is exactly extensible.
  • The thing I really don’t like about ASP though, and this is completely based on my own experience, it is slightly unreliable and the code is slightly slow and clunky when running.

I hope this information is helpful to someone out there. This isn’t ment to be disparaging to Microsoft or ASP and ASP.NET, it’s just that Zope seems to fit with my preferences and needs. .NET is great, and I have a couple clients that will continue to use .NET so I’ll keep using it, but if I can help it, I’ll use Zope.

Enjoy!

Greg Fischer
1st Byte Solutions

Leave a Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

1st Byte Solutions