Jump to content
Sign in to follow this  
Daniel Lewis

Spaghetti Code

Recommended Posts

I have just spent three days just getting an idea of where all of the files and various components of osCommerce actually are.

 

The problem is, osCommerce is built in such a way that removing a component from all of the pages is like pulling teeth from an angry crocodile.

 

All of the face pages have formatting, content, code, and a little bit of database interaction in the mix for fun. To remove a single component from the entire system, such as for instance, the manufacturers bar, you have to exhaustively pour over every page in the package to find it, and then trial and error remove the bloody thing, and then figure out why parts of your page break that were seemingly unrelated.

 

This problem is almost critical, as I'm almost to the point where I think I should just write the whole bloody thing myself.

 

Instead, I have decided to attempt to reconstruct the components of osCommerce in a modular way that is readable and logically organized. A mere attempt mind you, but I will try to do it without removing or modifying any of the existing content.

 

I'm going to make it so that you can embed a component from osCommerce anywhere on any of your existing pages, and that the template site for osCommerce is just one such layout. While I can see there is some sort of effort in this direction - the "box, includes, languages" folder layout - the division isn't anywhere near practical as all the files still contain bits of pieces of everything.

Share this post


Link to post
Share on other sites

do you mean you are planning on doing something like the STS contribution does ?


KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Share this post


Link to post
Share on other sites

Sounds like your a newbie to the program. Thier is no such thing as instant gratification. One you get the hang of it and know the ins and outs of oscomemrce, you'll start to enjoy it more and more everyday.

 

I have just spent three days just getting an idea of where all of the files and various components of osCommerce actually are.

 

The problem is, osCommerce is built in such a way that removing a component from all of the pages is like pulling teeth from an angry crocodile.

 

All of the face pages have formatting, content, code, and a little bit of database interaction in the mix for fun.  To remove a single component from the entire system, such as for instance, the manufacturers bar, you have to exhaustively pour over every page in the package to find it, and then trial and error remove the bloody thing, and then figure out why parts of your page break that were seemingly unrelated.

 

This problem is almost critical, as I'm almost to the point where I think I should just write the whole bloody thing myself.

 

Instead, I have decided to attempt to reconstruct the components of osCommerce in a modular way that is readable and logically organized.  A mere attempt mind you, but I will try to do it without removing or modifying any of the existing content.

 

I'm going to make it so that you can embed a component from osCommerce anywhere on any of your existing pages, and that the template site for osCommerce is just one such layout.  While I can see there is some sort of effort in this direction - the "box, includes, languages" folder layout - the division isn't anywhere near practical as all the files still contain bits of pieces of everything.

Share this post


Link to post
Share on other sites
I have just spent three days just getting an idea of where all of the files and various components of osCommerce actually are.

 

The problem is, osCommerce is built in such a way that removing a component from all of the pages is like pulling teeth from an angry crocodile.

 

All of the face pages have formatting, content, code, and a little bit of database interaction in the mix for fun.  To remove a single component from the entire system, such as for instance, the manufacturers bar, you have to exhaustively pour over every page in the package to find it, and then trial and error remove the bloody thing, and then figure out why parts of your page break that were seemingly unrelated.

 

This problem is almost critical, as I'm almost to the point where I think I should just write the whole bloody thing myself.

 

Instead, I have decided to attempt to reconstruct the components of osCommerce in a modular way that is readable and logically organized.  A mere attempt mind you, but I will try to do it without removing or modifying any of the existing content.

 

I'm going to make it so that you can embed a component from osCommerce anywhere on any of your existing pages, and that the template site for osCommerce is just one such layout.  While I can see there is some sort of effort in this direction - the "box, includes, languages" folder layout - the division isn't anywhere near practical as all the files still contain bits of pieces of everything.

 

 

There are modules in the contribution section of osCommerce site that helps this issue alot..

 

One is the InfoBox Admin and another is the STS template system...

Look at these modules...

 

Mike

Share this post


Link to post
Share on other sites

The learning curve is steep but it smooths out rather nicely after you put in the time to learn the layout. But if you just want an easy template system, you should install the STS contribution. Everything on one page. Sounds like what you are looking for.

 

Jack

Share this post


Link to post
Share on other sites
The learning curve is steep but it smooths out rather nicely after you put in the time to learn the layout.  But if you just want an easy template system, you should install the STS contribution.  Everything on one page.  Sounds like what you are looking for.

 

Jack

 

That's just the thing I am NOT looking for. I want to modularize it into components that you can use from any page. Then I want to set up the various sub-pages so that they use these components instead of each being a large similar mass of code/content/style/database stuff.

 

I am a third year university student, the owner of my own small business, and I have been a programmer all of my life. I am calling this spaghetti code because that is how I see it. I am going to try to improve it because it is open source, an ideal I aspire to.

 

The very existance of STS is an example of why the work needs to be done. While I agree there is no such thing as instant gratification, I think there should be such thing as quality, especially in open source products. Quality is something that is quite different from instant gratification. It is clean, well written source code for you to download, examine, and modify to suite your needs. It is not a template driven system that masks the complexity of a massive lumbering monstrosity.

 

This is not a cry for help, this is me saying that I think this is a problem, and I want to tackle it.

Edited by Daniel Lewis

Share this post


Link to post
Share on other sites

It is a problem - a recognized one. One that, from what I understand, will be addressed in the next version. Your first post sounded like you were frustrated because you couldn't understand how to do it. That's why I suggested STS. My point is still valid though - it has already been done. Take a look at the BTS contribution.

 

Jack

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×