To func, or not to func: that is the question.

Pim Brouwers on September 14, 2018

UPDATE: I elected to learn F#. What follows is me talking out loud, whilst also seeking advice, in an attempt to resolve what my next learning... [Read Full]
markdown guide
 

Interesting choices! I love getting the opportunity to tinker with new languages.

Regarding Go (my favorite language), here are a few bullet thoughts regarding your case bullets:

  • agreed on the obtuse management - personally, it's never been a huge problem but I understand the issue
  • the Go community is actively developing the language while also being very deliberate on introducing too many features (simplicity which I appreciate!)
  • and yes, the ever-present if err != nil { ... } and interface implementation get verbose : )

Personally, I've found the community and documentation to be immensely knowledgeable and very open to building and explaining simple solutions implemented with the language for what it's worth.

 

This really struck a chord with me. Especially as a data scientist, I would've figured you'd be functional all the way. Or at least heavily vested in python.

Have you found the type system in Go to be rich enough to do what you need it to?

 

So (for context), I work professionally as a data scientist/software engineer and my team (a small startup) primarily utilizes Java and Python for the broad majority of our codebase; the current team prefers Python and we're gradually writing more of our code in that vein as a machine learning shop. I've only poked at OCaml once as far as functional programming goes, but I'm interested in learning more about that paradigm. In my personal side projects, I pretty much exclusively use Go, even for machine learning stuff. Given the size of my team at work, I might start sneaking in some Go into my work assignments too. ; )

As for the type system question: absolutely. It sticks to the mantra of less is more which for me encourages me to spend a lot of time thinking about what data I need and what it will look like. The struct object in particular coupled with interface really "visualizes" the data structures within the program for me.

Right now, I still feel like Python is the top language for machine learning/data science given the library support and community, but I'm personally expecting Go to begin factoring in more heavily with the support from Google in projects like TensorFlow.

Interesting! I work as a data engineer, with strong emphasis on ETL and API implementations using primarily SQL Server and C#. Those two tools have been invaluable in making my job easier, and I enjoy using them for the most part. From a side project perspective though, they pose some limitations, SQL Server especially.

In what way do they limit side projects? Out of curiosity/my own edification.

P.S. I have a buddy that comes from a C# background and I'll see if I can get him to add his two cents to this discussion.

My apologies, I had intended on being more specific to SQL Server in my final comment. It's limitation being the cost of a license for a production level system. Don't get me wrong SQL Express is a fine platform, but isn't really suitable for a production workload due to it's memory and cpu restrictions.

 

Not so sure if skip over Python so quickly.

You can implement functional programming with it.

Many of the things that Go has so does python. If you want something fast checkout Cython. Also large base of users and documentation everywhere. I hate the whitespace enforcement though.

Although Go sounds fun, and I've told around the idea of learning it. F# never appealed to me for some reason, I think mostly due to the fact it's not widely used.

Good luck on whatever you learn next.

 

Thanks for the feedback Nick. Much appreciated!

I do see the value in Python for sure. It's a joy to write. But the fact that it's so difficult to do things asynchronously and make performant, has always turned me away.

By the sounds of your response, you have some experience with it? What's it been like for you at scale?

 

Couldn't agree more about the asynchronous limitations of Python. That's always been one of my dislikes about it as well.

We actually used a Windows service to kick off python tasks for doing large geoprocessing jobs. Spatial selection and queries and then an ETL of that data out to different formats. That was the workaround for doing things without worrying about doing things in an asynchronous fashion, we'd just kick off more tasks. On a server with 64 cores, this never seemed to be much of an issue. One thing though, that I noticed was that the loose or dynamic typing caused problems sometimes when a developer would work on something, and then their changes would break something down the subprocess. Python on large projects without testing is painful.

 

If you hate whitespace, try bython. I think that's the point more than the recommendation, as far as I can tell python has an enormous following. It can do many things and be whatever you want it to be. This coming from someone who hasn't wrote a line of python but my sights are on it at the moment.

 

Go draws heavily from scripting languages for some of it's syntax (slices come to mind as a perfect example), so it's more like Go has a lot of the features of Python.

 

I also went through a similar Journey. I wanted to learn a newer programming language as I think there is a lot of value in the innovations that the new languages offer. I was looking at Go vs Elixir. I'm also interested in concurrency and distributed systems. Go touts channels while Elixir is built on top of Erlangs OTP framework and the BEAM Virtual Machine which is based on The Actor Model.

Elixir is also a functional paradigm language and I have been trying to master thinking in the functional paradigm using JavaScript and Scala.

I was a little sad when you mentioned you may not be cut out for the functional line of thinking because it has made me such a better programmer - even in the object paradigm in Java.

There is too much to learn. You will pick a language and another one will come out. M.I.T. just released Julia. That's why I decided a few years ago I was going to stick with mastering the fundamentals. Learn about application architecture, OOP design, and the things that you can apply across any language. It has served me well so far, and enables me to learn new languages at an accelerated rate.

I ended up picking Elixir because I aim to master the functional paradigm. It's got immutable state built in, and pattern matching on function signatures will change your life! (Maybe F# can do this, I don't know).

The foundations under Elixir route the majority of all internet traffic (erlang and it's VM, the BEAM) so it has a proven history at scale, and I feel like the actor model more succicntly models reality than channels, so that is very interesting to me.

The philosophy behind Elixir is one of developer friendliness, productivity and it has a passionate open source community. The language spans domains from web applications, to embedded software (IoT).

Since I've made the decision, I have really enjoyed using it. Programming has become fun again :)

Anyways, my advice would be find the cross section between what you find interesting and what the language can be a vehicle for you to study the fundamentals underneath it. Then you can't really lose.

Cheers and good luck!

 

I think all three languages you are considering each have a lot to offer. I do not think you can make a bad choice here.

If you opt for F#, I highly recommend The Book of F#, by Dave Fancher. (I found it to be far superior to the other F# books I read.) nostarch.com/fsharp

 

I presume your experience is in C#.

I think a dynamic language like Python will enlarge your programming skills, it also has a FP "feeling".

If you want to go one level lower, at system level, to build fast systems, databases, LB and such Go would be more appropriate.

 

I think of Go as more comparable to languages like C, C++, or Rust.

Python I’d compare with JavaScript, Ruby, Perl, Php.

Of course you can do some fairly high performance programming in Python, particularly if you’re using a library like numpy, which is C behind the scenes.

However I think of Python as a general purpose language whose focus is more on I/O bound use cases. And you can surely do that kind of programming in Go too, but my guess is that Python would be a better choice in that case.

 

I think you should pursue go. Functional programming's major benefit is to be parallel threaded, and go is designed around parallel processing with co_routines. Beyond this go is I think more marketable than something like f#, so it will be more pragmatic for you. Also, It has a robust community to build off of which can help you get a head start. You could also delve into python, but I think if your goal is to really learn functional programming and learn something practical with some familiarity go is the way to ...go

 

Where should Pim go next?

Try a Lisp - either Common Lisp or Racket. You will be amazed. :-)

 

Thanks for the suggestion! Reviewing this at a high level I can already tell I am certainly not equipped to go down this road haha!

 
 
 

I elected to learn Go and it has delivered on all promises. It's productive, easy to reason about, fast and most importantly reignited my love for programming. Thanks to everyone for the feedback.

 

Consider JavaScript. It runs everywhere and it's very flexible. Have a peek at how I am currently writing JavaScript in a functional way. github.com/joelnet/MojiScript

 
code of conduct - report abuse