![]() |
php vs. perl
ok. Here's a quick (or not so quick :)) question.
What is the difference between php and perl. No... I'm not that stupid, i understand that they are two different languages, but both have c like syntax and from what i tell, can do pretty much the same thing. I'm learning php right now, and will most likley learn perl soon, but i just wanted to know what the pros and cons of each are. Thanks :) |
Just give those both up and learn Pascal.
Someone once said Pascal will solve all the programming problems of the future |
Quote:
--- Could someone answer my question though? |
Well it isn't as simple as that. ;)
PHP is nearly as feature packed, and can do just about everything Perl can do. It is much simpler and easier to use, but it isn't as capable as Perl. I started using Perl, and well, I just really enjoy PHP much more. |
Quote:
Brandon, i remember you saying that the CD header was made in perl. Could you have done the same thing in php? - If so, why in perl? Thanks |
Quote:
Quote:
I prefer PHP over Perl, only because i use PHP all day at work, and there are a few subtle differences that would drive me crazy moving back & fourth between languages. |
Quote:
Well it is basically more down to ease of use, they both can do pretty much the same thing, it is just which one can do it in the shortest amount of space (code). PHP does probably run faster than Perl, which is one reason why many will choose it over the other. I say don't waste your time in Perl, unless you just can't figure out how to do something in PHP. Also, if you are wanting to get into web programming, then it wouldn't hurt to know more perl, but I say don't worry about it. Quote:
The eternal question of "Perl vs. PHP" has been going on forever, and ever.. http://www.google.com/search?q=%22ph...22perl+vs.+PHP |
K I'm not that bright of a person when it comes to web programming. After reding this web though I see that PHP is well liked and is used throughout this website design and creation.
My qustion is People use PHP and Pearl and PASCAL to do like web work, does this mean HTML is no longer used in writing a webpage or am i looking at all this the wrong way. |
HTML is literally required (unless using some languages) to make a site work. Don't even bother with programming languages if you don't have HTML down. Perl, and PHP are known as server-side scripts, you still need the HTML to communicate with the webbrowser. In PHP code would look like this:
PHP Code:
|
Quote:
Pascal isn't for web work, I was joking in my post. Pascal was for database programming and was the precursor to BASIC (Which is pretty much a streamlined Pascal with a few less features). Sorry for being misleading. And on the PHP/Perl vs HTML, AJ's post is right, but some pages (mostly the freebies) are entirely in HTML. Also, Macromedia Flash is becoming a bigger part of web programming. Most pages that you see will be geocities.com/MyNeatPages50230/ or the like. |
my $.02 -
There are three things (in my option) that make a good web page. HTML - This handles what the site looks like. Makes it pretty and such thought style sheets and stuff like that. Also, any 'static' (or non-changing) stuff for the page will be here. File extentions: *.html *.htm - BTW: XML or xhtml or dhtml are all 'new' html like code. The problem with current html is that all browsers display the code differently. So... a web developer is forced to decide how much to rely on 'eye-candy' when some browsers won't support it. This all stems from the problem that back when (Al Gore built the web j/k :)) the web began, the people that designed some of the first code never thought that the web would be used for what it is today. (IE: They thought it would be a text type network thing that schools/goverments would use to share data. NOT, where every person in the us would be viewing it with tons of graphics and 'eye-candy') Client-side scripting - This is mostly JavaScript (JS). This will allow the client (or computer viewing the site) to run some script (or program :)) to do a task. Example: (I'm using this because i see it right now) When you go to post a message on CD, it will run some checks using JS to see if you have enough or too much info. Some JS will check to see if you have a subject (in a new post) or some text in the post/reply box. Also, the vB code inserts the tags using JS. Main point: Client-side scripting is done on the computer viewing the site. Server-side scripting - PHP, Perl, ASP This is a script (or code) that runs on the server BEFORE it is sent out to the client. This allows web developers to have 'dynamic' (or changing) data among other things. CD uses it because this way people can put up data, and others can view it and such. It is also used with on-line 'shoping carts' (with SSL (a secure connection)) and other things that require data to change. The advantage to this is because otherwise, the user would have to download ALL of the data and then have their client side scripting do all the sorting/other work. Not a good idea :) Hope this helped all. (PS: Learning computer programming is easy :) - I didn't know php 3 months ago, and now i'm writing a major mod using it for my site :)) - HTML is also very easy. It has a simple syntax. However, when you want to start to have cool looking things, then it gets a little harder with CSS and things like that) Jack BTW: Flash is also becoming big. However, flash is just a type of animation that is integrated into websites. Not really a programming language. |
Well said, Jack. I just have one thing to add.
Quote:
|
Quote:
Hmmm... Ahh... I think i'll be an admin today (tells the client to the server) :) |
I learned PERL, then did PHP and liked PHP MUCH better for these reasons:
The code is much cleaner and easier to write. PERL is well known for being an incredibly ugly language with all its symbols strewn all over. PHP has much better documentation. Goto their website and search for something you need (like "date" or "sort") and you will find the function with full documentation. Sure PERL has many more capabilities and there are thousands of modules you can download, but a lot of the things PERL has that PHP doesn't don't really benefit people who are trying to write web scripts with it. On the other hand, PHP has a lot of nifty built in stuff that if you are feeling brave you can play around with such as image generation or flash movie generation. I really have no idea which is faster but I don't care either. PHP is just so much easier to write. |
Giving my own opinion I prefer Perl over PHP any day. Although it is true that PHP was made specifically for web programming I find PERL easier to use. Someone mentioned it is ugly and it may be true but its probably because there are so many ways to do something. You can do thing the way you want or perhaps another. There is indeed a great multitude of modules for perl that do all sorts of crazy stuff. Since perl wasn't specifically made for web programming most of these modules have not much to do with web programming but the power is there in case one needs to use it. But also because of the same reason Perl may integrate better with other things that may be present on a web server. For example currently for the site I am making I have an option of checking its syntax with a script called "weblint" which runs on a command prompt. But in Perl its pretty easy to run weblint on the webserver, send in some html to it and read its output and then one can display the html with the information weblint provided. PHP probably can do this too in some odd way but I doubt it has as much support for such things as Perl does.
As for Flash, it can also be used for some web programming. Using action-script (Flash's scripting language) one can do some stuff although not as simply as in Perl or PHP. I forgot to mention that if you learn Perl you can use it for just about anything unless speed is a real issue in which case C should be used. |
| All times are GMT -5. The time now is 21:14. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi