Blog about sofware development

Something should be here

Scala Workshop - Day 1, Parsers

Let’s continue on WAAS (workflow-as-a-service). In this post I’m going to show how to use parsers combinators to parse our workflow definitions.

Have a look at sample workflow definition file we’re going to parse. It contains 2 worflow definitions – one for issue tracking system and other for deals.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
workflow issue {
  start state open
                 goes to started;
  state started  goes to open, resolved;
  state resolved goes to closed, open;
  state closed;
};

workflow project {
  start state negotiation
               goes to signed, failed;
  state signed goes to failed, done;
  state done   goes to paid, failed;
  state paid;
  state failed;
};

At the end of this post we’re going to have a parser, which transforms textual definitions to our internal model, ready for persistense.

Scala Workshop - Day 0

I love Scala. It’s combines goodies from JVM and Java infrastructure, Haskell and dynamic languages like Ruby – and it almost doesn’t inherit Java programming language deceases.

Anyway, I always wanted to create some end-to-end project using Scala technologies – but never did as I’m working with completely different technology set. So, I decided to come up with some fake business idea and implement it. I’m going to use interesting libraries like Akka and Scalaz in that task, God help me! I’m going to describe things step by step so people with no experience in Scala can pick it up and proceed with me.

Here are things I want to try in this project:

  • Scala parser combinators
  • Explicit error handling with Scalaz
  • MongoDB with Casbah
  • Functional dependency injection via implicit parameters
  • Properties checking with ScalaCheck
  • Concurrency with Akka actors
  • RIA with Play2 or Lift or JS/Scalatra – yet to decide

I’m also going to focus more on functional side of Scala as I see it.

More Slides

Here are my slides from presentation I gave to local JUG – introduction to Scala

Heart of a Functional Programming

Intro

Every functional programmer should write an article about what FP is at all and I’m not an exception. Next step should be another monad tutorial – and it’s still on it’s way.

Introduction to functional programming

So, what is functional programming at all? Actually, there’s a lot of mess about that – functional programming, functional language, functional features are different things, even if these terms are sometimes confused one with another. For example, I even heard that JavaScript is a functional language as it’s allows passing functions as parameters:

example.jsWikipedia
1
2
3
4
5
6
7
8
9
10
11
12
13
function ArrayForEach(array, func) {
  for (var i = 0; i < array.length; i++) {
    if (i in array) {
      func(array[i]);
    }
  }
}

function log(msg) {
  console.log(msg);
}

ArrayForEach([1,2,3,4,5], log);

So, let’s put a couple of definition:

  • Functional language is a programming language which enables, encourages or even enforces functional programming.
  • Functional features are features of a programming language or a library, which makes functional programming easier
  • Functional programming is… well, let’s talk about that below

A functional language as a tool use functional features to make using functional programming as a paradigm easier; and we can use those definitions to determine if some programming language is a functional language or not. Whew, enough of F-word :)

But we have one more definition to fill up – functional programming or functional paradigm (FP). This is done by contrast usually and I will follow that path, but with one small deviation. Usually FP is being compared to imperative programming whatever it means. Also is being said that FP and OOP are orthogonal and don’t deny each other. I’m going to argue with that. So, before going to FP lang, let’s see what we have in OOP.

Presentations

I want to share two presentations I gave to my coworkers. They cover concepts I’m actively learning right now – Domain Driven Design, Command-Query Responsibility Separation and Event Sourcing. Funny, but when talking about DDD I didn’t manage to make it within one hour; so it gave me good insight about technical presentations – it’s not about what you’re going to add to your talk, it’s about what your going to remove from it to focus only on things that matter – and let the listeners to find out about things you’ve skipped on their own.

If you see mistakes in those slides, please let me know – I’m still learning and willing to know if I understand something wrong.



Hello, World!

Let me introduce myself.

My name is Yuriy, I live in Lviv, Ukraine, and I’m a software developer.

I’ve tried to pick up a title for me for a while and I didn’t come with anything better than ‘software developer’ – I don’t want to tie myself to things like ‘coder’, ‘tech lead’, ‘scrum master’ or anything similar – still I was in all that shoes in my career.

My first commercial job was a Perl coder in 2004 in small outsourcing company in Ternopil, Ukraine. From there I’ve switched to Java and now to Ruby development. Still, that’s not a thing I’m really proud about and which I want to share.

I would like to write in this blog about modern tools and languages – especially languages, as I consider learning new programming language as the most exiting part of a software development. I hope to write about Scala, Ruby, Haskell – but not limited to ones. Also I’m interested about bigger things – as long as they are still technical. That said, I hope to cover software architecture and system architecture in my posts.

I don’t consider this blog as a place for me to share my personal things. I don’t think people that came here to read about, say, Scala, would care how did I spend my weekends – did I go caving or skiing or mountain tracking (still this is a usual way for me to spend a weekend). So don’t be afraid to add it to your RSS reader – no porn, no kitties, no photos with my family. Only software development, only hardcore.
And the last thing I’m going to write about in this post is to answer a question – why do I want to have this blog in a first place? Answer is simple – writing about things helps to organize you minds and knowledge about that things. Of course, knowing that the blog is useful to someone would be a great encouragement.

So now lets click Publish – and see what happens next. I hope it will be something exciting :)