Software. Efficiency. Scalability.

Entia non sunt multiplicanda praeter necessitatem

Agile Marketing

leave a comment »

Agile methodology is a great example of effective marketing. It stormed the market by defining itself as an anti-thesis to the Waterfall, a heavy and slow method of developing software. Even its name suggests that it’s the opposite of slow. It’s fast, it’s exciting, it’s modern. If you are not doing it you are the opposite — you are slow, boring, and you are on the other side of history K-T boundary.

As Al Ries and Jack Trout wrote in their wonderful book, marketing has nothing to do with product and everything to do with perception. In other words, it’s all bullshit.

Agile Manifesto is a great piece of marketing. It’s very common to advertise things you suck at. Think about airline commercials. Happy people with pleasant smiles enjoying a glass of champagne while comfortably sitting in a chair and chatting with a pretty flight attendant. When was the last time you had that experience on a commercial flight? Never, but that’s reality and it simply doesn’t matter in marketing, only perception does.

The reality of course, is drastically different. Ask anyone involved in the industry: what do virtually all engineers universally suck at? The answer you are going to get is simple. Estimates. Nobody can ever estimate anything correctly. Welcome Agile, methodology based on estimates, the weakest possible point of the whole darn industry.

If you are an engineer and you want to look like a super star in your standard Agile environment I can share the secret of success with you: always go for the lowest points. Low point items always get overpriced, large ticket items always get underpriced. This is the nature of engineers. They are pessimistic short term and optimistic long term. Fix that bug? Oh, that’s hard, the guy that wrote that no longer works here. Rewrite the whole product in Scala? It will take like a month! Fixing a small bug will earn you a point and take 30 min. Implementing a new module will take you 30 points and take 2 weeks. You do the math. I hope they still teach math.

Of course, nothing fun can last forever. K-T boundary was the end for the dinosaurs and Marlboro Man got lung cancer. The question becomes where to go next. If I were to bet a dollar I would go with Kanban. I mean, it worked for Toyota car manufacturing, a totally unrelated industry revolving around manual labor. It also uses colorful PostIt notes! I can’t see what can possibly go wrong.

Written by Mikhail Opletayev

January 28, 2014 at 2:29 am

Posted in process

Tagged with ,

Sample TPL Monad

leave a comment »

Following up on Monads in F#, here is a small example of a basic monad.

F# comes in with built-in support for asynchronous workflows (remember, M-word is prohibited at MSFT) and it has robust support for both async<‘a> and Task<T> continuations. This is just a small example meant to show how easy it is to create your own continuation workflows in F#.

Let’s create a simple monad based on TPL Task<T> primitive:

type TPLBuilder() =
    member this.Bind(x:Task<'a>, f:'a -> Task<'b>) =
        x.ContinueWith((fun (t:Task<'a>) -> f t.Result), TaskContinuationOptions.OnlyOnRanToCompletion).Unwrap()
    member this.Return(x) =  Task.FromResult(x)
    member this.ReturnFrom(x) = x
    member this.Zero() = Task.FromResult()
    member this.Combine(a, b) = this.Bind(a, b)
    member this.Delay f = f
    member this.Run f = f()

let tpl = new TPLBuilder()

As you can see, the monad is quite simple. One trick I had to use is calling the Unwrap method. Removing the call illustrates the issue: continuation returns Task<Task<T>> and we want Task<T>. This is exactly what Unwrap does.

type TPLBuilder() =
    member this.Bind(x:Task<'a>, f:'a -> Task<'b>) =
        x.ContinueWith((fun (t:Task<'a>) -> f t.Result), TaskContinuationOptions.OnlyOnRanToCompletion).Unwrap()

Here is a quick sample on how such monad can be used. Let’s say we want to download two webpages asynchronously, compare the size of the pages, and execute another asynchronous download based on the results. This monad makes it easy:

let tc = tpl {
        let wc = new System.Net.WebClient()
        let! data1 = wc.DownloadStringTaskAsync("http://abc.com")
        let! data2 = wc.DownloadStringTaskAsync("http://news.net")
        let! l = if data1.Length < data2.Length then
                    printfn "Fetching Microsoft.com"
                    tpl {
                            let! data3 = wc.DownloadStringTaskAsync("http://microsoft.com")
                            return data3.Length
                    }
                 else
                    printfn "Fetching Apple.com"
                    tpl {
                        let! data3 = wc.DownloadStringTaskAsync("http://apple.com")
                        return data3.Length
                    }
        return data1.Length + data2.Length + l
    }
    tc.Wait()
    printfn "%d" tc.Result

Of course, this is a very simplistic example. For this to be fully functional we’d need to add try..catch, we’d need to be able to execute multiple tasks in parallel and wait for the aggregate result, etc.

Luckily, there is a built-in  async monad that supports for all of this!

Written by Mikhail Opletayev

August 27, 2013 at 3:05 pm

Anatomy Of The Perfect Interview

leave a comment »

A good article on what’s going into hiring a good engineer.

http://firstround.com/article/The-anatomy-of-the-perfect-technical-interview-from-a-former-Amazon-VP

One thing hiring managers often forget is that interviews are a double-edged sword. Yes, you are getting to learn the candidate and understand their capabilities and whether they will be a good fit for your company. On the other hand, a good candidate will also evaluate your company based on who’s present, what kind of questions you ask, how you conduct the process.

Good candidates often times have more than one opportunity and possibly multiple offers. Interview is a perfect (and sometimes only) opportunity to sell them on joining your company.

Written by Mikhail Opletayev

August 21, 2013 at 9:37 pm

Posted in interviews

Monads in F#

with one comment

Ah, the forbidden M-word. I am fairly sure it’s official Microsoft policy to never use the M-word ever.

Of course, monads are extremely useful and used all over the place in .NET. LINQ, for instance, makes a great use of the list monad by the virtue of the Enumerable.SelectMany method, which is a monadic bind.

For those of us who don’t want to delve into the dark depths of category theory, here is a excellent overview of monads computation expressions in F#:

http://fsharpforfunandprofit.com/series/computation-expressions.html

It’s well written, easy to understand, and covers computation expressions much better than the somber MSDN page:

http://msdn.microsoft.com/en-us/library/dd233182.aspx

Written by Mikhail Opletayev

July 25, 2013 at 9:48 pm

Posted in development

Tagged with , ,

Simple Made Easy

leave a comment »

An outstanding presentation on what “easy” means and what “complex” means by Rich Hickley, the author of Clojure.

If you are somehow related to the software development it will be absolutely worth your time to watch it.

http://www.infoq.com/presentations/Simple-Made-Easy

Written by Mikhail Opletayev

October 31, 2011 at 5:58 pm

Posted in Uncategorized

Tagged with ,

Follow

Get every new post delivered to your Inbox.