Saturday, April 15, 2017

Python Eclipse Tips


Recently I started to play around with python, the language, not the snake.
It's a language relatively easy to pick up and get something going with.

Explanations to some of the terminologies to avoid confusion. 

  •  A Python module is simply a Python source file that expose classes, functions or global variables, whereas a Python package is a directory containing Python modules

 



Wednesday, November 7, 2012

done with clojure adventure

My all-time favorite language is kdb/q.  But we are living in a world where someday we have to deal with Java.

I was playing around with clojure in the context of interfacing with Java -- at the end of day, the only reason you want to use clojure is because you can use a functional programming language to explore the java world. Java itself is way to verbose for my taste.

First I got fed up by the painful way of calling inner class of java -- you have to use the full qualified class name, even after you imported it.

Adding jar to classpath is also a pain. You either use maven to install a local depository or have to deal with the intricacies of lein.

My favorite function "map" and "apply" doesn't work with java constructors. 

Also, when it comes to JavaFX, you'll be so fed up with the painful hurdles you have to get around to make it work...

Overall, it's a great language (it's a LISP!), however it's simply too painful when it comes to interop with Java. 

Now, I am going to explore with Scala -- which is not really pure functional but supposedly easier to interact with Java... 

Saturday, August 4, 2012

I've been experimenting with scala, clojure and haskell in the past several weeks, along the side reading lots of articles, blogs comparing these popular languages.

 To start with, I am not a big fan of OO -- I was a hardcore C++ developer since 2002 -- I read GoF book at least 3 times and actually applied them in large scale software built for trading platforms. Around 2005 when I first encounters functional programming languages, I started to realize how much boiler-plate people have to put in to work with OO. OO is one of those ideas that sound very great but offers no much practical use. It's just for lazy people to structure their code in an obvious way, instead of elegant way.

That said, scala, although has rich features from both OO and FP world, can't get away with boiler-plate code -- you have to at least declare singleton class, or object before you can even start a function definition. Also, the fact that everything is an object makes the syntax awkward some times.

 Clojure is beautiful in that it's a lisp -- almost pure functional. I have nothing to complain about the syntax because I am a big fan of lisp and emacs. However, once I have to integrate with existing java libraries, the OO junk kicks in again.

 I guess these are great languages however built on a less optimal platform. Java implemented OO in a very poor way that makes it so verbose and full of boilerplate code -- if you choose any languages built on top of JVM in the hope of leveraging existing Java code, you will have to deal with the Java junk some day.

Haskell is beautiful, however libraries are less available and installation is a pain compared to JVM based languages.