Do We Want To Merge Language Features or Have Separate Languages?

I do not think of Python or Java as functional languages, and I have written a medium-sized project in Python and sustained the configuration application for Vinca’s old CoStandbyForWindows.  Haskell is labelled a pure functional language, and the word pure is sometimes used as if Haskell were organic food. Yet, both Python and Java  (and perhaps other languages) seem to be caught up in the new functional craze. I am basing my theory on seeing a lot of new books cropping up, while looking for a good algorithm descriptive meta language.

Using Clojure on three small projects taught me that I had to re-orient my mind radically for Clojure’s almost pure functional approach versus the traditional C/Java/VB modifiable, iterative loop approach. For example, you’ve received two water bills with estimated reads. Finally, you get an electronic endpoint associated with your account and/or get a verified meter read into the water department. You have -170 ccfs to credit across two, successive, estimated 100ccf bills. The bills are calculated by binning consumption into three tiers, 0-30ccf, 31-60ccf, and 61+ccfs. When the account is credited, the credit has to be applied starting at the highest tier at which the original bill was generated.

The code I had to re-write was written in Informix 4GL, definitely an imperative language. How I would model this algorithm functionally would be an interesting exercise. Is it worth it to provide 4GL with functional extensions to the language? The program runs in a single process, and works against a database — Informix SE — that itself is protected by and supports synchronization primitives.

Now, I see there are types being added to Clojure. I cannot comment, having never worked on a large symmetrical multi-processing team responsible for a social media site or similarly complex project. I can understand why ascertaining the correct type is important. Are adding functional features to Java going to make the language better or people want to implement in it more?

I remember when Java was introduced, and a programmer allocating memory was not a good thing. C++ chugged right along, and C was almost universally adopted for device driver work, at least on Windows. Those languages are still being used, and there is a lot of useful Java code out there; at least the companies that paid for that code think so.

When I started out programming, there were a lot of programming languages, used for different reasons. Right now, we use Perl a lot, because it is fairly and widely known, there are a lot of packages, and it plays well on our back-end web servers. It also integrates nicely into our low-use (compared to commercial sites) web sites along with PHP and Javascript. And yet, other than turning on useful warnings in Perl — I’m not smart enough to find out why a variable wasn’t initialized because it was not declared — there seems to be striving for purity there, but I’m not sure what kind.

The best I can do is keep reading what is out there, whether I agree or not, lest I be lost in the swirl of the latest attempt of the holy grail of never having a program encounter errors.







Leave a comment

Filed under Programming

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s