Comment On The Homegrown CMS

Several years ago, Mike M’s company decided that they needed to build an in-house Content Management System portal application. Well, actually, the lead developer made the decision… and the recommendation… largely because writing applications are boring. But writing platforms upon which you can write applications… now that’s exciting! [expand full text]
« PrevPage 1 | Page 2 | Page 3Next »

Re: The Homegrown CMS

2010-05-24 09:07 • by Porsche Oxter (unregistered)
"Axillary" code module? I love it, and will definitely begin using the expression.

Re: The Homegrown CMS

2010-05-24 09:12 • by EmperorOfCanada (unregistered)
I once saw someone try and make an important CMS in Lotus Notes. WTF
Another was a company that tried making their shrinkwrap very multi tier system in Lotus Notes. WTF

I loved VB6 in the day for knocking off little exe's that did something like a simple engineering calculation. Beyond that it was overwhelmed. So many products like VB6, Powerbuilder, Lotus Notes, etc promised the world but resulted projects permanently stuck at the 90% mark.

Re: The Homegrown CMS

2010-05-24 09:15 • by Fred (unregistered)
>Boolean-type values in the database were rendered as a CHAR(5) field holding possible values of 'true', 'false', or NULL.

He must have been burned in the past by MySql's crazy syntax to store and retrieve booleans in a BIT(1) type field.

>The code module contained such gems as this function:
> Function FileExists(f As String) As Boolean

That one is actually well designed - it just looks sucky because of the way you had to do things in VB.

> deleted in-line SQL where ever he found it

Also just his personal preference. Having in-line SQL isn't necessarily bad - depending on the application and how it's implemented.

Re: The Homegrown CMS

2010-05-24 09:18 • by Drew (unregistered)
TRWTF is that this is par for the course in a lot of places.

Re: The Homegrown CMS

2010-05-24 09:19 • by ObiWayneKenobi
The real WTF is that he took the job in the first place. That should have raised massive red flags.

Re: The Homegrown CMS

2010-05-24 09:23 • by Neil (unregistered)
309426 in reply to 309423
Fred, did you write this?

Re: The Homegrown CMS

2010-05-24 09:24 • by Zecc
309427 in reply to 309420
Porsche Oxter:
"Axillary" code module? I love it, and will definitely begin using the expression.
Yes, it means the code smelled like a sweaty armpit.

Re: The Homegrown CMS

2010-05-24 09:29 • by highphilosopher (unregistered)
309428 in reply to 309423
Fred:

>The code module contained such gems as this function:
> Function FileExists(f As String) As Boolean

That one is actually well designed - it just looks sucky because of the way you had to do things in VB.


Fred, don't ever use "well designed" and "VB6" in the same paragraph again, unless you're include one of the following words:
wasn't
not
joke
fail

Re: The Homegrown CMS

2010-05-24 09:30 • by Ike (unregistered)
TRWTF is the CHAR(5) boolean field. It should have been at least CHAR(9) to hold "FILENOTFOUND".

Re: The Homegrown CMS

2010-05-24 09:31 • by Ike (unregistered)
309430 in reply to 309429
Err, uh, make that at least CHAR(12) to hold "FILENOTFOUND".

Re: The Homegrown CMS

2010-05-24 09:42 • by frits
Mike M:
...Or even any auto-incrementing IDENTITY columns for that matter...

I'd say having this feature is more of a WTF.

Re: The Homegrown CMS

2010-05-24 10:00 • by pete (unregistered)
309436 in reply to 309434
frits:
Mike M:
...Or even any auto-incrementing IDENTITY columns for that matter...

I'd say having this feature is more of a WTF.


Not if there is no natural unique identifier to be used although that is rare and usually indicates something that could be implemented better.

Re: The Homegrown CMS

2010-05-24 10:04 • by Anon (unregistered)
309438 in reply to 309423
Fred:

>The code module contained such gems as this function:
> Function FileExists(f As String) As Boolean

That one is actually well designed - it just looks sucky because of the way you had to do things in VB.



No, no it isn't.

Re: The Homegrown CMS

2010-05-24 10:04 • by The Real Jason (unregistered)
Been there, supported that, quit 2 years ago. Thanks for ruining my Monday with my memories!

captcha:amet -> Amet preacher man Amet!

Re: The Homegrown CMS

2010-05-24 10:14 • by Jaime
309441 in reply to 309436
pete:
frits:
Mike M:
...Or even any auto-incrementing IDENTITY columns for that matter...

I'd say having this feature is more of a WTF.


Not if there is no natural unique identifier to be used although that is rare and usually indicates something that could be implemented better.
Really? I'm a big fan of surrogate keys. Looking through some of the databases I am responsible for, most of the tables in them have no natural unique identifier. What would you suggest a natural identifier for an order header record would be?

Re: The Homegrown CMS

2010-05-24 10:15 • by Grammar Nazi (unregistered)
I wonder if the narrated version of these posts leave in all the spelling/grammar mistakes.

Re: The Homegrown CMS

2010-05-24 10:54 • by Crabs (unregistered)
309443 in reply to 309441
Jaime:
pete:
frits:
Mike M:
...Or even any auto-incrementing IDENTITY columns for that matter...

I'd say having this feature is more of a WTF.


Not if there is no natural unique identifier to be used although that is rare and usually indicates something that could be implemented better.
Really? I'm a big fan of surrogate keys. Looking through some of the databases I am responsible for, most of the tables in them have no natural unique identifier. What would you suggest a natural identifier for an order header record would be?


You're replying to a person who has obviously been through half a semester of DB Design 101.

Even if a record has a natural unique identifier, that natural unique identifier is most often a string (because that's how we humans think: in words). Strings suck for joining, selecting, and indexing on, because the compare takes an order of N longer than comparing an integer.

Re: The Homegrown CMS

2010-05-24 11:01 • by pubbing
Sounds like the first iteration of DotNetNuke?!?!?

Re: The Homegrown CMS

2010-05-24 11:02 • by Fred (unregistered)
309445 in reply to 309438
Anon:
Fred:

>The code module contained such gems as this function:
> Function FileExists(f As String) As Boolean

That one is actually well designed - it just looks sucky because of the way you had to do things in VB.



No, no it isn't.


Ok, why it the design poor? It has a reasonable name, and actually uses parameters instead of global variables. Ok, the FreeFile thing is a red herring, but other than that it does what it has to do. Blame Bill Gates for the error handling weird syntax.

Re: The Homegrown CMS

2010-05-24 11:07 • by dpm
309446 in reply to 309423
Fred:
>The code module contained such gems as this function:
> Function FileExists(f As String) As Boolean

That one is actually well designed - it just looks sucky because of the way you had to do things in VB.
Oh, I totally agree! Misleading function names are so much fun --- when someone calls FileExists() and it returns "false" because the file really does exist but couldn't be opened for any other reason (permission, sharing, quota, etc.) you get to watch him go insane.

Re: The Homegrown CMS

2010-05-24 11:07 • by barry (unregistered)
309447 in reply to 309443
Crabs:
Jaime:
pete:
frits:
Mike M:
...Or even any auto-incrementing IDENTITY columns for that matter...

I'd say having this feature is more of a WTF.


Not if there is no natural unique identifier to be used although that is rare and usually indicates something that could be implemented better.
Really? I'm a big fan of surrogate keys. Looking through some of the databases I am responsible for, most of the tables in them have no natural unique identifier. What would you suggest a natural identifier for an order header record would be?


You're replying to a person who has obviously been through half a semester of DB Design 101.

Even if a record has a natural unique identifier, that natural unique identifier is most often a string (because that's how we humans think: in words). Strings suck for joining, selecting, and indexing on, because the compare takes an order of N longer than comparing an integer.


Surely not once indexed? There should be a negligible difference as far as I know. Not talking tables with millions of records here obviously.

Re: The Homegrown CMS

2010-05-24 11:07 • by Craig (unregistered)
309448 in reply to 309436
You've never had a natural identifier change on you? There are very few cases where a surrogate key should not be used.

On a related note, I'm always amazed when I read the comments on the article. It makes me wonder how many WTFs the readers of the blog are creating for future generations to scratch their heads over.

Re: The Homegrown CMS

2010-05-24 11:08 • by Cyrus
309449 in reply to 309445
Fred:
Anon:
Fred:

>The code module contained such gems as this function:
> Function FileExists(f As String) As Boolean

That one is actually well designed - it just looks sucky because of the way you had to do things in VB.



No, no it isn't.


Ok, why it the design poor? It has a reasonable name, and actually uses parameters instead of global variables. Ok, the FreeFile thing is a red herring, but other than that it does what it has to do. Blame Bill Gates for the error handling weird syntax.


Public Function FileExists(sFullPath As String) As Boolean

Dim oFile As New Scripting.FileSystemObject
FileExists = oFile.FileExists(sFullPath)
End Function

Re: The Homegrown CMS

2010-05-24 11:15 • by Grumpy (unregistered)
309450 in reply to 309430
Ike:
Err, uh, make that at least CHAR(12) to hold "FILENOTFOUND".


No, CHAR(9) is now the documented way of doing it. Besides, it's much more in the spirit of the thing. Correctness? Tried it, didn't like it.

Captcha: eros - yes, I like CHAR's very much for booleans.

Re: The Homegrown CMS

2010-05-24 11:37 • by Sylver (unregistered)
309451 in reply to 309448
Craig:
You've never had a natural identifier change on you? There are very few cases where a surrogate key should not be used.

On a related note, I'm always amazed when I read the comments on the article. It makes me wonder how many WTFs the readers of the blog are creating for future generations to scratch their heads over.


That's a feature, not a bug!

Re: The Homegrown CMS

2010-05-24 11:40 • by Tom (unregistered)
This is the worst WTF story in a while

Re: The Homegrown CMS

2010-05-24 11:54 • by d.k. Allen (unregistered)
309453 in reply to 309452
Tom:
This is the worst WTF story in a while


Yeah, but it's the best one today.

Re: The Homegrown CMS

2010-05-24 12:04 • by Nobody Important (unregistered)
309455 in reply to 309449
Cyrus:
Fred:
Anon:
Fred:

>The code module contained such gems as this function:
> Function FileExists(f As String) As Boolean

That one is actually well designed - it just looks sucky because of the way you had to do things in VB.



No, no it isn't.


Ok, why it the design poor? It has a reasonable name, and actually uses parameters instead of global variables. Ok, the FreeFile thing is a red herring, but other than that it does what it has to do. Blame Bill Gates for the error handling weird syntax.


Public Function FileExists(sFullPath As String) As Boolean

Dim oFile As New Scripting.FileSystemObject
FileExists = oFile.FileExists(sFullPath)
End Function


LOL pwned

Re: The Homegrown CMS

2010-05-24 12:14 • by frits
309456 in reply to 309449
Cyrus:
Fred:
Anon:
Fred:

>The code module contained such gems as this function:
> Function FileExists(f As String) As Boolean

That one is actually well designed - it just looks sucky because of the way you had to do things in VB.



No, no it isn't.


Ok, why it the design poor? It has a reasonable name, and actually uses parameters instead of global variables. Ok, the FreeFile thing is a red herring, but other than that it does what it has to do. Blame Bill Gates for the error handling weird syntax.


Public Function FileExists(sFullPath As String) As Boolean

Dim oFile As New Scripting.FileSystemObject
FileExists = oFile.FileExists(sFullPath)
End Function


While that is a more succint method, the one in the article is very similar to the "C" way of checking of a file exists. Except for the superfluous "on error" statement, that is.

BTW- Nice 2 second googling, but you should set oFile to Nothing before exiting your function.

Re: The Homegrown CMS

2010-05-24 12:20 • by Jay (unregistered)
309457 in reply to 309448
Craig:
You've never had a natural identifier change on you?


ON UPDATE CASCADE

Re: The Homegrown CMS

2010-05-24 12:24 • by Jay (unregistered)
309458 in reply to 309441
Jaime:
I'm a big fan of surrogate keys. Looking through some of the databases I am responsible for, most of the tables in them have no natural unique identifier. What would you suggest a natural identifier for an order header record would be?


I'm a big fan of natural keys. But I heartily agree that when there is no obvious natural key, don't try to force one. I've seen crazy keys like "customer zip code plus bith date plus first three letters of last name". Like, give it up man! Just use a sequence number! I'm especially annoyed with db designers who put together some crazy collection of fields in the hope that it will be unique, and then tack on a sequence number because they know duplicates are possible. If you're going to put a sequence number on the end anyway, why not just forget the rest and just use the sequence number?

That said, when there is an obvious natural key, like "social security number" for employee or "two-letter state abbreviation" for a U.S. state, I'd prefer to just use it. Then I don't need a bunch of extra joins to get a recognizable identifier.

Re: The Homegrown CMS

2010-05-24 12:26 • by Jay (unregistered)
<comment type=grammar subtype=nazi>
"largely because writing applications are boring"

I think that should be, "writing applications IS boring". Just because applications is plural doesn't mean that the sentence calls for a plural verb. The subject of the verb is "writing", not "applications".

I usually brush off the grammar errors but for some reason this was leaped out and attacked me.
</comment>

Re: The Homegrown CMS

2010-05-24 12:30 • by Me (unregistered)
[quote]
Boolean-type values were represented as a CHAR(5) field, holding possible values of 'true', 'false', or NULL.
[quote]

Ah, the luxury of a single fixed boolean representation (even with NULL).

My last job had a DB which represented booleans based on the preferences/ability/experience of the last programmer to check in a SQL update script.

So we had VCHAR2(256) or NUMBER(1,0) - and various sizes in between - columns with "TRUE"/"FALSE", "true"/"false", "T"/"F", "t"/"f", "YES"/"NO", "yes"/"no", "Y"/"N", "y"/"n", "1"/"0" or 1/0, with NULL scattered in there depending on whether the programmer had heard of NOT NULL.

Re: The Homegrown CMS

2010-05-24 12:38 • by Buffled
309461 in reply to 309428

Fred, don't ever use "well designed" and "VB6" in the same paragraph again, unless you're include one of the following words:
wasn't
not
joke
fail

I have seen VB6 used to create a well-designed application. This is no joke - and wasn't a failure.

Re: The Homegrown CMS

2010-05-24 12:38 • by Marc B (unregistered)
309462 in reply to 309442
Grammar Nazi:
I wonder if the narrated version of these posts leave in all the spelling/grammar mistakes.

I wonder if his please for help were ignored because he didn't say pleas.

Re: The Homegrown CMS

2010-05-24 12:39 • by YourNameHere
309464 in reply to 309449
Cyrus:


Public Function FileExists(sFullPath As String) As Boolean

Dim oFile As New Scripting.FileSystemObject
FileExists = oFile.FileExists(sFullPath)
End Function


Having been a VB programmer "back in the day" I will say that this was a much better way to check a file BUT you had to depend on VB Script being installed on the host PC. For a CMS running on a server, that would be fairly easy to do.

Re: The Homegrown CMS

2010-05-24 12:41 • by AnOldHacker (unregistered)
309465 in reply to 309458
Jay:
Jaime:
I'm a big fan of surrogate keys. Looking through some of the databases I am responsible for, most of the tables in them have no natural unique identifier. What would you suggest a natural identifier for an order header record would be?


I'm a big fan of natural keys. But I heartily agree that when there is no obvious natural key, don't try to force one. I've seen crazy keys like "customer zip code plus bith date plus first three letters of last name". Like, give it up man! Just use a sequence number! I'm especially annoyed with db designers who put together some crazy collection of fields in the hope that it will be unique, and then tack on a sequence number because they know duplicates are possible. If you're going to put a sequence number on the end anyway, why not just forget the rest and just use the sequence number?

That said, when there is an obvious natural key, like "social security number" for employee or "two-letter state abbreviation" for a U.S. state, I'd prefer to just use it. Then I don't need a bunch of extra joins to get a recognizable identifier.


Except that SSNs are NOT unique!

It's hard to come up with a natural identifier which is stable. (Think zipcode or telephone number--what happens when you go global?) What's worse, many of the things which ought to work (SSNs, City+State) DON'T.

In case anyone misses it, the problem with max+1 indexing (aside from races) is that the final element might be deleted. If the deletion is incomplete, the orphaned pointers will point to the next record to be created.

Re: The Homegrown CMS

2010-05-24 12:42 • by frits
309466 in reply to 309461
Buffled:

Fred, don't ever use "well designed" and "VB6" in the same paragraph again, unless you're include one of the following words:
wasn't
not
joke
fail

I have seen VB6 used to create a well-designed application. This is no joke - and wasn't a failure.


Was it called "Hello World!"?

Re: The Homegrown CMS

2010-05-24 12:48 • by DaarkWing
I like the poor grammar. When I saw, "the company had portal driven by a VB6 application", I envisioned a drive by shooting via portals. So, it classic XKCD styling, I made the following:



Re: The Homegrown CMS

2010-05-24 12:51 • by J (unregistered)
309468 in reply to 309462
Marc B:
Grammar Nazi:
I wonder if the narrated version of these posts leave in all the spelling/grammar mistakes.

I wonder if his please for help were ignored because he didn't say pleas.


Give plia's a chance.

Re: The Homegrown CMS

2010-05-24 12:59 • by Luis Espinal (unregistered)
309470 in reply to 309449
Cyrus:
Fred:
Anon:
Fred:

>The code module contained such gems as this function:
> Function FileExists(f As String) As Boolean

That one is actually well designed - it just looks sucky because of the way you had to do things in VB.



No, no it isn't.


Ok, why it the design poor? It has a reasonable name, and actually uses parameters instead of global variables. Ok, the FreeFile thing is a red herring, but other than that it does what it has to do. Blame Bill Gates for the error handling weird syntax.


Public Function FileExists(sFullPath As String) As Boolean

Dim oFile As New Scripting.FileSystemObject
FileExists = oFile.FileExists(sFullPath)
End Function


That wouldn't had worked in older versions of VB, which probably was the case with this CMS from hell. Not that it takes away from the fact the function in the article is really not that good (starting with the name, which actually tests for file accessibility, not existence.)

Oh well.

Re: The Homegrown CMS

2010-05-24 12:59 • by Anonymously Yours (unregistered)
309471 in reply to 309447
barry:
Crabs:
Jaime:
pete:
frits:
Mike M:
...Or even any auto-incrementing IDENTITY columns for that matter...

I'd say having this feature is more of a WTF.


Not if there is no natural unique identifier to be used although that is rare and usually indicates something that could be implemented better.
Really? I'm a big fan of surrogate keys. Looking through some of the databases I am responsible for, most of the tables in them have no natural unique identifier. What would you suggest a natural identifier for an order header record would be?


You're replying to a person who has obviously been through half a semester of DB Design 101.

Even if a record has a natural unique identifier, that natural unique identifier is most often a string (because that's how we humans think: in words). Strings suck for joining, selecting, and indexing on, because the compare takes an order of N longer than comparing an integer.


Surely not once indexed? There should be a negligible difference as far as I know. Not talking tables with millions of records here obviously.
Integers tend to be smaller than strings, requiring fewer bytes to be compared to find an exact match. Though you're correct that in a small database this would be negligible, you have to take into account that it will be difficult (possibly dangerous) to switch to a surrogate key later if the database use grows. Other issues to take into account revolve around using indexing...

First, you have to deal with index fragmentation on MSSQL. Since this is a string, you're probably going to want to put the FillFactor to 30 to give the server extra space to swap the indexes' order around on every INSERT. Of course, things are going to fragment anyways, so the second thing you're going to have to do is include this index in a regular rebuild/reorganize process. Third, this will have to be a unique key, so every time you do an insert the database will have to do string comparisons to make sure it doesn't exist already. Of course, the same is true of numbers, but they are smaller so the comparisons take less time/effort. (This type of comparison also gets multiplied if you have replication servers.) Then you have the worst case scenario: what happens when management decides they don't want your natural key to be unique anymore?

All-in-all, it's typically safer and faster to use an identity for your surrogate key from the beginning. There are times when I wouldn't do it, but for most tables I find it is better to take the small disk-usage hit this costs for the processing and maintenance reductions it returns.

Re: The Homegrown CMS

2010-05-24 13:01 • by Buttbuttin of the mbuttes (unregistered)
309472 in reply to 309459
Jay:
<comment type=grammar subtype=nazi>
I usually brush off the grammar errors but for some reason this was leaped out and attacked me.
</comment>
I refer you to http://en.wikipedia.org/wiki/Muphry%27s_law

Re: The Homegrown CMS

2010-05-24 13:02 • by Zog (unregistered)
309473 in reply to 309422
Someone mentioned a home grown CMS in Lotus Notes.

During a gap year while doing my degree I was tasked to do exactly that...a CMS in Lotus Notes 3...

Scarred for life I am.

Actually I might even have the code somewhere - VBox, Win 3.1 installation and I reckon I could get it running again and post it here - on the other hand there *are* moral limits to the sort of suffering that one can cause and ensure oneself too...

Re: The Homegrown CMS

2010-05-24 13:07 • by Memo Ree (unregistered)
Imagine what happens should two people run the same report at the same time.
What a mind blowing concept! Two people using the same thing! At the same time even!

We still have a lot of people who can't wrap their brains around the idea that there is anything more than one computer and one user. Or, if there is more than one, it must be an identical computer using its own local storage for its own copies of software, spreadsheets, documents, etc.

We had this problem nicely solved about 30 years ago. Professionals who understood data management and systems design used that knowledge to, uhmm, manage data and design systems. And they put it all together on hardware and operating systems that were designed from the ground up for multiple users and graceful resource sharing. You could think of this package of hardware and software as a computer specifically intended for business, or, more succinctly, a Business Computer (BC).

Then along came the Personal Computer (PC) and technology was dealt a blow from which it has yet to fully recover. Ignoring the clear implication that a Personal computer is designed for one person and not for a business, businesses flocked to gobble them up by the ton. People who taught themselves "how to program" using a toy were suddenly everywhere, producing software aligned with the Personal Computer focus. Who cares about file locking? Concurrency control? Hell, even file permissions and user IDs were superfluous and therefore omitted. Who needs the concept of a root user when there's only one user per computer? Let the user do anything they want! Basically all the solutions that were already well understood were thrown in the trash, only to be painfully, gradually, and only partially, rediscovered in the decades to follow.

Yeah, some wise ass will chime in to trash the multi-user computers of the 1970s as expensive, slow, and puny in their specs. Do you really think everything would have stagnated there? Just try to imagine where 30 years of progress in Business Computers could have taken us by now. The gap between that potential and today's reality -- where ignorant (or worse: arrogant) developers still assume everyone's computer is just like mine, and everyone runs as admin -- can be charged entirely to the damning influence of the Personal Computer and the software companies whose blatant lies were swallowed whole by an unsuspecting public.

Yeah, those with the experience to see through the lies learned to despise those marketing-driven empty-promise factories. But the public, with little computer knowledge, believed everything, and is only now gradually obtaining enough computer savvy to understand the need for things we had, and discarded, before half of us were even born.

Re: The Homegrown CMS

2010-05-24 13:17 • by Cyrus
309475 in reply to 309456
frits:


While that is a more succint method, the one in the article is very similar to the "C" way of checking of a file exists. Except for the superfluous "on error" statement, that is.

BTW- Nice 2 second googling, but you should set oFile to Nothing before exiting your function.


Ha, Google? I asked an old VB6 buddy of mine who Googled it.

Re: The Homegrown CMS

2010-05-24 13:26 • by Mike (unregistered)
A little lazy with the proofreading today, eh?

his please were never granted

Re: The Homegrown CMS

2010-05-24 13:46 • by Buffled
309477 in reply to 309466
frits:
Buffled:

Fred, don't ever use "well designed" and "VB6" in the same paragraph again, unless you're include one of the following words:
wasn't
not
joke
fail

I have seen VB6 used to create a well-designed application. This is no joke - and wasn't a failure.


Was it called "Hello World!"?

Okay, you caught me. I've actually never seen a well-designed VB6 app. I was just being contrary and demonstrating that I could still say it while meeting your criteria...

Re: The Homegrown CMS

2010-05-24 14:30 • by Bub (unregistered)
309478 in reply to 309430
Ike:
Err, uh, make that at least CHAR(12) to hold "FILENOTFOUND".


No...CHAR(9) is much better ;)

Where would TDWTF be without such things?

Re: The Homegrown CMS

2010-05-24 14:57 • by anon (unregistered)
309479 in reply to 309470
Function FileExists(FilePath As String) As Boolean

FileExists = Len(Dir(FilePath)) > 0

End Function
« PrevPage 1 | Page 2 | Page 3Next »

Add Comment