picking a language

Programming, for all ages and all languages.
cloudee1

picking a language

Post by cloudee1 »

Ok, you guys because for some reason I think I value your opinions, at least as far as programming goes.

I have installed apache and visiting my localhost, it appears that it was in fact successful, and that is all I did with that, I don't intend to host from my computer but I would prefer to test here, so anyway.

I am currently downloading Perl, and I have already downloaded Php and mySql. None of which is installed yet, I'm not really sure which route to go. Php or Perl?

And do I need mysql if I use perl, or is it just with php?

Because I know how much you like to argue about languages and I am at a crossroads, and a little confused, I would love to hear some thoughts.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:picking a language

Post by Solar »

cloudee1 wrote: Php or Perl?
Two different worlds with very similar syntax.

PHP is for embedding in HTML. HTML page is called up, PHP code is replaced with it's output.

Perl is for generating HTML. Perl script is called up, Perl code generates HTML page as output.

So far they seem stunningly similar. But Perl can also be used for shell scripts, and even for generating full-fledged GUI applications, while PHP is (basically) limited for web uses.

So, PHP is more focussed on web development, while Perl is the more powerful (and complex) language overall.
And do I need mysql if I use perl, or is it just with php?
Neither PHP nor Perl require MySQL. MySQL is a database, nothing more, nothing less. But most of the times when you're using PHP / Perl in combination with a web server, you want to create dynamic content, which usually requires a database to store the data (like, members, boards, threads, posts in this forum; or pages, links and versions in the Wiki).
Because I know how much you like to argue about languages and I am at a crossroads, and a little confused, I would love to hear some thoughts.
If all you want is get quick results in web development, do PHP. If there's a chance for you to go beyond that, go Perl. If there's a chance for you to go far beyond that, use Python. (Which is more advanced and somewhat "cleaner" than Perl, but not - yet - as ubiquitous.)
Every good solution is obvious once you've found it.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:picking a language

Post by Solar »

I was just informed by a friend (whom I asked to confirm my post above) that, starting with version 4, PHP can be used as stand-alone scripting language, too. Means, yet less difference between the languages.

Still my recommendation: Perl is one of the most-used languages around, and Python is more or less bound to become its successor. PHP is seldom used outside of web applications.
Every good solution is obvious once you've found it.
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:picking a language

Post by distantvoices »

For starters I'd stick to php. It is rather straight forward to use and it gives you quite some learning.

Fact is that the both of them are interpreted/precompiled on the server either by a module (php) or by a cgi process (perl).

Perl requires you to load some module for accessing f. ex. mysql database. But IIRC, that's no big thing as Perl is designed to have important things at hands with no fuss, so you can go on and start your sql and retrieve your results without problems.

PHP has "native" mysql support buildt in. connect to the database, issue the sql query and fetch your results. You don't need to think much about cgi and sorta with a clean LAMP setup.

As Solar states, you can do way more things with Perl while PHP is specialised for web apps.

To have a further research, think about apache/jakarta tomcat and java servlets. *gg* mighta be a funny pasttime, eh?
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
Warrior

Re:picking a language

Post by Warrior »

PHP is a powerful language with extensive documentation on thier website. It allows for creation of dynamic pages with ease and is what most of the web portals are made with (combination of mySQL). Currently I am writing a modular Content Management System and personally am glad I used PHP.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:picking a language

Post by Solar »

Warrior wrote: PHP is a powerful language...
Enter the evangelists. 8) As if Perl documentation is hard to find. :D
Every good solution is obvious once you've found it.
cloudee1

Re:picking a language

Post by cloudee1 »

ok so mysql seems to be up and running, at least from its command line, I don't think I understand it's use in all of this or even how it interacts with anything else, should it have been placed inside apache or how does everything know where everything else is at? For instance I downloade Yabbse, I placed the file inside the htdocs folder and when I visited index it said it had no idea where mysql was at, nor could visualstudio.net.

apache seems to be up and running, is it possible to back out of the htdocs folder and say to the desktop, or does everything need to start from inside there .

I can run php scripts (from htdocs) and perl (from cgi-bin), Now is there a good IDE that makes learning the syntax of either easier, preferably Php. At this point I will probably go with learning php and accessing a database first, then step up to learning perl ;) .
srg

Re:picking a language

Post by srg »

Solar wrote:
If all you want is get quick results in web development, do PHP. If there's a chance for you to go beyond that, go Perl. If there's a chance for you to go far beyond that, use Python. (Which is more advanced and somewhat "cleaner" than Perl, but not - yet - as ubiquitous.)
I hope some of the perl nuts don't hear you say that, they seen quite fanatical to me.

BTW I thought that Perl was the best there is for string manipulation, is Python just as good? (I was thinking in dabbling in a bit of Python to see what's it's like, maybe to test out algorithms in a nice interpreted language).

srg
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:picking a language

Post by Solar »

MySQL: Check the installation docs of YABB SE, you will have to configure location, user, and password for your MySQL for YABB SE to make the connection.

IDE: Try Eclipse, which (at eclipse.org, link "community") provides plugins for just about every language, including PHP, Perl, and Python.

String handling: I haven't dabbled with Python myself, yet, but from what I've heard its string handling doesn't fall short of Perl. It's OO all the way, which means that even a string literal is a string object on which you can call member functions.
Every good solution is obvious once you've found it.
AR

Re:picking a language

Post by AR »

I personally have used python and PHP (not Perl) but I am not an expert in any of them as I have little use for interpreted languages in general at this point in time but...

Python Example:

Code: Select all

from string import split   # Import text splitting function from String module 
                  # (could "import string" if we want everything including OO structure)
SomeInput = 'This is some random text input'
Words = split(SomeInput, ' ')  # Split by the space
for w in Words:
     w += '!'
     print w
# Remember whitespace is important and the amount is significant

Code: Select all

Data = ['Value1', 78, ['Hello', 'World']]
print Data    # Print every array entry
print Data[2] # Print just the subarray's entries
print Data[2][0]  # Assuming Entry 2 in Data is an Array, print entry 0 ('Hello')

Data[2] = 'String'   # Change the array to a string
print Data
Data = 5 # Change the array to a number
print Data
That is a bit of my basic knowledge about Python, PHP feels similar to me (But remember that I don't have much experience with either)
Warrior

Re:picking a language

Post by Warrior »

I'm not saying any other language isn't powerful, I'm saying that it can get the job done in a nice efficient way and has a documentation with feedback from the actual users, not to mention how huge the PHP community is.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:picking a language

Post by Solar »

I meant no offense. But if someone asks for a weighting of alternatives, telling about how great one side is isn't helpful without comparing it to the other side.

A big problem in any discussion about favourites - languages, editors, assemblers... the best input comes from people who use both sides intensively.
Every good solution is obvious once you've found it.
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:picking a language

Post by Neo »

Solar wrote: ...people who use both sides intensively.
You mean there are people like that? ;)
Only Human
AGI1122

Re:picking a language

Post by AGI1122 »

Well I am partial to PHP myself. I use perl extensively as well, but just didn't like it as much. Havn't tried python myself though, although I do have it installed and working on my computer.

As for the YaBBSE thing, not sure why you would want to install it seeing as how it was abandoned and the team now works on replacement product called SMF which is much better.

But anyway, to get YaBBSE running, run the install.php file from the browser. If you see the content of the install.php rather than an html output when you open it from the browser or it trys to download the file, that means that php isn't installed properly.

In the installer the default server/host is called "localhost". The default mysql username is "root". The default password is blank, so just ignore that field. As for the database name, you can fill in whatever you want because it will create the database for you. Same goes with the prefix, you can put whatever you want doesn't really matter. If it has troubling connecting to the mysql database, either you filled in the wrong info, or mysql is not installed properly.

Anyway if you have any questions about YaBBSE feel free to ask, it's a specialty of mine considering I was a developer for it before it was abandoned.
Warrior

Re:picking a language

Post by Warrior »

I just made the comment because I saw other languages being talked about and I just posted my opinions and information regarding PHP :p. I expect the person to review the entire forum and then to make his comparison not just my invidividual post.
Post Reply