timbeckham Posted February 4, 2003 Posted February 4, 2003 Let me start by saying that I am thoroughly impressed by the quality and depth of OSC. The generosity of the many talented contributors to this project is an inspiration for someone, such as myself, who is just getting started, both in PHP and OSC. I thank you all and look forward to many years of working with and, hopefully someday, contributing to the OSCommerce community. That said, I must ask what must seem a dumb question, but it has me stymied and represents a stumbling block for my advancement in using OSC. The code provided in the download is formatted in a way that is devilishly difficult to follow. I want to get into the guts of OSC, down to the little nuts and bolts of the flow of code, SQL logic, database design, functions, classes -- all of it. However, in order to do so, I have had to go through each file, one by one, and reformat the lines in the source, so I could follow the logic. For instance, the SQL statements are all in one single line in the files that I have downloaded. In order to cope with this, I have gone through each statement in each of the numerous files and added CR's and spaces to create an easy to read SQL structure. That was a task involving at least a hundred SQL statements!!! In addition, the various if, while, for, & switch logic structures needed to be "lined up" by their braces in order to keep the nesting and logic visually clear. The HTML table structure was confusing, since there is a convention of using <td><table> on a single line to introduce nested tables. This is probably just a preference of my own, but I went through the entire set of files and rearranged the HTML to form structures like: (leading periods added to preserve indenting for this message only) .<table> ...<tr> .....<td> .......<table> ........ .......</table> .....</td> ...</tr> .</table> Now I know that this is a little excessive for most people's purposes, but it has helped me tremendously in deciphering the HTML code. Well, that is a lot said, and again I apologize for what must seem a tedious and excessively negative message, but it is really important to me. I was wondering if someone has already done all this work for each release, and I had just missed that fact. Is there a developers' corner, perhaps, with code more thoroughly formatted? If it is necessary, I will do this work all over again, when the final release of 2.2 comes out, but, obviously, I would like to avoid that labor. Any help will be greatly appreciated. Tim B. Artisans of the Ironwork Guild
Guest Posted February 5, 2003 Posted February 5, 2003 I'm also having a hard time understanding the code because of reasons you already mentioned. I think this can be solved if you take out the HTML code out of the PHP and into some template files and developers follow a common coding style.
mattice Posted February 5, 2003 Posted February 5, 2003 I'm also having a hard time understanding the code because of reasons you already mentioned. I think this can be solved if you take out the HTML code out of the PHP and into some template files and developers follow a common coding style. We follow a common coding style. Check out STANDARDS.TXT in your distribution :D The whole idea of standard-izing the code is to make it more readable... but then again "readable" is subjective thing ;) Mattice "Politics is the art of preventing people from taking part in affairs which properly concern them"
Guest Posted February 5, 2003 Posted February 5, 2003 I stand corrected. Thanks for pointing that out :)
toolcrazy Posted February 5, 2003 Posted February 5, 2003 I found it much easier to follow this code with a good quality text editor. I use HomeSite. It color codes all the diffrent code. I've gotten so used to this that I now found that I have trouble reading the code in a standard editor. I started to do my editing with a standard editor but was getting so confused, I almost gave up. Then I happend on my HomeSite in my Macromedia studio install. And I haven't gone back since. Steve -------------------------
Daemonj Posted February 5, 2003 Posted February 5, 2003 I use UltraEdit for all of my coding (C/C++, PHP, HTML, etc) and definitely recommend it to anyone. Setup color-coding and word wrapping and I think that your problems will be resolved. Good luck! "Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein
timbeckham Posted February 5, 2003 Author Posted February 5, 2003 Maybe one could use text formatting programs that clarify the code. However, I haven't gotten something like that to work for me, and it is impossible for me to follow the logic in the source files that are in the daily snapshots. It was my hope that there were "developer files" that could be more easily followed - just because of more thorough indenting, fuller and more explicit commenting, etc. I guess I'll just have to reformat the code my way, when the final 2.2 release is out. Artisans of the Ironwork Guild
dreamscape Posted February 5, 2003 Posted February 5, 2003 I'm also having a hard time understanding the code because of reasons you already mentioned. I think this can be solved if you take out the HTML code out of the PHP and into some template files and developers follow a common coding style. We follow a common coding style. Check out STANDARDS.TXT in your distribution :D yeah well for PHP you guys do... but for HTML, accomplishing the same thing can vary from file to file in the distribution, making things a little confusing right now. I cannot think of a specific example off the top of my head, but I do remember when customizing this last site I just did, certian things were done differently... like I remember on a few of the checkout pages, one page the tables on the main area were done exsculisvely with HTML (on account details I think), while on other pages, those same boxes were created uses the box classes. just little things like that... I agree with timbeckham on the structure of the tables... often there is a <td><table> tag, but the <table> cannot be seen due to the length of the <td> tag. I often move the <table> down to the next line, so that when making changes, I do not get confused and am certain there is a nested table there without having to scroll all around the code to be able to see that <table> tag. The only thing necessary for evil to flourish is for good men to do nothing - Edmund Burke
Guest Posted February 6, 2003 Posted February 6, 2003 I use UltraEdit for all of my coding (C/C++, PHP, HTML, etc) and definitely recommend it to anyone. Setup color-coding and word wrapping and I think that your problems will be resolved. Good luck! I use Texturizer but I'm also evaluating ActiveState's Komodo. Even with all these syntax-highlighting gizmos, editing is still quite a pain.
Guest Posted February 6, 2003 Posted February 6, 2003 Best editor I've found is editplus Same great features you have talked about, and FREE.
Daemonj Posted February 6, 2003 Posted February 6, 2003 Best editor I've found is editplus Same great features you have talked about, and FREE. I used to use EditPlus a while back. I found most of the features useful but some of the implementations were irritating. In addition, a few of the features that I used a lot were buggy. It has been a while and I would imagine that EditPlus has improved since then. Overall, UltraEdit does everything I need and more without a problem. I do not mind paying the $30US for decent software (along with 3 free upgrades so far). In the end, so long as you like the tool and it makes you more efficient that is all that counts. "Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein
Guest Posted February 6, 2003 Posted February 6, 2003 I've also tried the beta version of PHPEdit which is a free power-packed PHP editor.
hobaugh Posted February 6, 2003 Posted February 6, 2003 A very excellent editor is the Epsilon Programmer's Editor. I have been using it for 10 years and it is fantastic. It even has its own C style language (EEL) that is very nice and very powerful. It is on the same line as emacs but better. It's not free $250 but for that price you get executables for Windows, Linux, FreeBSD, OS/2 & DOS. It is the only editor you will ever need. Sorry if I sound like a mouth piece for Lugaru Software, I just really like the editor. Doug
Recommended Posts
Archived
This topic is now archived and is closed to further replies.