|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Which language is best suited..
I have an idea for a website which will rank things in a way smiilar to imdb.com. There will be a lot of individual items to be ranked by the users of the site, by choosing the better of two randomly selected objects. Also, new items would be added through some sort of admin control panel. I have taken an introductory C++ course, and it seems that perl is the easiest to learn from there. The easiest way I can think of doing it is to use perl to write text files with the data of each object, and perhaps a master list of some sort, although, this is just an idea at the moment. First of all, is this possible to do if there are multiple users on the site and at some point two webpages try to write to the same file at the same time. Or would another language be better, such as php, or any others. I know practically nothing about databases, but if that would be the easiest way to implement it, I would consider that.
Thanks for your input. |
|
#2
|
||||
|
||||
|
IMDB runs mod_perl, which is perl embedded in the apache server. It is undoubtedly backed with a database.
With mod_perl you can easily write applications as fast as, and often faster than, PHP. With mod_perl you also have the largest base of quality free code available to you via www.cpan.org Perl is generally considered a more mature language with stabler interfaces than PHP. Perl or PHP would be good choices, though perl is a little better if you're a control freak. mod_perl is incredible. The way it integrates with apache is crazy- you can turn apache into your own custom application server via mod_perl. Many large sites are actually a mix of different things implemented in different languages. I'd say pick whichever language that interests you the most and learn it to the level where you're coding non-trivial apps in it, and then learn another. |
|
#3
|
||||
|
||||
|
Thank-you, my followup question is it possible to use text files (ie CSV files) for my information. Potentially there could be two users ranking the same object, would the server be smart enough to wait until one user was finished, before it tired to write a second time. I realize it wouldn't take very long as at most 3 or 4 small values would be changed in the file, but I'm not sure how it would work. My understanding is that perl can read and write files, and with some configuration of the server, they can only be read/written by the perl script or admin. Also what advantage would mysql have over this type of system? Would it be faster or easier to work with? Reason being, as I said before, I know very little about it and it would take some time for me to learn how to use it. Thanks again for the help.
Last edited by Nuclear_Fr0g : July 31st, 2003 at 02:43 PM. |
|
#4
|
||||
|
||||
|
It it MUCH easier to work with databases rather than flat files (aka text files) when you have to deal with concurrent users. File locking is trickier than it seems, and some operating systems don't support it. Databases will take care of a lot of locking issues for you transparently.
Databases are also superior when it comes to reporting and access control. Flat files (unless you use a wrapper like DBD::CSV in perl) are very tedious to work with once you've learned databases. I suggest, as part of your learning, that you create a minor application that uses flatfiles. Then learn how to use databases and revisit what you did. It'll surprise you how much time you save in development by not using flat files. As to whether or not MySQL would be faster than flat files, there is no general answer. It depends on the data, what you're doing and how it's coded. As far as if it's faster to develop reliable code with databases rather than flat files, the answer has to be "yes". |
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > Which language is best suited.. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|