<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Braintrace.ru</title>
        <link>http://braintrace.ru</link>
        <description><![CDATA[Random thoughts about software development.]]></description>
        <atom:link href="http://braintrace.ru/rss.xml" rel="self"
                   type="application/rss+xml" />
        <lastBuildDate>Tue, 09 Aug 2011 00:00:00 UT</lastBuildDate>
        <item>
    <title>ScalaTypes podcast</title>
    <link>http://braintrace.ru/posts/2011-08-09-scalatypes-podcast.html</link>
    <description><![CDATA[<p>I usually doesn’t listen podcasts but have done an exception for <a href="http://scalatypes.com/">ScalaTypes</a> — podcast about Scala and ecosystem around it.</p>
<p>Well… they talk not too much about Scala or even about topics related to Scala. So I don’t recommend this podcast for ones who wants solid and concentrated insights on the topic :-).</p>
<p>Regarding last episode. It was an interview with <a href="http://www.heathercmiller.net/">Heather Miller</a>, she’s stated to be “New Documentation Czar” — she’s now ruling an effort to provide more solid and more deep covered documentation for Scala programming language. And again I’m surprised — they didn’t even mention <a href="http://sphinx.pocoo.org/">Sphinx</a>, the current state-of-art of documentation tools, which is sad… I really wish Scala language and its standard library be documented with the use of Sphinx.</p>]]></description>
    <pubDate>Tue, 09 Aug 2011 00:00:00 UT</pubDate>
    <guid>http://braintrace.ru/posts/2011-08-09-scalatypes-podcast.html</guid>
</item>
<item>
    <title>Reading slides on client side technologies...</title>
    <link>http://braintrace.ru/posts/2011-08-06-reading-slides-on-js.html</link>
    <description><![CDATA[<p>Reading slides on <a href="http://addyosmani.com/toolsforjqueryapparchitecture/">“Tools For jQuery Application Architecture”</a>:</p>
<ul>
<li>MVC &amp; MVVM architecture patterns for client-side development… ok</li>
<li>Design patterns for JavaScript applications… ok</li>
<li>Dependency management… ok</li>
<li>JavaScript templating… ok</li>
<li>Cross-browser persistent storage… ok</li>
<li>Feature detection… ok</li>
<li>Widgets &amp; Component libraries… ok</li>
<li>Unit Testing &amp; testing environments… ok</li>
<li>Build Processes, concatenation and minification… Ant.. wtf?!</li>
</ul>
<p>So how such a piece of shit as Ant is happened to be used there… no excuse.</p>]]></description>
    <pubDate>Sat, 06 Aug 2011 00:00:00 UT</pubDate>
    <guid>http://braintrace.ru/posts/2011-08-06-reading-slides-on-js.html</guid>
</item>
<item>
    <title>Learning Python</title>
    <link>http://braintrace.ru/posts/2011-07-08-learning-python.html</link>
    <description><![CDATA[<p>Python is actually pretty good, simple and useful programming language. It has a fairly gently learning curve, thanks to excellent documentation.</p>
<p>For the novice wishing to adopt Python in least possible time and quickly become productive I would recommend the following steps:</p>
<h2 id="tutorial">Tutorial</h2>
<p><a href="http://docs.python.org/tutorial/index.html">Tutorial</a> given in Python docs is very good, you should just give a brief look at it if not reading it completely — it has many practical examples, which helps a lot to make a sense what the beast Python is.</p>
<h2 id="language-reference">Language reference</h2>
<p>Sections 1 - 4 from <a href="http://docs.python.org/reference/index.html">The Python Language Reference</a>. Section 3. <a href="http://docs.python.org/reference/datamodel.html">Data Model</a> is the most important one here. It gives a broad overview of how Python data types interacts with each other. Other sections can be read as needed — Python syntactical constructs are usually make sense from their analogues in other languages. <a href="http://docs.python.org/reference/simple_stmts.html#the-yield-statement">Yield</a> and <a href="http://docs.python.org/reference/compound_stmts.html#the-with-statement">with</a> are the exceptions.</p>
<h2 id="standard-library-documentation">Standard library documentation</h2>
<p>Python stdlib is the cause this language is so productive and popular. Read sections 1–5 from <a href="http://docs.python.org/library/index.html">The Python Standard Library</a> docs and keep an eye on a list of stdlib’s modules.</p>
<h2 id="common-tips">Common tips</h2>
<p>A list of common tips at last:</p>
<ul>
<li><p>Use Python 2.x (where x is 2.6 or 2.7)— it’s still deployed much widely than Python 3.x.</p></li>
<li><p>Follow <a href="http://www.python.org/dev/peps/pep-0008/">PEP–8</a> styleguide, never step away from it!</p></li>
<li><p>Defining class always subclass from <code>object</code> (assuming you’re using Python 2.x).</p></li>
<li><p>Never write <code>from somemodule import *</code>.</p></li>
<li><p>Always use <a href="http://pypi.python.org/pypi/virtualenv">virtualenv</a> for developing with Python. It’s a tool for creating isolated Python environments.</p></li>
<li><p><a href="http://pypi.python.org/pypi">PyPi</a>, The Python Package Index helps you to find any Python library you wish. Just use <code>easy_install</code> or <code>pip</code> command for installing from there.</p></li>
</ul>
<p>The end.</p>]]></description>
    <pubDate>Fri, 08 Jul 2011 00:00:00 UT</pubDate>
    <guid>http://braintrace.ru/posts/2011-07-08-learning-python.html</guid>
</item>
<item>
    <title>Who cares about zope?</title>
    <link>http://braintrace.ru/posts/2011-06-08-who-cares-about-zope.html</link>
    <description><![CDATA[<p>There’s excellent <a href="http://reinout.vanrees.org/weblog/2011/06/07/zope.html">overview</a> and comments on <a href="http://faassen.n--tree.net/blog">Martijn Faassen</a> djangocon.eu <a href="http://djangocon.eu/talks/44/">keynote</a> about Zope and Django — what the former could learn from the first one and so on.</p>
<p>Personally, I think Zope is excellent project which gave raise to the current state of the art of pythonic web frameworks — <a href="http://pylonsproject.org/">Pyramid</a>.</p>
<p>Don’t miss the links at the end of the article to projects which also (as Pyramid and Zope do) implement object publishing via URL traversal — <a href="http://www.fanstatic.org/en/latest/index.html">Fantastic</a> and <a href="http://pypi.python.org/pypi/traject">traject</a>.</p>]]></description>
    <pubDate>Wed, 08 Jun 2011 00:00:00 UT</pubDate>
    <guid>http://braintrace.ru/posts/2011-06-08-who-cares-about-zope.html</guid>
</item>
<item>
    <title>Why do Erlang need modules</title>
    <link>http://braintrace.ru/posts/2011-05-24-why-do-erlang-need-modules.html</link>
    <description><![CDATA[<p>Interesting <a href="http://erlang.org/pipermail/erlang-questions/2011-May/058769.html">discussion</a> popped up on <em>erlang-questions</em> mail list — <em>“Why do we need modules at all?”</em>. There’s also <a href="http://news.ycombinator.com/item?id=2580383">comments</a> on hacker news.</p>
<p>The points are:</p>
<ul>
<li><p>Why do we have to use module structure that reflects filesystem layout?</p></li>
<li><p>Let’s better have database with plain functions and query it by some associated metadata fields.</p></li>
</ul>
<p>This leads me think about <a href="http://en.wikipedia.org/wiki/Smalltalk">Smalltalk</a> programming language and how it manages source code — runtime image is really a database with classes and associated methods.</p>]]></description>
    <pubDate>Tue, 24 May 2011 00:00:00 UT</pubDate>
    <guid>http://braintrace.ru/posts/2011-05-24-why-do-erlang-need-modules.html</guid>
</item>
<item>
    <title>Flipboard iPad app</title>
    <link>http://braintrace.ru/posts/2011-05-14-flipboard-app.html</link>
    <description><![CDATA[<p>Last few weeks, I’m reading Twitter, Facebook and Google Reader exclusively on iPad, thanks to excellent <a href="http://flipboard.com/">Flipboard</a> app. It makes reading social feeds a real pleasure — images and videos are embedded into the great looking magazine-style layout.</p>
<p>But how it works:</p>
<ul>
<li><p>Does it use some ranking algorithm for presenting content?</p></li>
<li><p>What algorithm it uses for composing layout?</p></li>
</ul>
<p>Interesting…</p>]]></description>
    <pubDate>Sat, 14 May 2011 00:00:00 UT</pubDate>
    <guid>http://braintrace.ru/posts/2011-05-14-flipboard-app.html</guid>
</item>
<item>
    <title>Implementation of EIP in Erlang, part 1: Idea</title>
    <link>http://braintrace.ru/posts/2011-05-01-project-idea-eip-in-erlang-pt-1.html</link>
    <description><![CDATA[<p>The idea of <a href="http://www.eaipatterns.com/">EIP</a> (enterprise integration patterns) is pretty simple and useful — it’s just a list of recipes and common behaviours for messaging with a strong bias towards integration needs.</p>
<p>There’re primitive patterns (they act as building blocks), some of them are:</p>
<ul>
<li><p><em>Exchange</em> — encapsulates a single piece of communication, it can has synchronous or asynchronous semantics.</p></li>
<li><p><em>Message</em> — a piece of data which represents some event or command.</p></li>
<li><p><em>Channel</em> — a route for <em>exchanges</em>.</p></li>
<li><p><em>Message processor</em> — its name says all about what it does.</p></li>
<li><p><em>Filter</em> — filters messages by some predicate.</p></li>
</ul>
<p>Some more complex ones are:</p>
<ul>
<li><p><em>Message router</em> — routes different messages to different channels.</p></li>
<li><p><em>Aggregator</em> — aggregates a some (defined via predicate) set of messages and processes it as a single message.</p></li>
<li><p><em>Recipient list</em> — provides multicast mechanism.</p></li>
</ul>
<p>If you’re interested in full list of patterns, please see EIP <a href="http://www.eaipatterns.com/toc.html">reference</a> or read the dedicated <a href="http://www.amazon.com/dp/0321200683">book</a> on these.</p>
<p>The one implementation of EIP I was working with is excellent <a href="http://camel.apache.org/">Apache Camel</a> Java library. There’re many so-called “components” for Apache Camel, which provides adapters from/to various persistence mechanisms (relational databases, file systems, …), messaging solutions (AMQP, beanstalkd, …), web services and so on. Using such components you can compose them in different ways with help of internal fluent DSL. Better visit <a href="http://camel.apache.org/examples.html">examples</a> page for seeing how it works.</p>
<p>But I think that Erlang/OTP fits much better for this kind of things:</p>
<ul>
<li><p>Parallel runtime with preemptive lightweight processes with N-M scheduler (N number of processes maps to M number of OS-level threads).</p></li>
<li><p>Isolated processes helps localize failures of independent exchanges.</p></li>
<li><p>Process linking allows build sophisticated error handling and recovery strategies.</p></li>
<li><p>Pattern matching on message structure makes code more clear and concise in comparison to dynamic type casting and nested <em>if-statements</em> in Java.</p></li>
<li><p>OTP framework provides a solid foundation as a set of behaviours — process supervising tree, finite state machine, event listener and etc.</p></li>
<li><p>Hot code reloading makes updates easy — while in-fly exchanges can use old code for processing, new ones can be processed by updated version of code.</p></li>
</ul>
<p>In future posts I’ll try to provide implementation sketch and architectural overview of such a system. Stay tuned.</p>
<h4 id="update">Update</h4>
<p>Yes, I’m aware of <a href="http://camel.apache.org/scala-dsl.html">Scala DSL</a> for Camel (which seems abandoned for now) and more strong <a href="https://github.com/krasserm/scalaz-camel/wiki">scalaz-camel</a> library, moreover I’ve used Scala with Apache Camel and I should say — Scala makes my application’s code suck much less. But I’m also expect much more from applicaton written in such expressive and powerful language as Scala — <em>(a)</em> type safe routes, <em>(b)</em> redesigned core based on Scala concurrency primitives (maybe <a href="http://akka.io/">Akka</a> actors) allowing to get rid of all this Java boilerplate and garbage.</p>
<p>While I understand I cannot gain <em>(a)</em> by designing such a library in Erlang — dynamically typed language — it makes more sense not to expect statical type checks in Erlang than to see runtime cast errors in such a language like Java or Scala beeing statically typed from the ground up.</p>]]></description>
    <pubDate>Sun, 01 May 2011 00:00:00 UT</pubDate>
    <guid>http://braintrace.ru/posts/2011-05-01-project-idea-eip-in-erlang-pt-1.html</guid>
</item>

    </channel> 
</rss>

