Re: [OT] Choosing a scripting language. - Mailing list pgsql-general
From | scott.marlowe |
---|---|
Subject | Re: [OT] Choosing a scripting language. |
Date | |
Msg-id | Pine.LNX.4.33.0310241039090.24949-100000@css120.ihs.com Whole thread Raw |
In response to | [OT] Choosing a scripting language. (Scott Chapman <scott_list@mischko.com>) |
Responses |
Re: [OT] Choosing a scripting language.
|
List | pgsql-general |
On Fri, 24 Oct 2003, Scott Chapman wrote: > On Friday 24 October 2003 01:28, Richard Huxton wrote: > > Python is very well respected, and Perl has modules to do anything you want > > and many things you don't/shouldn't/are bad for your health. > > > > You might want to look at PHP (http://www.php.net) which has a syntax which > > is quite close to what you want. > > A word of warning - it's very easy in PHP to mix your code and HTML. For > > anything but the smallest project you don't want to do this. There are lots > > of templating options, but smarty (http://smarty.php.net) is quite popular > > and flexible. > > I don't want to start a flame war on the different scripting languages > available out there, ok, but I do want to share my reasoning on scripting > languages in case it's helpful. Insightful comments are welcome! > > I looked at Python initially but the guy I was going to work for didn't like > it because it was not known to him. So I looked further. > > When I started evaluating scripting languages, PHP was becoming popular. I > decided against it because it only did web pages. I started using it around version 3.0.5 (i.e. set the way back machine Mr. Peabody...) and it already worked fine as a general purpose scripting language back then, you just had to know to compile the CGI version and use it like any other interpreter. > It also didn't have a consistent database interface > across different databases (which I understand has been fixed now). Well, it did have ODBC, which is pretty database neutral, but it's not the same as a genuine db abstraction layer like adodb. Since > then, I've bumped into documentation on Rackspace's attempt to use PHP and > their move to Python > (http://python.oreilly.com/news/python_success_stories.pdf) and felt I'd made > the right choice. Actually, having read that article now, I'm amazed at how many problems they've had. As an old C programmer, I've got the discipline need to write stuff in PHP or C and make a maintainable mound of code without the need for as much hand holding as it appeared the rackspace folks must have needed. And I've never had the issues they mention with things like lost objects, etc... Of course, we moved to PHP 4 only after it had settled down a bit. I don't generaly put .0 releases into production for much of anything. > Then I switched to Perl. Perl has CPAN which keeps you from reinventing the > wheel. It's Perl's ace in the hole. I programmed a Postgres-driven web > application over a 3-year period, in EmbPerl (because it allowed me to embed > Perl in the HTML (like PHP) - which I later learned is not such a Good Thing > but it got the job done). Perl is "mind-share king", I think, in the Linux > web space. It got the job done. I was using procedural programming mostly; > having not climbed the Object Oriented trail yet. I know Perl can do OO but > see below. I always found CPAN to be both a blessing and a bane. It's designed for a single person sitting in front of a single machine, much like Windows updates. I.e. if I've got a farm with 30 servers in it, CPAN felt like it was designed so I was supposed to sit in front of each one and download all 30 or so packages I needed on each one. There are, I'm certain, ways around that, but they never seemed very obvious to me. > I began looking for an alternative to Perl and studying OO. Python got a > second look and I decided to implement my next project in Python. It's OO > from the ground up, not having OO "bolted on" later like C -> C++. That > makes it more comfortable to program in. Agreed, although some languages seem to take to having OO bolted on better than others (i.e. PHP's OO is fairly well done, C++ is the old Dog becomes octopus after having 4 more legs stapled to it). > I also love the indentation to > differentiate code blocks rather than the junk I'd been used to seeing in > Perl and previous languages. Sorry, that was the one big turnoff for me in Python. Indentation is simple to me, I do it linux kernel style, and don't even have to pay attention to it anymore, it's just automatic for me. I guess I'm just used to doing it the old fashioned way. > It also has a very nice set of modules in it's > standard library and more out on the Net so CPAN's "ace" status is being > eroded for Perl. PHP, by the way, as it's own repository, called PEAR, that's quite nice too. > Those are my ramblings on scripting languages. Take a good look at your > options before you jump! I will, and hope you the best. Later...
pgsql-general by date: