User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 375,249 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,207 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting

Opinions? javascript/php/etc and programming standards

Join Date: Mar 2007
Posts: 83
Reputation: rgtaylor is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 2
rgtaylor rgtaylor is offline Offline
Junior Poster in Training

Re: Opinions? javascript/php/etc and programming standards

  #33  
Apr 26th, 2007
Ok, it isn't actually a PHP thing to use index.php or similar as a central hub and feed contents based on parameters... MOST enterprise solutions basedon Java do this too... they will have 1 system servlet which processes the URL and determines what files to include and/or forward control to as it serves the request. it is not uncommon to see:
http://intra.ibm.com/portal?cmd=page&obj=start.htm
or similar... often these URLs are huge and look awful, but they do the job and keep everything organized for the system well...

They typically have shallow folder structures, with similar contents being grouped into common locations so that URLs can be shorter allowign for longer parameters... also avoiding long file paths into a parameter list... since file paths can be MUCH longer than a URL is allowed to be...

THUS the main problem with folder structure that minics the site... if the site is several clicks deep with descriptive names, then the URL length limitations can become problems...

THIS is an even bigger problem when creating system for internation use... we have to think outside the "English Box" for a minute...

Each Japanese character that I may have in folder name, will take at least 6 characters in the URL to represent, possible many many more... so now we have taken that URL limitation and reduced it at best 1/6th the number of useful characters...

I have actually had to debug a system for an Enterprise Software vendor where this was the problem... the idiots never fixed the main code stream so each time they localized the application's new version the SAME bug popped up and customers complained until they fixed it AGAIN... only to have it come back again....

"Think ahead" was one of my hints, right? Avoiding problems is easier than fixing them....

Unless URLs allow the same characters as File Systems, and the path length limitations are the same, eventually there will be problems, especially if anything you build is to be used outside of the small English world...

I design EVERYTHING to internationalized from the start, so that it can be localized... not internationalization and localization are NOT the same thing...

But internationalizing things means thinking ahead and planning to avoid the problems that may be likely to occur...

Java stole the OOP from C/C++... C++ was referred to as C with classes.... C has "struct" which is not quite the same, though they have made some enhancements over the years to make it more similar to C++ classes... But there are serious findamental differences...

The reason C/C++ win out is simple... They NEVER take away your power to be in control and make your own design decisions... But with great power comes great responsibility, hey, where did I hear that...

Java took away a GREAT deal of the developer's power in exchange for the ease of use and portability....

Java HAD to force the classes in order to operate correctly... thus the file names MUST share the name of the class, excpet for application files with a main function...

Static objects can't call non-static ones, etc...

I used PHP to build an entire online application, and that was before PHP even had classes... then with PHP classes, I was able to do it better... Now classes have been enhanced, but still are NOT upto my expectations for encapsulation... So I turn to Java for my large scale projects and reserve PHP for my smaller scale projects... Though I am designing a system that will use BOTH together... by having PHP do some things and Java/JSP do others, I hope to achieve a synergy of performance by have Apache and my App-Server running in parallel to generate the contents in a way seldom, if ever, done before.... I won't say anymore...

Now, I promise the way I used mod_rewrite you would never know it was being used... I have a site where there was a key design requirement for search engines to index it in a certain way... by using mod_rewrite and dynamic URL generation, I was able to provide the crawlers with what t they needed to get the job done in a way completely not possible with spiders files... I don't want to give anything away but lets just say that even the best optimized crawler in th world would take a long, long time trying to crawl my site, finding ALL those parameterized pages, with every possible option and every possible combination despite the fact they usually are limited to 3 parameters... It goes way beyond that... but that is enough... and I would defy anyone to try and figure out from looking at it that it was using mod_rewrite... you just have be clever in how you use it... most people aren't....
Reply With Quote  
All times are GMT -4. The time now is 5:00 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC