Featured post

Fixed Income Trading: New venues

A simple question came up recently in a conversation – how many new Fixed Income trading venues are there?  I could not think of anywhere th...

Monday, 23 February 2015

Python versus VBScript

A diversion from the normal discourse on here, a language comparison.
Disclosure:  I have been using VBScript for years, I have designed a couple of systems that embedded the VBScript.ocx into a three-tier architecture system to provide an extensible method for creating business logic. 


 
So I am pretty comfortable with VBS.  Python is a language I have dabbled with in the past and am reviewing for a project at the moment.  Let's look at five areas.  One point for a clear capability, half a point for something less than expected and zero if it's no good.  Let's fight!
Portability
VBScript is pretty much Windows only.  Python runs on Windows, Linux, Mac, AS/400, BeOS, VMS, Solaris and more. Clear win for Python. 
 
Python 1 VBScript 0

Tools
I have always used notepad for VBScript.  There's an interesting Stackoverflow thread on this topic.  For Python on Windows I have been using Python Tools for Visual Studio (PTVS).  Although many folks criticise Microsoft, I still think they can make a decent IDE - one IDE which I use for Python, Node.js, C#, F#

So, even though VBScript is a Microsoft tool, there is poor support in VS2013.  Again, the ever useful Stackoverflow has some advice on configuring VS2013 to use cscript.exe.
 

Python 2 VBScript 0

 
Extensibility
If you are willing to use external packages then Python has a load of them at PyPI.  VBScript has a great set of example code for database access using ADO (so pretty much anything with an ODBC driver will work ok) but is pretty light (completely missing on anything in the NoSQL/NewSQL world). VBScript will allow access to COM objects and via Interop to .net components.
 
Python 3 VBScript 0.5
 
Language
I have used R, js, vbs, vb6, C#, S+, PL/SQL, TSQL, TCL, bash, csh, cmd scripts and probably other things I have forgot.  Python has a nice clean look and feel, it's easy to read.  The only gotcha is the indentation rather than {} style but that is something you can get used to over time.  VBS is a little cleaner in terms of no {} needed since there is use of "if..else...endif" and blocks are ended by the use of the "end" keyword.
 
Python 4 VBScript 1.5
 
Future
Microsoft appears to be moving all of the code examples that were in VBScript over to PowerShell. Yet the process of replacing VBScript to Powershell is somewhat problematic or simple. Which is not terribly helpful. 
 
Python on the other hand has a thriving user community and seems to be on the up.
 
Python 5 VBScript 1.5
 
Conclusion
With an overall score of Python 5 VBScript 1.5 there's a pretty clear winner.  If you have experience with VBScript and are happy to continue using it then go ahead.  But if you are looking to broaden out your skillset, why not look to Python - it has better tooling, a better future and a bigger user community.
 
Left field idea 
How hard would it be to take the ideas behind Emscripten and then apply them to switch between VBScript and Python? Or use Varycode?

 

2 comments:

  1. You've convinced me at least! Time to leave the past behind and strap on those training wheels again...

    ReplyDelete
    Replies
    1. Best of luck on your learning journey!

      Delete