Register
It is currently Wed Aug 20, 2014 2:27 pm

PHP or Bashscript for my purpose? To BashScript Gurus


All times are UTC - 6 hours


Post new topic Reply to topic  [ 4 posts ] 
Author Message
 PostPosted: Thu Mar 18, 2010 4:36 pm   

Joined: Thu Mar 18, 2010 4:28 pm
Posts: 2
Hi Guys,

I am a VoIP integrator and work mostly with opensource software. I have been doing very basic bash scripting here and there on my Linux (CentOS 5.4) server but nothing big. All of my knowledge comes from 1 year study of C, GW-Basic, Foxpro, QBasic, (I know it's very old....year 1999) etc...programming. But I know how to use Google to solve my problems when I face it in bash script.

Right now, I am stuck as to whether chose PHP or BashScript for an upcoming large project I have. I am willing to spend a week of time or so and go over the concept and command in either of BashScript or PHP to start this project. I don't want to hire a programmer for this because I know I can do the job and because I want to know the ins and outs of it.

So, here is what I require. Please let me know which one you think is more powerful for my purpose:

I will be coding for a VoIP Billing system based on Asterisk and FreeSwitch - both run on CentOS or any distro of Linux.
1- Writing and reading from MySQL. 100s of 1000s of records.
2- Using sockets to connect to Asterisk.
3- Security is important.
4- Speed and using less resource is of atmost importance since many channels will be opened at once. 500 or so concurrent calls.
5- A front end - web management and customer portal has to be made - which of course can't be without PHP but I can get a programmer for that maybe if I am to chose bash script.
6- Easy to understand language with lots of the wheel already created if possible. PHP or BashScript?

I appreciate any feedback on this.

Thanks,
Bruce


Top
 Profile  
 PostPosted: Thu Mar 18, 2010 8:32 pm   
User avatar

Joined: Sat Jun 13, 2009 8:53 pm
Posts: 73
Location: Texas!
Absolutely not bashscript! No -- for many, many reasons -- NO!. Now that we have that out of the way, I'll discuss reasonable languages for the project.

Now, I wouldn't even recommend PHP for this. I'll try to go over it point by point:

1. Most languages will work fine for this.
2. Again, many languages will work. At this point, it's looking like Java, Python, or maybe C++ would be OK.
3. Security has almost nothing to do with the language.
4. For speed, C and C++ are the tops. These days, though, Java is really quite fast. Python, Ruby, and Perl are slower.
5. Since when do you need PHP for this? Java, Ruby, Python, Perl, also all work.
6. Easy-to-understand cancels out C++ and Perl, in my opinion. Java is fairly easy to understand, and so is Python. Both of these languages have extensive libraries and third-party packages, so there's no rebuilding the wheel.

I hope that helps. I would be glad to answer any further questions.

- thobbs


Top
 Profile  
 PostPosted: Fri Mar 19, 2010 2:32 pm   

Joined: Thu Mar 18, 2010 4:28 pm
Posts: 2
Hi,

Thanks for the input. I chose php because it can also work the front end of things and tie in with html code.

But wonder why you would give bashscript such a resounding NO? Is it going to be too slow? a resource hog? or not easy to code with mysql and openning sockets?

Thanks


Top
 Profile  
 PostPosted: Fri Mar 19, 2010 6:55 pm   
User avatar

Joined: Sat Jun 13, 2009 8:53 pm
Posts: 73
Location: Texas!
Bash is not a full-fledged programming language.
o It has no real libraries. There are no libraries to interact with databases, for instance. I have no idea about sockets because I haven't even considered doing that in bash.
o No real threading capabilities
o It is comparatively very slow
o Error handling in bash is a pain (no Exceptions, for example)
o It tends to be very awkward for many useful constructs -- arrays, for example.

Bash is just not meant to be used for higher purposes. It makes one hell of a shell, and it's easy to do a bunch of file processing with, but it's not at all a language for developing applications.

- thobbs


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP