/    Sign up×
Community /Pin to ProfileBookmark

Why have I used PHP?

Hello, I am a Junior Developer and have constructed a search engine for my organisations website/intranet which works fine. I used PHP 5.0 and MySQL as this is what I am most proficient at using, the problem is that I am now faced with several presentations in which I discuss my design decisions, one of them being why I chose PHP to develop the search facility. As already mentioned familiarity with PHP and MySQL was the main reason, plus PHP has some useful functions like get_meta_tags, strip_tags as well as a large number of string manipulation functions which all made the task relatively easy but beyond these few reasons I don’t know why else PHP and MySQL are a good choice. I am a competant developer but not overly knowledgeable about the advantages/disadvantages different languages have over one and other in this situation, some of my colleagues keep mentioning Perl being a better language to have used but they just sound biassed as this is their language of choice. If anyone can help and give me some reasoning then that would be really useful.

Thanks

Solaar

to post a comment
PHP

15 Comments(s)

Copy linkTweet thisAlerts:
@stephan_gerlachOct 31.2006 — The main problem is that everyone thinks that their programming language is the best and they wont let anyone tell them different. If you ask a asp programmer they say that asp is the best and if you ask a jsp programmer they say that jsp is the best.

The fact is that the best programming language is only as good as the programmer. its not the programming language is the programmer that is the important fact. So if you are most comfortable using php and mysql then its the best one for you.

besides that there is the advantage of free and open source and many many other things.
Copy linkTweet thisAlerts:
@so_is_thisOct 31.2006 — If it is compiled Perl that is to be used, then I can tell you one advantage of Perl over PHP (and Perl isn't even my language of choice) and, by association, one disadvantage of using PHP. Which is... A compiled object is almost always faster, more memory efficient, and less CPU intensive than an interpreted object. PHP is interpreted. You can overcome this "problem" by creating a DLL in another language (preferably, one of the fast ones) and then invoke that from PHP to perform your search engine functions.
Copy linkTweet thisAlerts:
@netbuddyOct 31.2006 — I like chocolate but I dont go around telling everyone its the best because at some point, they may have tried it and know for themselves that chocolate tastes nice.

The same applies to languages, some are very cryptic and not well thought out and some of the logic and thinking around the development of some languages is frankly laughable. If you have ever touched on cobol and pascal, you will know what I mean, C makes for a better and more user freindly language over those two but even C and its derivatives are at best cryptic.

PHP on the other hand, has a more user friendly aproach to its methology and allows for things like undeclaired variables by simply at that time of discovery, initalizes the variable unlike other languages that spew pages of error messages because you forgot to declare a variable or missed out a semi-colon or misplaced a double quote...

If you spent all your time listening to other programmers, they use what they use for other reasons and often it is what they were taught at colleg/tec college or Uni and it is often all they know, so you should never feel thatyour lacking because you dont know other languages but excell in what you do know...
Copy linkTweet thisAlerts:
@LuboxOct 31.2006 — Personally I've been known to switch language about every 4th year, if not because of changes in work, then just to try new stuff. Right now I'm using PHP and I will most likely stick with this until the job description changes. I find it very easy to use compared to the ones I've used before (Pascal,C/C++, Visual Basic, SQL Windows and some other), at least for the tasks I have to do now. And my projects seems to be done a lot faster with PHP, although I haven't created the same thing in the languages.

Sometimes I will go back to C/C++ to create something low-level stuff or whatever you wanna call it, but normally PHP will be the one using that stuff. PHP give me great flexibility, and the stuff I produce is actually easy for other programmers to read even without much comments. Besides, I have found that it is easy to find help and suggestions in the PHP community (yay me - going to the PHP conference in Frankfurt this weekend), and there are tons of examples out there.
Copy linkTweet thisAlerts:
@aussie_girlOct 31.2006 — well you can tell them that PHP does interact with all the databases, so if at any time they decide that are going to use another DB the scripts would be portable and can still be used.
Copy linkTweet thisAlerts:
@NogDogOct 31.2006 — Just to be a bit pedantic: PHP is not an interpreted language; it is a run-time compiled language (as is Perl, too).

BASIC was an interpreted language: the interpreter would read a line, parse it, execute it, then move to the next line. PHP scripts, on the other hand, are actually compiled each time they are run by the PHP parser (with the same possibility of executable optimization as other, compiled languages), and then that compiled object is what is actually executed. Admittedly, it may be limited in the amount of optimization done as compared with a language which creates stand-alone executables files, since the compilation time becomes a factor in execution time.
Copy linkTweet thisAlerts:
@so_is_thisOct 31.2006 — PHP is ... a run-time compiled language (as is Perl, too).[/QUOTE]
Apparently, all Perl is not alike. (I have also heard of Perlscript -- or some such). I am no expert, but I do know a CGI programmer that writes Perl code which is pre-compiled into an executable module.
Copy linkTweet thisAlerts:
@NogDogOct 31.2006 — Apparently, all Perl is not alike. (I have also heard of Perlscript -- or some such). I am no expert, but I do know a CGI programmer that writes Perl code which is pre-compiled into an executable module.[/QUOTE]
Yes, there are compilers that will do that. Like any other compiler, the resulting executable is then a platform-specific file that will only execute on the appropriate hardware/OS, but it will be faster than the same Perl script executed by a Perl run-time compiler, since does not have to be parsed and compiled from the source code each time it is executed.
Copy linkTweet thisAlerts:
@so_is_thisOct 31.2006 — So, is there a PHP pre-compiler?
Copy linkTweet thisAlerts:
@netbuddyOct 31.2006 — I dont know how true it is, in a web server forum, someone said that PHP were working on a PHP compiler that outputs a standalone executable, how true that is I dont know, IMHO you have more chance of picking up a 25Kg bag of rockin horse manure.

Anyway, if your looking for something thats going to produce a runtime, you may want to look at http://www.python.org/ as a possible.

Python Programming Language

NASA uses Python...

... so does Rackspace, Industrial Light and Magic, AstraZeneca, Honeywell, and many others.

What they are saying...

"Python has been an important part of Google since the beginning, and remains so as the system grows and evolves. "

-- Peter Norvig, Google

more...

Using Python For...

Web Programming CGI, Zope, Django, TurboGears, XML Databases ODBC, MySQL, Others

GUI Development wxPython, tkInter, PyGtk, PyQt

Scientific and Numeric Bioinformatics, Physics

Education pyBiblio, Software Carpentry Course

Networking Sockets, Twisted Software Development Buildbot, Trac, Roundup, IDEs

Game Development PyGame, PyKyra, 3D Rendering

more...

Python® is a dynamic object-oriented programming language that can be used for many kinds of software development. It offers strong support for integration with other languages and tools, comes with extensive standard libraries, and can be learned in a few days. Many Python programmers report substantial productivity gains and feel the language encourages the development of higher quality, more maintainable code.

Python runs on Windows, Linux/Unix, Mac OS X, OS/2, Amiga, Palm Handhelds, and Nokia mobile phones. Python has also been ported to the Java and .NET virtual machines.
[/quote]


Did you notice anything?
Copy linkTweet thisAlerts:
@so_is_thisOct 31.2006 — Actually, I heard of Python several years ago -- in connection with Classic ASP.

In other words, ASP/Python vs. ASP/JScript vs. ASP/VBScript.

Otherwise... What, in particular, was I supposed to notice?
Copy linkTweet thisAlerts:
@netbuddyOct 31.2006 — Only that python is used by people like Nasa, Industrial light and magic, mySQL, XML, etc. it is also highly portable,running on PDA's, Mac's, PC's, etc.
Copy linkTweet thisAlerts:
@chazzyNov 01.2006 — to be honest, I would love to hear someone's reasons for using PHP. I know why I would use .NET, Java, Shell Script, or C, but inside of a large organization, I could never see the need to use PHP.

Any language can connect to a database.

A lot of languages can run on the web.


To say that you use a language because you're familiar with it isn't enough, you need to show why PHP was the superior choice based on design and implementation requirements. So I have to ask you:

  • - is your application object oriented?

  • - is your code well commented?

  • - did you develop it in such a way that it is easy to maintain, get logs for, and trace through problems?
  • Copy linkTweet thisAlerts:
    @pcthugNov 01.2006 — Ok my reasons for using PHP:
    [list]
  • [*]It is the most popular, open source web-only programming language.

  • [*]It has a large (if not the largest) online user-base.

  • [*]Is a relatively fast language to develop, this is due to countless factors (i.e. data types and structures are converted/defined automatically by the compiler).

  • [*]Is the best supported web development language (~95%+ of web hosts support).

  • [*]PHP has a wealth of useful predefined functions and available extensions.

  • [/list]
    Copy linkTweet thisAlerts:
    @SlappyTheFishNov 01.2006 — As far as I understand it, [URL=http://eaccelerator.net/]eAccelerator[/URL] stores PHP scripts in their compiled state which is probably as close as you're going to get/need to a compiler.
    ×

    Success!

    Help @Solaar spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.28,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...