Welcome to Dream.In.Code
Getting Help is Easy!

Join 136,075 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,607 people online right now. Registration is fast and FREE... Join Now!




Perl, PHP, or something else

 
Reply to this topicStart new topic

Perl, PHP, or something else, Just a bunch of Questions

Realedazed
19 Apr, 2008 - 04:09 AM
Post #1

New D.I.C Head
*

Joined: 13 Mar, 2008
Posts: 26


My Contributions
My google-fu is weak. I can't even search on this site. I keep going to some forbidden area, for some reason.

Anyway, I mentioned to a friend that I'm trying to get into web programming. So, one of the things I'm learning is PHP. He stated that he dislikes PHP and told me to learn JavaScript instead. I didn't go into to much detail since I had to leave, so I'm coming to you guys with my large number of questions.

So, what's wrong with PHP?

All my googling found was sites supporting PHP over other languages, espeically since I'm going to be using some sort of database (maybe mySQL?) I didn't find too much Perl over PHP though.

I've been reading about this SQL injection. Is it more preventable when using Perl?

Should this have gone in the Perl folder?

Anything else I should know?

Thanks a bunch and sorry in advance for being sorta vague. I'm not totally sure what I needed to ask, but I hope you guys got my drift. Oh and links are good, too.

User is offlineProfile CardPM
+Quote Post

no2pencil
RE: Perl, PHP, Or Something Else
19 Apr, 2008 - 05:04 AM
Post #2

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 6,435



Thanked: 64 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
PHP & JavaScript are 2 completely different technologies.

All PHP code happens on the server side.

PHP Example:
CODE

if($password==$Password) ...

For the most part is safe. The client will NEVER see this code, because it is executed & then the proper code is prepared for the browser BEFORE it is sent.

CODE

<script language="JavaScript">
if(password=="Password") ...

In this javascript example, you can view the actual password. Not very secure huh?

Plus, with PHP, you can interact with the server os (to use the server time & not the clients time), Database software, & any hardware that you feel like tinkering with.

Javascript, well, since it's client side, you should keep it simple... or hope that the viewer has an up-to date browswer, with half way decent standards, & has his CMOS battery fairly fresh, so the time isn't off.

On the other hand, the best software to use is what will get the job done. If your friends requirements are all client side activity & testing, then sure, your friend might be spot on. But, again, comparing JavaScript to PHP is apples to oranges, they are simply designed for different levels & browser side execution.

& as far as SQL injection, again, it's best in which ever language you can secure more.

A more secure PHP code is going to protect better against horrible (SQL injection security) written Perl code. The language itself doesn't make it more secure. The fact that you have gone through & removed all avenues of SQL injection in your code is what will make it secure.
User is online!Profile CardPM
+Quote Post

baavgai
RE: Perl, PHP, Or Something Else
19 Apr, 2008 - 06:09 AM
Post #3

Dreaming Coder
Group Icon

Joined: 16 Oct, 2007
Posts: 2,019



Thanked: 105 times
Dream Kudos: 475
Expert In: C, C++, Java, C#, ASP.NET, PHP, Perl, Python, Oracle, SQL Server, MySql, HTML, JavaScript, Lua

My Contributions
Given a choice between perl and php for web development, I'd go with php. It's more focused on what you're trying to do. It's also more frequently offered by ISPs ( perl scares them, with good reason ).

Saying "use JavaScript instead of if PHP" is a pretty good sign someone has no clue. It's like saying HTML instead of PHP. Server versus client.

Most PHP sites, or any sites, are littered with javascript ( looks at this one ). You'll probably want to learn javascript along with html and css; more most sites they're all together. Once you have a firm grasp of the construction of a web page it's much easier to do the server side stuff that will create that web page.

User is online!Profile CardPM
+Quote Post

PsychoCoder
RE: Perl, PHP, Or Something Else
19 Apr, 2008 - 06:18 AM
Post #4

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,983



Thanked: 125 times
Dream Kudos: 8525
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
If I had to chose between PHP and Perl, I, like baavgai, would have to chose PHP. Ill take it a step further and chose PHP 5, which is now object orientated, which is really the way to go.

The person telling you to go JavaScript over PHP obviously doesn't know a lot about programming. JavaScript is, in my opinion, a requirement for web programming as it allows you to do validation (and other features) client-side, meaning it is executed by your browser. PHP is a server-side code, meaning it is executed on the server hosting the site, then the results are sent back to your browser, which then interprets them.

For a new web programmer (this will shock some, especially those who know me on this board) PHP is probably the language to learn first. Though I am a huge supporter of .Net, I believe PHP will offer the lowest learning curve, and shorten your development time. As you grow in experience and knowledge I would definitely branch out and not confine yourself to a single language or technology, this will indeed make you a more valuable programmer.

User is online!Profile CardPM
+Quote Post

girasquid
RE: Perl, PHP, Or Something Else
19 Apr, 2008 - 08:20 AM
Post #5

Barbarbar
Group Icon

Joined: 3 Oct, 2006
Posts: 1,266



Thanked: 14 times
Dream Kudos: 650
My Contributions
If I had to choose, I'd think about what I plan to do in the future.

PHP is geared exclusively for the web. Perl is not.

I'm a Perl guy, so I'm a bit biased - but if all you'll be doing is websites/web development, you should be just fine with PHP. Perl's not going to give you anything extra PHP won't - other than mod_perl(which will speed up your Perl applications), and the CPAN(although I hear PHP's PEAR might as well be equivalent). And from what I've been told, mod_perl causes more problems than it fixes - although I've never touched it because I've never needed it.

This post has been edited by girasquid: 20 Apr, 2008 - 06:40 PM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/1/08 07:19PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month