In the weekly newsletter from TheServerSide.NET, there was a link to an article titled “REST versus SOAP – the REST story” by William Brogden.  It’s a few months old, but talk about the recent rise in REST types of services over XML-RPC and SOAP.   Brogden briefly covers REST, but he doesn’t talk about the advantages of REST and why you would ever want to use it over SOAP.  It’s obvious that he prefers SOAP, but the reasoning was left out of the article.

Having done SOAP and REST for accessing web services, I can see the where it’s advantageous to use SOAP as opposed to REST (or vice versa).  SOAP is very chatty, but you can send complex data structures to the web service.  Development tools like Visual Studio or Delphi can can read the WSDL from the web service and that gives you the “intellisense” autocompletion functionality that can save a lot of coding time.

With REST, you access the web service with just the basic HTTP GET and PUT commands.  You compose a URL for your web method request and the service sends back a response.  The response is usually in XML, but that is dependant on the functionality of the web service.

The drawback with SOAP is that there is more overhead in the construction of the method request and with the parsing of the request on the web service end.  When you have a web service that is serving thousands of requests a minute or second, that overheard may not be needed.

For web services that have relatively simple data types, using REST can provide the functionality that is needed.  You also get the advantage of testing individual method requests from a browser as the method request is basic URL. 

Blast from the past: Forth

I came across a link an online version to Leo Brodie’s Forth tutorial, “Starting Forth” today.  I used to have a copy of that book eons ago.  I learned how to program on a Commodore VIC-20 and I bought (actually had to special order it) a Forth language cartridge.  This book has been out of print for decades, the online version is probably the only way to read it now.

Forth is an arcane language that allows you to program in interactive and iterative manner.   You would create words (what other languages would call functions or subroutines) from the language core keywords and created new words from existing words.

The operators worked in post-fix notation (aka reverse Polish notation) like the older HP calculators.  The language was stack oriented and post-fix works well when you are pulling items off the stack.

Since Forth programs were very small in size and typically do not access or require a traditional file system, Forth was used in embedded controllers and other hardware related projects.  NASA uses Forth to this day for spacecraft flight system controllers and other projects.

Needless to say Forth and the VIC-20 were not the best fit and I never did too much with it.  I wonder how many geek points do you get for programming in Forth on 5K (but only 3.5k were usable) machine that had a whopping 22 columns of text per line?