<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dmitrii on Medium]]></title>
        <description><![CDATA[Stories by Dmitrii on Medium]]></description>
        <link>https://medium.com/@dmitriid?source=rss-cfa467f09967------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*-JtHkqxCSwrf2_h8.png</url>
            <title>Stories by Dmitrii on Medium</title>
            <link>https://medium.com/@dmitriid?source=rss-cfa467f09967------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 18:12:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dmitriid/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[…in which I complain about Elixir syntax]]></title>
            <link>https://medium.com/@dmitriid/in-which-i-complain-about-elixir-syntax-54a34c3033f5?source=rss-cfa467f09967------2</link>
            <guid isPermaLink="false">https://medium.com/p/54a34c3033f5</guid>
            <category><![CDATA[functional-programming]]></category>
            <category><![CDATA[elixir]]></category>
            <category><![CDATA[erlang]]></category>
            <dc:creator><![CDATA[Dmitrii]]></dc:creator>
            <pubDate>Fri, 01 Apr 2016 12:41:16 GMT</pubDate>
            <atom:updated>2016-04-01T13:45:41.582Z</atom:updated>
            <content:encoded><![CDATA[<p>I kinda like Elixir. I even think that Elixir is a huge leap towards the future and all the right things that should be happening in the Erlang world (see related post <a href="https://medium.com/@dmitriid/erlang-is-dead-long-live-e-885ccbcbc01f#.7w302xf99">here</a>). I still get irritated by it :)</p><p>What follows is a highly opinionated … erm … opinion. I am right and you are wrong ;)</p><h3>ToC</h3><ul><li>It’s not the syntax that’s important, it’s the consistency<br>- Erlang syntax primer</li><li>What of Elixir?<br>- do..end vs -&gt;<br>- Parentheses are optional. Except they aren’t<br>- do..end vs ,do:</li></ul><h3>It’s not the syntax that’s important, it’s the consistency</h3><p>I will be hanged out to dry for this, then brought in and hanged dry again. But here goes.</p><p>Let’s start with Erlang. Erlang has one of the most concise and <em>consistent</em> syntaxes in programming languages.</p><h4>Erlang syntax primer</h4><p>1: A sequence of expressions is separated by commas:</p><pre>Var = fun_call(),<br>Var2 = fun_call2(), Var3 = fun_call3(Param1, Param2)</pre><p>2: A pattern match after which we return a value is followed by an arrow. From a programmer’s point of view, there’s no difference if this is a pattern match introduced by the function declaration or by a <em>case, receive </em>or <em>if</em></p><pre>function_declaration(Param1, Param2) -&gt; <br>  Var = fun_call(),<br>  Var2 = fun_call2(), Var3 = fun_call3(Param1, Param2),<br> <br>  receive<br>     {some, pattern} -&gt;<br>         do_one(),<br>         do_three(),<br>         do_four() %% the value of this call will be returned<br>  end.</pre><p>3: Choices are spearated by semicolons. Once again, there’s no real difference (at least to the programmer) between choices in function heads (we choose between different patterns) and choices in <em>case</em>, <em>if</em> or <em>receive</em>:</p><pre>function1({a, b}) -&gt;<br>  do_a_b();<br>function1({c, D}) -&gt;<br>  case D of<br>    {d, e} -&gt; do_c_d_e();<br>    {f, g} -&gt; do_c_f_g()<br>  end.</pre><p>4: There are also blocks, and a block is terminated by an <em>end</em> (there’s a bit of inconsistency in blocks themselves: <em>begin..end, case of..end, try..catch..end, if..end</em>). E.g.:</p><pre>function() -&gt;<br>  begin<br>    case X of<br>      b -&gt; <br>         if true -&gt; ok end<br>    end<br>  end.</pre><h3>What of Elixir?</h3><p>And here’s my problem with Elixir: You have to be always be aware of things and of what goes where when.</p><h4>do..end vs -&gt;</h4><pre>def f(a, b) do<br>  case a do<br>    {:c, :d} -&gt;<br>      do_a_b_c_d()<br>    {:e, :f} -&gt;<br>      receive do<br>        {:x} -&gt; do_smth()<br>        {:y} -&gt; something_else()<br>      end<br>  end<br>end</pre><p>What? Why is there suddenly an arrow? In a language where (almost) everything is a <em>do..end</em> the arrow is jarringly out of place. For the longest time ever I honestly thought that the only thing separating pattern matches in a case statement is identation. Which would be weird in a language where whitespace is insignificant.</p><p>There’s an argument that these are individual patterns within a <em>do..end</em> block separated by newlines and denoted by arrows (see <a href="https://twitter.com/dmitriid/status/715772378786213888">here</a>). <em>cond</em>, <em>case</em> and <em>receive</em> all use that. The argument is moot, however.</p><p>Here’s how you define an anonymous function in Elixir:</p><pre>a_fun = fn x -&gt; x end</pre><p>This is an even weirder construct. It’s not a <em>do..end</em>. But it has an arrow <em>and</em> an <em>end</em>. Moreover, regular functions are also individual patterns within a <em>do..end</em> block:</p><pre>defmodule M do<br>  def x(:x), do: :x end<br>  def x(:y), do: :y end<br>end</pre><p>And here’s how you define similar constructs with arrows:</p><pre>a_fun = fn :x -&gt; :x<br>           :y -&gt; :y<br>        end</pre><pre>result = case some_var do<br>           :x -&gt; :x<br>           :z -&gt; :z<br>         end</pre><p>If arrow is just a syntactic sugar for <em>do..end</em>, why can’t it be used in other places? If it’s used for sequences of patterns, why can’t it be used for function declarations?</p><p>There’s definitely an argument for readability. Compare:</p><pre>## arrows<br>case some_var do<br>  :x -&gt; :x<br>  :z -&gt; <br>    some<br>    multiline<br>    statement<br>    :z<br>end</pre><pre>## do..end as everywhere<br>case some_var do<br>  :x, do: :x<br>  :z do<br>    some<br>    multiline<br>    statement<br>    :z<br>  end<br>end</pre><p>But then… Why not use the more readable arrows in other places as well? ;)</p><pre>## regular do..end<br>defmodule M do<br>  def x(:x), do: :x end<br>  def x(:y) do<br>    some<br>    multiline<br>    statement<br>    :z<br>  end<br>end</pre><pre>## arrows<br>defmodule M do<br>  def x(:x) -&gt; :x<br>  def x(:y) -&gt;<br>    some<br>    multiline<br>    statement<br>    :z<br>  end</pre><p>So, in my opinion, arrows is a very weird incosistent hardcoded syntactic sugar. And it irritates me :)</p><p>Moving on</p><h4>Parentheses ar optional. Except they aren’t</h4><p>One of the arguably useful features of Elixir is that function calls do not require parantheses:</p><pre>&gt; String.upcase(“a”)<br>“A”<br>&gt; String.upcase “a”<br>“A”</pre><p>Except that if you want to keep your sanity instead of juggling things in your mind, you’d better off using the parentheses anyway.</p><p>First, consider Elixir’s amazing <a href="http://elixir-lang.org/docs/stable/elixir/Kernel.html#%7C%3E/2">pipe operator</a>:</p><pre>## instead of writing this<br>Enum.map(List.flatten([1, [2], 3]), fn x -&gt; x * 2 end)</pre><pre>## you can write this<br>[1, [2], 3] |&gt; List.flatten |&gt; Enum.map(fn x -&gt; x * 2 end)</pre><p>Whatever is on the left side of the pipe will be passed as the first argument to the whatever’s on the right. Then the result of that will be passed as the first argument to the next thing. And so on.</p><p>However. Notice the example above, taken straight from the docs. <em>List.flatten</em>, a function, is written without parentheses. <em>Enum.map</em>, also a function, requires parentheses. And here’s why:</p><pre>&gt; [1, [2], 3] |&gt; List.flatten |&gt; Enum.map fn x -&gt; x * 2 end<br>iex:14: warning: you are piping into a function call without parentheses, which may be ambiguous. Please wrap the function you are piping into in parentheses. For example:</pre><pre>foo 1 |&gt; bar 2 |&gt; baz 3</pre><pre>Should be written as:</pre><pre>foo(1) |&gt; bar(2) |&gt; baz(3)</pre><p>This is just a warning, and things can get ambiguous. That’s why you’d better always use parentheses with pipes. It gets worse though.</p><p>Remember anonymous functions we talked about earlier? Well. Let me show an example.</p><p>Here’s how a function named <em>flatten</em> declared in module <em>List</em> behaves:</p><pre>&gt; List.flatten([1, [2], 3])<br>[1, 2, 3]<br>&gt; List.flatten([1, [2], 3])<br>[1, 2, 3]<br>&gt; [1, [2], 3] |&gt; List.flatten<br>[1, 2, 3]</pre><p>Here’s how an anonymous function behaves:</p><pre>&gt; a_fun = fn x -&gt; List.flatten x end<br>#Function&lt;6.54118792/1 in :erl_eval.expr/5&gt;</pre><pre>&gt; a_fun([1, [2], 3])<br>** (CompileError) iex:17: undefined function a_fun/1</pre><pre>&gt; a_fun [1, [2], 3]<br>** (CompileError) iex:17: undefined function a_fun/1</pre><pre>iex(17)&gt; [1, [2], 3] |&gt; a_fun<br>** (CompileError) iex:17: undefined function a_fun/1<br> (elixir) expanding macro: Kernel.|&gt;/2<br> iex:17: (file)</pre><p>Wait. What?!</p><p>Oh. Right. Anonymous functions, what a nice joke. Let’s all have a good laugh. <em>An anonymous function must always be called with .()</em></p><pre>&gt; a_fun.([1, [2], 3])<br>[1, 2, 3]<br>&gt; [1, [2], 3] |&gt; a_fun.()<br>[1, 2, 3]</pre><p>Because parentheses are optional, right. And functions are first class citizens, and there’s no difference if it’s a function or a variable holding a function, right? (In the example below <em>&amp;List.flatten/1</em> is equivalent to Erlang’s <em>fun lists:flatten/1.</em> It’s called a <a href="http://elixir-lang.org/docs/stable/elixir/Kernel.SpecialForms.html#&amp;/1">capture operator</a>.)</p><pre>&gt; a_fun = List.flatten<br>** (UndefinedFunctionError) undefined function List.flatten/0<br> (elixir) List.flatten()</pre><pre>&gt; a_fun = &amp;List.flatten<br>** (CompileError) iex:19: invalid args for &amp;, expected an expression in the format of &amp;Mod.fun/arity, &amp;local/arity or a capture containing at least one argument as &amp;1, got: List.flatten()</pre><pre>&gt; a_fun = &amp;List.flatten/1<br>&amp;List.flatten/1</pre><pre>&gt; a_fun([1, [2], 3])<br>** (CompileError) iex:21: undefined function a_fun/1</pre><pre>&gt; a_fun.([1, [2], 3])<br>[1, 2, 3]</pre><p>Yup. Because parentheses are optional.</p><p>If you think it’s not a big problem, and that anonymous or “captured” functions are not that common… They may not be common, but they are still used. An empty project using <a href="http://www.phoenixframework.org/">Phoenix</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/539/1*fLGl-c8BOZxqk-nePXXa7Q.png" /></figure><p>Every time you use a “captured” or an anonymous functions, you need to keep the utterly entirely useless information: they are invoked differently than the rest of the functions, they require parentheses etc. etc.</p><pre>&gt; 1 |&gt; &amp;(&amp;1 * 2).()<br>** (ArgumentError) cannot pipe 1 into &amp;(&amp;1 * 2.()), can only pipe into local calls foo(), remote calls Foo.bar() or anonymous functions calls foo.()</pre><pre>&gt; 1 |&gt; (&amp;(&amp;1 * 2)).()<br>2</pre><p>Local. Remote. Anonymous. Riiiight</p><p>Compare with Erlang:</p><pre>1&gt; lists:flatten([1, [2], 3]).<br>[1,2,3]</pre><pre>2&gt; F = fun lists:flatten/1.<br>#Fun&lt;lists.flatten.1&gt;<br>3&gt; F([1, [2], 3]).<br>[1,2,3]</pre><p>Before we move on. Calls without parentheses lead to the unfortunate situation when you have no idea what you’re doing: assigning a variable value or the result of a function call.</p><pre>some_var = x  ## is it x or x(). Let&#39;s hope the IDE tells you</pre><p>And yes, this also happens.</p><h4>do..end vs ,do:</h4><p>This has been explained to me <a href="https://groups.google.com/d/msg/elixir-lang-talk/TEJv2jxceuo/VolXiyrgAwAJ">here</a>. I will still mention it, because it’s annoying the hell out of me and is definitely confusing to beginners. Basically, it’s one more thing to keep track of:</p><pre>def oneliner(params), do: result</pre><pre>def multiliner(params) do<br>  one<br>  two<br>  result<br>end</pre><p>Yup. A comma and a colon in one case. No comma and no colon in the second case. Because syntactic sugar and reasons.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=54a34c3033f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Erlang is dead. Long live E…?]]></title>
            <link>https://medium.com/@dmitriid/erlang-is-dead-long-live-e-885ccbcbc01f?source=rss-cfa467f09967------2</link>
            <guid isPermaLink="false">https://medium.com/p/885ccbcbc01f</guid>
            <category><![CDATA[erlang]]></category>
            <category><![CDATA[elixir]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Dmitrii]]></dc:creator>
            <pubDate>Fri, 19 Feb 2016 15:15:39 GMT</pubDate>
            <atom:updated>2016-02-19T15:18:08.411Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Disclaimer:</strong> I <em>love</em> Erlang. From 2005 to 2015 I ran <a href="http://erlanger.ru/">erlanger.ru</a> (mostly alone, as editor-in-chief, content creator, developer — you name it). It is my favourite language, and this isn’t going to change any time soon. Exactly because I love it, I see problems with it.</p><p><strong>ToC</strong></p><ul><li>Problem Statement</li><li>Ericsson’s Baby</li><li>A Brief, Incomplete, and Mostly Wrong History of Erlang</li><li>Java Is the New Erlang</li><li>Erlang Is the New … Nothing, Really</li><li>Is There Hope Yet?</li></ul><h3>Problem statement</h3><p><em>Other languages are getting better at being Erlang than Erlang is getting better at being other languages.</em></p><h3>Ericsson’s Baby</h3><p>Erlang is first and foremost Ericsson’s baby. Thus, <em>enterprise</em> and <em>telecom</em> are the two things that influence Erlang the most. It is Erlang’s greatest strength and it’s greatest weakness.</p><p>Enterprise side of things made sure that Erlang has got to be one of the most stable languages out there:</p><ul><li>Breaking changes, if any, are introduced very rarely, with clean and understandable upgrade paths often split over multiple releases.</li><li>New features are folded into the language or the standard library after a lot of careful deliberation and on an “absolutely needed” basis. They are also introduced gradually, often over the course of several releases.</li></ul><p>Telecom side of things made sure that Erlang is also probably the language that got more things right from the start (or nearly from the start) than any other language:</p><ul><li>lightweight processes</li><li>messaging</li><li>immutability, <em>gen_*</em> patterns in OTP etc.</li></ul><p>The problem, however, <strong><em>this no longer matters</em></strong>.</p><h3>A Brief, Incomplete, and Mostly Wrong History of Erlang</h3><ul><li><em>1990s</em>: Erlang is lightyears ahead of anyone with processes, distribution, OTP etc.</li><li><em>early-to-mid 2000s</em>: Erlang is on the bleeding edge with SMP, distribution</li><li><em>late 2000s to mid-2010s</em>: Erlang is … mainstream at best</li></ul><h3>Java is the new Erlang</h3><p>This may be hard to swallow, but Java is the new Erlang. And other languages either piggyback Java, or are fast developing to provide competition in many areas.</p><p>Let’s look at the most common tools that everyone uses or knows about in areas where Erlang is supposed to shine: Hadoop, Kafka, Mesos, ChaosMonkey, ElasticSearch, CloudStack, HBase, <em>&lt;insert your project&gt;.</em></p><p>For every single of your distributed needs you will take Java. Not Erlang.</p><p>In other rapidly developing fields such as IoT, there’s Java again, C/C++, Python. Rarely, if ever, Erlang.</p><p>And the trend will only continue. Server management and monitoring tools, messaging and distribution, parallel computing—you name it—sees an explosion of tools, frameworks and libraries in most languages. All of them encroaching on space originally thought to be reserved for Erlang.</p><h3>Erlang Is the New … Nothing, Really</h3><p>While others are encroaching on it’s territory, Erlang has really nothing to fight back with.</p><p>Even today Erlang is a very bare-bones language. An <em>assembly</em>, if you will, for writing distributed services. Even if you include OTP and third-party libraries. <em>And, as a developer, you have to write those services from scratch yourself</em>. Not that it’s a bad thing, oh no. But in a “move fast and break things” scenario having to write lots of things from scratch may break you, and not others.</p><p><em>Erlang is a language for mad scientists to write crazy stuff for other mad scientists to use or to be amazed at</em> (see my <a href="http://www.slideshare.net/dmitriid/erlang-sucks-euc-2012">lightning talk</a> from 2012)</p><p>Anything else? Well,</p><ul><li>There’s Java for anything related to distribution</li><li>There are Python’s great interfaces to scientific and statistical libraries</li><li>There’s basically any language for strings, images, graphs, database interfaces—anything, I tell you</li></ul><p>This leaves Erlang… well, in limbo.</p><h3>Is There Hope Yet?</h3><p>I really really don’t know. I really hope though.</p><p>Due to its heritage Erlang will evolve slowly. It’s a given, and it’s no fault of the brilliant people who develop Erlang.</p><p>Other languages for the Erlang VM? Maybe. As we have seen with Elixir, in three years it’s got more development (both in the language itself and in the available libraries) than Erlang got in 10 years. We can only hope the drive will not subside. Will there be a “Hadoop.ex” to rival the Java Hadoop? I don’t know.</p><p>Incidentally, a lot of the praise that now comes towards Elixir mentions Erlang only in passing. As in “compiles to Erlang” or “runs on Erlang VM”. And may be <em>this</em> is <em>exactly</em> what Erlang needs: become for (Elixir|LFE|Efene|…) what JVM became for (Scala|Clojure|Groovy|…)?</p><p>Erlang is far from dead. It’s alive and kicking (some butt, if need be). Will it do that for long? In a “let’s choose between languages A, B, and Erlang for scenario X” will there remain a scenario X where Erlang will remain relevant and/or a valid choice?</p><p>I don’t know. I sure as hell hope.</p><p><em>I’m trying to do some good myself. I’m not bright enough to create something like the libraries mentioned here, but there’s </em><a href="https://github.com/dmitriid/neo4j-erlang"><em>neo4j-erlang</em></a><em> and </em><a href="https://github.com/dmitriid/pegjs"><em>pegjs</em></a><em> for what it’s worth.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=885ccbcbc01f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript: Fatigue vs. Stockholm syndrome]]></title>
            <link>https://medium.com/@dmitriid/javascript-fatigue-vs-stockholm-syndrome-631d4f524008?source=rss-cfa467f09967------2</link>
            <guid isPermaLink="false">https://medium.com/p/631d4f524008</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[tools]]></category>
            <dc:creator><![CDATA[Dmitrii]]></dc:creator>
            <pubDate>Mon, 15 Feb 2016 15:45:26 GMT</pubDate>
            <atom:updated>2016-02-15T16:00:31.793Z</atom:updated>
            <content:encoded><![CDATA[<p>Programmers are the worst. They will vehemently defend the tool of their choice even though it’s the worst tool in the universe. See any <em>vs</em> in the programming community. Tabs vs. spaces. Emacs vs. vim. C++ vs. PHP. You name it.</p><p><strong>tl;dr</strong>: Javascript fatigue is real. If you deny it, you have a case of Stockholm syndrome. The problem isn’t new, see these two excelent blog posts: <a href="http://blog.keithcirkel.co.uk/why-we-should-stop-using-grunt/">http://blog.keithcirkel.co.uk/why-we-should-stop-using-grunt/</a>and <a href="http://blog.keithcirkel.co.uk/how-to-use-npm-as-a-build-tool/">http://blog.keithcirkel.co.uk/how-to-use-npm-as-a-build-tool/</a> for a calmer discussion.</p><h3>ToC</h3><ul><li>A little <em>true</em> story</li><li>No, it’s Stockholm syndrome</li><li>I’m not lazy. I don’t not want to learn</li></ul><h3>A little <em>true</em> story</h3><p>All joking aside, I think that Javascript programmers are even worse than the worst. Here’s a little <em>true</em> story that happened to me three weeks ago.</p><p>We have a project which started way before <em>Webpack</em> was in any useable shape or form. So, it uses <em>Grunt</em>. It’s all been fine, and Grunt has been chugging along quite happily (chugging, because, well, you need to <em>concat</em> all/some/some magic number of files before it can figure out what to do with them. Yes, concat. *Sigh*). Until we imported a small three-file component which was written in — wait for it — ES6.</p><p>ES6 is the next version of Javascript (erm, ECMAScript) which is supported in exactly zero browsers, and exactly zero versions of any of the Javascript virtual machines. Through the magic of <em>transpilers</em> it can be converted to a supported version of Javascript. Therefore half of the internet publishes their code in ES6 now.</p><p>Oh my. I know what we need! We need <em>Babel</em>! The best tool to convert pesky ES6 into shiny ESwhatever-the-version (I’m told it’s 5).</p><p>Install Babel. Run.</p><pre>&gt;&gt; ParseError: ‘import’ and ‘export’ may appear only with ‘sourceType: module’<br>Warning: Error running grunt-browserify. Use — force to continue.</pre><p>Ok. Bear with me. Babel, whose job 99% of the time consists of transforming ES6 code into ES5 code <em>no longer does this out of the box</em>. I have no idea if it does anything out of the box anymore.</p><p>But it comes with nice presets! One of them does the job! It’s even called, erm, <em>es-2015</em>. Whatever. Specify it in options, run grunt be happy.</p><pre>&gt;&gt; ParseError: ‘import’ and ‘export’ may appear only with ‘sourceType: module’<br>Warning: Error running grunt-browserify. Use — force to continue.</pre><p>Ok. Bear with me. A <em>preset</em> is an umbrella name that specifies a list of <em>plugins</em> Babel will apply to code. If these plugins are not present, <em>Babel will fail silently</em>.</p><p>Oh, it doesn’t fail in your particular setup? Oh, how so very nice to be you. The problem is: <em>there is exactly zero info on which of the moving parts of the entire system silently swallows the error</em>.</p><p>Let’s step back for a second, and consider:</p><ul><li>Grunt does not transform code, it’s a “task runner”</li><li>The task it runs is called <em>browserify</em></li><li>Well, the problem with the browserify <em>task</em> is that the <em>task</em> runner cannot run it. It needs a plugin called <em>grunt-browserify</em> to do that</li><li>Oh, and browserify has to run babel on the source code before it can do anything with it.</li><li>And the problem is that browserify cannot run babel directly. It needs <em>babelify</em> to work</li></ul><p>All in all the whole toolchain to produce a Javascript file is <em>grunt -&gt; grunt-browserify -&gt; browserify -&gt; babelify -&gt; babel</em>. And someone in that chain decides that babel missing all of its specified plugins <em>is not a reason to throw an error, stop and report.</em></p><p>Unwind. Relax. Breathe. Solve differential equations in your head. Install whatever’s needed for babel. Run grunt.</p><pre>&gt;&gt; ParseError: ‘import’ and ‘export’ may appear only with ‘sourceType: module’<br>Warning: Error running grunt-browserify. Use — force to continue.</pre><p>Oh, Jesus Christ on a pony! What now? Ok. I’m a smart developer. I can figure this out. I mean, if I cannot debug my own toolchain, what good am I?</p><p>So, grunt has a <em>-d</em> option which means <em>debug</em>. Awesome.</p><p>Ok. Bear with me. <em>The debug option passed to grunt does not propagate through the mess of twig and sticks called a toolchain.</em> <em>Grunt</em> does not pass the debug option to <em>grunt-browserify</em> does not pass the debug option to <em>browserify</em> does not pass the debug option to <em>babelify</em> does not pass the debug option to <em>babel.</em></p><p>You have to provide separate debug options to every piece of the toolschain and pray to god that this piece provides such an option and does not ignore it.</p><p>Let’s add <em>debug: true</em> to babelify.</p><pre>&gt;&gt; ParseError: ‘import’ and ‘export’ may appear only with ‘sourceType: module’<br>Warning: Error running grunt-browserify. Use — force to continue.</pre><p>Exactly. Was the <em>debug: true</em> option ignored? Or is <em>this</em> all the debug info I can get? <em>I have no idea.</em></p><p>Ok. Bear with me. Grunt has <em>a specific list of files and components it needs to process</em>. I can only assume that the broken ladder of crap called the toolchain gets this list from Grunt with instructions: “These are the files. Process them.”</p><p>Despite all that, <em>Babel by default does not process files from node_modules. Even when invoked from grunt-whatever-theplugin-is-i-dont-care will not process them, and will silently skip them. </em>You have to explicitly provide a separate <em>global: true</em> option to all places in grunt-&gt;grunt-broswerify-&gt;babelify config where you think that code from node_modules may be imported/invoked/whatever.</p><h3>No, it’s Stockholm syndrome</h3><p>I’ve been told that <a href="http://www.2ality.com/2016/02/js-fatigue-fatigue.html">this article</a> is a valid argument against “Javascript fatigue”.</p><p>It’s not. It’s Stockholm syndrome.</p><ul><li><em>Don’t try to know everything</em><br>I’m not “using everything”. Only the absolute minimum I need to do my job. Going as far as rewriting or reimplementing things that are overy bloated</li><li><em>Wait for the critical mass.<br></em>How is Grunt, browserify, Babel not critical mass?</li><li><em>Do exploratory toy projects<br></em>Believe me, I do. It is nigh impossible to start a toy project these days, unless you blindly copy paste an umpteenth webpack-starter-kit-for-reals-this-time-works-I-promise and pray that it works for the current minor and major versions of all the moving parts involved. Unless you have your one config file, faithfully copy-pasted all over the place.</li><li><em>Diversify in life<br></em>I do kendo, aikido, contemporary dance, salsa, and amateur Russian theater. How’s that for diversification? How any of these can help me with the abomination in the first part of this post?</li><li><em>You can always go back to fundamentals<br></em>How very condescending of you. I wrote articles (albeit in Russian) on fundamentals.</li></ul><p>Nothing can excuse the terrible horrible mess that the state of Javascript development is in right now. Step back, and <em>look</em> at your tools. Really <em>look</em> at them. There is a reason we have a million “webpack starter packs”. Because nothing works unless you invoke a number of semi-arcane incantations with increasingly inane combinations and versions of options.</p><pre>loaders:[{<br>   test: /(\.css)/,<br>   loader: &quot;css-loader?module&amp;localIdentName=[path][name] — -[local] — -[hash:base64:5]&quot;<br>}]</pre><p>Really?!</p><p>I will not even go into how half of these tools don’t support recursing directories or globs. Or how another half of them doesn’t support monitoring the file system and recompiling stuff on the fly (what? recompiling on the fly with <em>dependency tracking</em> wat?).</p><p>Why are you supporting this?</p><h3>I’m not lazy. I don’t <em>not</em> want to learn</h3><p>It’s been said that “Javascript fatigue” appears because developers are lazy.</p><p>It’s been said that “Javascript fatigue” is because developers don’t want to learn anything new.</p><p>These arguments are null and void. If you read the first part of the story, you’ve seen that:</p><ul><li>there’s nothing lazy in trying to make your build tool work</li><li>there are exactly zero useful things to learn from that experience</li></ul><p>The time I spent trying to figure out the exact motions of all the moving parts I could spend on learning something genuinely new.</p><p>Instead, I now have a build toolchain that I have exactly zero confidence in (because it will break unexpectedly at the very next update of any of the fourteen hundred moving parts in it).</p><p>And yes, I will be removing some of those moving parts. It doesn’t mean that I will enjoy it or learn anything remotely useful from it.</p><p><em>(imgur style): send me your *-starter-packs :)</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=631d4f524008" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Designing for <anything> with Erlang]]></title>
            <link>https://medium.com/@dmitriid/designing-for-anything-with-erlang-cfadb6833bc0?source=rss-cfa467f09967------2</link>
            <guid isPermaLink="false">https://medium.com/p/cfadb6833bc0</guid>
            <category><![CDATA[erlang]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Dmitrii]]></dc:creator>
            <pubDate>Fri, 05 Feb 2016 11:10:38 GMT</pubDate>
            <atom:updated>2016-02-07T01:04:13.195Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>No</strong>, this is not really a post about the upcoming <a href="http://shop.oreilly.com/product/0636920024149.do"><em>Designing for Scalability with Erlang/OTP</em></a><em>.</em> Erlang is nearly unique among other programming languages in that almost all of the <a href="https://erlangcentral.org/books/">books</a> on it are in the good to great range. This book is going to be no exception.</p><p><strong>No</strong>, this is not about Erlang per se, as other languages have the same problem. But Erlang is a poster child for “scalable distributed 99.999999% cloud developer-to-user ratio &lt;insert the next current rave here&gt;”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*dUod75AunWDL1jEYQQbYgw.jpeg" /></figure><p>Recently I twitted:</p><blockquote>Every single book on <a href="https://twitter.com/hashtag/Erlang?src=hash">#Erlang</a> spends 99% of text on reiterating the same basic principles. Most of them are worse than LYSE</blockquote><p>Where LYSE is, of course the excellent <a href="http://learnyousomeerlang.com/">Learn You Some Erlang For Great Good</a>.</p><p>This is a bit harsh. May be not 99%. And not necessarily worse. So, what do I complain about? Most books mostly concern themselves with “draw some circles”. Reality is quite often “draw the rest of the owl”. There is almost no info on the intermediate steps in between.</p><blockquote><strong><em>Scalability</em></strong> is the capability of a system, network, or process to handle a growing amount of work, or its potential to be enlarged in order to accommodate that growth.</blockquote><blockquote>To <strong>scale horizontally</strong> (or <strong>scale out</strong>) means to add more nodes to a system, such as adding a new computer to a distributed software application.</blockquote><blockquote>To <strong>scale vertically</strong> (or <strong>scale up</strong>) means to add resources to a single node in a system, typically involving the addition of CPUs or memory to a single computer.</blockquote><p>So, in the case of Erlang, which is described as, praised for being, marketed as being scalable, distributed, durable, resilient etc. etc. it would be really nice to read up on <em>at least</em> some of these things:</p><ul><li>setting up multiple nodes</li><li>testing a distributed app</li><li>deploying a distributed app</li><li>handling failover</li><li>handling load balancing</li><li>handling netsplits (and not only in Mnesia. If we can add a process on node B to a gen_supervisor on node A, how do we handle netsplits, timeouts, restarts etc.?)</li><li>discovery of nodes</li><li>tracing</li><li>profiling</li><li>various VM options and their impact</li><li>securing connection between nodes</li><li>logging</li><li>debugging</li><li>crash dumps</li><li>remote inspection</li><li>mitigating overflowing mailboxes</li><li>SSL</li><li>sockets</li><li>working from behind firewalls</li><li>flood protection</li><li>slow requests</li><li>timeouts</li><li>sessions</li><li>latency</li><li>&lt;add your own&gt;</li></ul><p>Funnily enough, in an out-of-the-box Erlang:</p><ul><li>there are zero answers to some of these questions, so it would be nice to find out how this can be solved (consul/etcd for node discovery? how? and similar questions)</li><li>already has excellent tools, but very little info on best way to use them: profiling, tracing, remote inspection (redbug, do you use it? etc.)</li><li>has performance problems with poorly documented workarounds or third-party solutions for some situations (running across thousands of nodes or thousands of cpus comes to mind)</li><li>has support for some scenarios, but very little info on them (there’s a total of about 1000 words on large scale testing with Common Test in the docs for example)</li></ul><p>Unfortunately, most existing books emphasize beyond measure only one single aspect of Erlang: OTP. Even though OTP is no doubt essential to creating robust scalable distributed applications, people looking for the answers to questions above already grok OTP :) They already know how to draw the circles.</p><p>If you’re looking for answers, though, the landscape in Erlang books is quite bleak.</p><p>Among the commercially available it looks like only “<a href="http://www.amazon.ca/gp/product/toc/1430227699/ref=dp_toc?ie=UTF8&amp;n=916520">Mastering Erlang: Writing Real World Applications</a>” doesn’t fall into the trap of spending all of it’s chapters on OTP with only one or two chapters dedicated to something else. (<em>Update:</em> I’m not even sure this book exists. It looks like it’s been “Coming soon” since 2010. Except perhaps <a href="http://www.buecher.de/shop/softwareentwicklung/mastering-erlang-writing-real-world-applications/cant-geoff/products_products/detail/prod_id/27359080/">here</a>)</p><p>The other notable exception is the excellent <a href="http://www.erlang-in-anger.com/">“Erlang in Anger”</a> which answers quite a lot of the questions above.</p><p>We’re quite ready to move beyond drawing circles. Some of us are not yet ready to draw the entire owl ;) Hjälp!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cfadb6833bc0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A case for QuickCheck for Elixir?]]></title>
            <link>https://medium.com/@dmitriid/a-case-for-quickcheck-for-elixir-8aa10a4fd2bf?source=rss-cfa467f09967------2</link>
            <guid isPermaLink="false">https://medium.com/p/8aa10a4fd2bf</guid>
            <category><![CDATA[erlang]]></category>
            <category><![CDATA[elixir]]></category>
            <category><![CDATA[quickcheck]]></category>
            <dc:creator><![CDATA[Dmitrii]]></dc:creator>
            <pubDate>Fri, 24 Apr 2015 09:15:33 GMT</pubDate>
            <atom:updated>2015-04-24T09:15:33.165Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently I got into a <a href="https://twitter.com/podmostom/status/591516908891013120">shouting match</a> about QuickCheck <a href="http://www.erlang-factory.com/sfbay2015/thomas-arts">implementation</a> for Elixir.</p><p>My original reaction:</p><blockquote>Why? Quckcheck is for companies only. Elixir is used by zero companies (except maybe 2 startups)</blockquote><p>My highly non-scientific view of Erlang/Elixir world is something like this (don’t get offended by circle sizes, I’m bad at Venn diagrams):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*2_bZunhz1U614Q4zbx0UoQ.png" /></figure><p>If there is a company that sponsored the development of QuickCheck for Elixir, it’s great (both for the company and Quviq). However, it offers almost zero value to the rest of us for obvious reasons:</p><ul><li>QuickCheck is virtually non-existent outside companies. I’m aware of the reason behind it and I can’t really say anything against that reason (because it makes sense ☺). However, it remains a fact: if you want to access more advanced features (like testing concurrency) you need a license, which has to be negotiated with Quviq, and costs an unspecified (and, as I hear, quite large) amount of money.</li><li>Elixir is still at an “early adoption” stage. So there are very few companies that use it, and even fewer who will decide to go for a QuickCheck license.</li><li>Most companies who already have the QuickCheck license will most likely not be willing to have Elixir in their toolbelt for an obvious reason (it introduces a new language/environment/build steps etc.).</li><li>Another point for inaccessibility. Remember the announcement that the OTP team will start using QuickCheck (awesome!). The very first reaction was “why use something most of us will not even be able to run?”. An expected reaction, really.</li></ul><p>So that’s the main problem I have with this announcement and presentation: you’ve whetted our appetites. Now what?</p><p>What I would <strong>really</strong> love to see instead is just a clear licensing mechanism. Let’s say something like this:</p><ul><li>Plan 1. $100 a month. You get a license for 1(3?) computers (that you can auth/de-auth from your profile), and 1–5 projects in QuickCheck CI. No support</li><li>Plan 2. $500 a month. A license for 10 computers, 10 projects in CI. 5 hours support</li><li>etc.</li></ul><p>Then the “Testing concurrency with Elixir” presentations will be “oh, cool, I can use it” instead of “meh, I can’t use it, because I don’t even know how much it costs or whether I can afford it”.</p><p>Hence my reaction ☺ But it’s me, and I’m always bitter</p><p>Oh. By the way. If you think that I’m spreading some imagined hate about Elixir… go and take a cold shower.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8aa10a4fd2bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Case against “mouse vs. keyboard”]]></title>
            <link>https://medium.com/@dmitriid/case-against-mouse-vs-keyboard-88f8de7b3175?source=rss-cfa467f09967------2</link>
            <guid isPermaLink="false">https://medium.com/p/88f8de7b3175</guid>
            <dc:creator><![CDATA[Dmitrii]]></dc:creator>
            <pubDate>Wed, 21 Jan 2015 12:36:52 GMT</pubDate>
            <atom:updated>2015-01-21T12:36:52.526Z</atom:updated>
            <content:encoded><![CDATA[<p>Полный текст того, с чем я спорю, тут: <a href="http://plan9.bell-labs.com/wiki/plan9/Mouse_vs._Keyboard/index.html">http://plan9.bell-labs.com/wiki/plan9/Mouse_vs._Keyboard/index.html</a></p><p>Самая главная проблема как этого текста, так и текстов, на которые он ссылается, это то, что он полностью и безнадежно устарел. При том, что сам текст датируется 2011-м годом, он ссылается на тексты 1989 и 1991 годов, а сам борется только и исключительно с vim’ом.</p><p>С 1989-го года прошло уже 26 лет, а вместо vim’а есть и другие интсрументы (да-да, и вместо emacs’а, который там упоминается вскользь, тоже).</p><p>В целом, основной аргумент в пользу «надо часто пользоваться мышью» сводится к следующему:</p><ul><li>в vim’е нет этого, это удобнее сделать мышкой</li><li>в vim’е вот эта определенная комбинация команд хуже чем в acme, поэтому надо пользоваться мышью</li><li>в emacs’е вот эта определенная комбинация команд хуже чем в acme, поэтому надо пользоваться мышью</li></ul><p>ORLY?</p><p>Ниже по тексту используются Apple’овские комбинации клавиш. В Линуксе и Винде Cmd заменяется на Ctrl.</p><h3>Чувак, ты противоречишь сам себе</h3><blockquote>It is true that it is slower to use the mouse for, say, deleting a tab from the beginning of every line than it is to use the keyboard and type “^xjxjxjxjxjxjxjxjxjxjxjxjxj” in vi. But <strong>at that point you’re basically programming the editor</strong> (with a manually unrolled for loop) <strong>more than actually editing.</strong></blockquote><p>Говорит нам человек, и <em>тут же </em>предлагает следующее:</p><blockquote>When the mouse is properly accelerated, many of us find that it’s faster and easier to <strong>highlight the lines in question and then type and execute Edit s/^&lt;tab&gt;//g in acme or just type s/^&lt;tab&gt;//g in sam’s command window</strong>. This is such a common operation that <strong>acme provides two shell scripts</strong> so you can leave |unind and |ind in the tag of your window and click on them whenever you want.</blockquote><p>Стоп. Чем исполнение команд в окне команд и shell-скрипты (!) отличаются от программирования редактора? Да ничем, абсолютно. Особенно позабавило «разместите кнопочки для вызова этих команд в окошечке, и кликайте на них».</p><p>Во-первых, что-то мне подсказывает, что в vim’е можно точно так же выделить линии и набрать s/^&lt;tab&gt;//g</p><p>Во-вторых, что-то мне подсказывает, что в vim’е можно точно так же привязать короткие команды к скриптам(хотя да, нельзя их будет разместить в окошке)</p><p>В-третьих, в какой-нибудь IDEA я могу выделить все строчки и нажать Tab для смещения вправо или Shift+Tab для смещения влево (комбинация клавиш, которая работала, емнип, еще в Delphi в начале 2000-х, и имеющаяся в большом количестве редакторов). Что в разы удобнее, чем регулярки, пусть даже в виде кнопочек на панели</p><p>В четвертых, в той же IDEA я могу нажать Cmd+R (replace) и ввести то же регулярное выражение. Ах, да. Даже не задумываясь о том, что мне надо тянуться за мышью.</p><h3>В мире есть не только vi</h3><blockquote>but all I can think is ``damnit, if I could just click where I want to go I’d be there by now.’’</blockquote><p>Чувааак, в мире есть не только vi. Да, мышь — полезная штука для таких действий, но никто это и не отрицает. Ты придумал себе, что кто-то с этим спорит, и активно борешься с вымышленными оппонентами.</p><p>Наверное, все редакторы, кроме vi, имеют возможность ткнуть, куда угодно, скроллбары и возможность выделять текст мышкой. Да, потому что это удобно. Нет, это не значит, что за мышкой надо тянуться постоянно (например, чтобы переключиться в другое окно или чтобы запустить скрипт из кнопочки)</p><h3>Если тебе нужны костыли, значит, что тебе костыли не нужны</h3><blockquote>It’s important to have a good mouse, of course. It needs three real buttons, not two button with an intelliwheel in the middle.</blockquote><p>А можно и без этого обойтись, а дать людям возможность пользоваться твоим мега-редактором с минимальным использованием мыши.</p><p>Использование мыши в той же IDEA:</p><ul><li>60% случаев скролл (колесо или аналог)</li><li>30% случаев быстро выделить большой кусок текста (левая кнопка мыши)</li><li>10% случаев (хорошо, если 10%) — контекстное меню в дереве проекта</li></ul><p>Зачем мне три кнопки, да еще на мыши, когда абсолютно все мне доступно с клавиатуры?</p><h3>В мире есть и другие редакторы кроме emacs’а</h3><blockquote>When one makes a mistake in a search string, in emacs one uses ctl-S and ctl-R, it’s a pain to correct the mistake; the “Look” command in acme allows you to just edit the tag and rerun the search.</blockquote><p>В IDEA я нажимаю Cmd+F, редактирую слово (если надо), нажимаю ввод и — магия! — происходит поиск. Да как это можно без мыши сделать-то?!</p><p>Вообще, в целом, человек явно как жил в 1989-м году, так там до сих пор и живет. Ему невдомек, что есть что-то, кроме vi и emacs’а. Ему невдомек, что большинство современных редакторов используют мышь там, где надо, и предлагают удобный доступ с клавиатуры для большинства операций.</p><p>Я думаю, что когда ему покажут, что в IDEA можно использовать Cmd+F или там в любом современном редакторе текста можно выделять, например, куски текста через Cmd/Alt+Shift+стрелки, его хватит апоплексический удар.</p><p>Тексты, на которые он ссылается, комментировтаь даже не стою, так как в первом же идет разговор о том, что много комбинаций не стандартизировано. 26 лет спустя много комбинаций стандартизировано.</p><p>Это я еще умолчу, что банальные требования по accessibility обязывают, чтобы <strong>вся</strong> функциональность системы и приложения была доступна через клавиатуру (если система или приложение хотят быть сертифицированы).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88f8de7b3175" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[W3C and WHATWG should die a quick and horrible death]]></title>
            <link>https://medium.com/@dmitriid/w3c-and-whatwg-should-die-a-quick-and-horrible-death-a7cff5e1da8f?source=rss-cfa467f09967------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7cff5e1da8f</guid>
            <dc:creator><![CDATA[Dmitrii]]></dc:creator>
            <pubDate>Wed, 07 Jan 2015 19:21:32 GMT</pubDate>
            <atom:updated>2015-01-23T07:23:15.175Z</atom:updated>
            <content:encoded><![CDATA[<p>Note: there’s also a <a href="https://medium.com/@dmitriid/ok-w3c-and-whatwg-dont-die-but-7952221fcbe4">followup</a>.</p><p><em>tl;dr: W3C and WHATWG are a useless bloated bunch of people who don’t care in the least about making the web a better place. Both W3C and WHATWG should die a quick and horrible death, and the development of web standards should be given to a lean and mean group of people, all of whom are actual web developers.</em></p><p>ToC</p><ul><li>For the sake of all that’s good and holy: why?</li><li>{ vertical-align: fuck off, any-align: fuck-off }</li><li>Do you want to build a sand castle?</li><li>Is there a way out?</li></ul><h3>For the sake of all that’s good and holy: why?</h3><p>Web-developers have the worst ever Stockholm syndrome ever in the history of the world ever. Whatever inconherent inconsistent overlapping multi-million-page abomination of a spec spewn from either of the two committees we cheer them on and ask for more.</p><ul><li><a href="http://www.w3.org/TR/css3-grid-layout/">ASCII art</a>? OMG, the best thing since sliced cheese!</li><li>Oh, this ASCII art overlaps and reimplements partial implementations of the same <a href="http://www.w3.org/TR/css3-multicol/">fucking</a> <a href="http://www.w3.org/TR/css3-flexbox/">thing</a>? OMG, give me that and those two things, too!</li><li><a href="https://github.com/elitheeli/stupid-machines">Turing completeness</a> in HTML5+CSS? Woot! Woot! Exactly what we needed all this time!</li></ul><p>And this just goes on.</p><p>Why do we keep believing that these self-aggrandizing bloated useless monstrosities work to make the lives of developers easier? Or the web better? What evidence is there?</p><h3>{ vertical-align: fuck off, any-align: fuck-off }</h3><h3>Lewis King on Twitter</h3><p>We have landed a robot on a comet 317 million miles from Earth and yet we still can&#39;t vertically align things easily in CSS.</p><p>Yes, it’s true, folks. In the age of SOA applications, and facebooks, and twitters and mediums, there’s still no way to align anything against anything.</p><p>Good fucking grief.</p><p>Please, do visit these two links, read, and weep: <a href="http://www.terrainformatica.com/htmlayout/fspu.whtm">%% units</a> and <a href="http://www.terrainformatica.com/htmlayout/flow.whtm">“flow” attribute</a>. Unlike W3C and WG, the author of these extensions uses them in commercial software that is actually used to build UIs. These extensions cover, oh, I don’t know, 80–90% of a web-developer’s needs?</p><p>So, here’s the story. <em>%% units</em> and the <em>“flow”</em> attribute were proposed to W3C. Can’t find the discussion now (it was 7 years ago, at the very least), but the proposal was shot down. Fast forward 7 years, and lo and behold: flexbox, grid-layout and multicol. Bloated, inconsistently named and overlapping each other. And yes <strong>fringe cases</strong>.</p><p>See, folks at W3C and WG act as if they were pure academics.</p><p>“Hey, guys, I have this purely theoretical problem which will look nice in a book somewhere. What do you think?”</p><p>“Awesome! Bring it on. No, bring two or three of those”</p><p>Just as an illustration, <a href="http://css-tricks.com/snippets/css/a-guide-to-flexbox/">http://css-tricks.com/snippets/css/a-guide-to-flexbox/</a></p><pre>.container { flex-direction: row | row-reverse | column | column-reverse; }</pre><ul><li>row (default): left to right in ltr; right to left in rtl</li><li>row-reverse: right to left in ltr; left to right in rtl</li><li>column: same as row but top to bottom</li><li>column-reverse: same as row-reverse but bottom to top</li></ul><p>Can you name/find a single person on this Earth who would need *-reverse directions? Yes, there could be a few: writing books and tutorials that will include this utterly useless piece of garbage. However, since this is a theoretical fringe case, it no doubt was discussed at length and included at the incsistence of “prominent members” of the W3C community.</p><p>Damn them all to hell.</p><p>Instead of solving real-world problems they play in a nice academical theoretical sandbox, solving non-existing problems. Look at each and every steaming pile of horse manure that they produce: all this bloat, all these insane attributes and measurements stem from the fact that someone somewhere produced an insanely convoluted theoretial example of a non-existent problem and produced a solution to it.</p><p>Obviously, it’s not constrained just to alignments. It’s 2015 and it’s still easier to make sites based on exact pixel measurements than sites based on relative percentages. It is impossible for any sane person to create a responsive site without the use of CSS Frameworks (which are themselves bloated and limiting — out of necessity, not by choice). Whole articles on how to vertically align elements or create proper three-column layouts still exist. And the list just goes on and on and on and on…</p><h3>Do you want to build a sand castle?</h3><p>Yes. Sand castles.</p><p><strong>There’s not a single reference implementation for any of the specs coming out of W3C and WG</strong></p><p>Re-read that sentence, and let that sink in. All these specs are purely theoretical constructs that are unleashed on browser implementors and then on web developers.</p><p>Hey, you thought Acid tests where the reference implementation? No. Those, too, are theoretical constructs created on a theoretical basis. No wonder browser developers often cheat to make sure their browser passes an Acid test, and only the Acid test, the actual spec implementation be damned.</p><p>I’m not even sure the people who come up with the crap they call specs even do any serious web development. I mean, look at W3C’s and WG’s web sites. That’s exactly the type of site you can build using their specs.</p><p>I’ll leave this as an excersise to you: go through specs, find their authors, and what they do. Look at their websites, demos etc. You’ll see what I mean. I kid you not, there’s a guy whose job description is “spec hacker”. Jesus…</p><h3>Is there a way out?</h3><p>Of course.</p><p>Nuke W3C and WHATWG out of existence. As soon as possible. Leave a small team of people (10, maybe 15, tops) to implement a backwards incompatible lean and mean CSS 4:</p><ul><li>Get guys who created <a href="http://sass-lang.com/">SASS</a> to oversee/enforce, well SASS. Because, come on, how thick must you be to not come up with something like SASS in 20 years of CSS’ existence? Oh, right, you have to be W3C, of course, duh</li><li>Apple implemented <a href="http://en.wikipedia.org/wiki/Cassowary_(software)">Cassowary Constraint Solver</a> for their <a href="https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/AutolayoutPG/Introduction/Introduction.html">UI</a>s. Get them and the authors of Cassowary, one of whom implemented it for the <a href="http://gridstylesheets.org/">web</a>, to enforce this as a new standard</li><li>Get people from Apple to implement all font-related specs. Because this:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/261/1*hbK7JQpVp00t-l-K_YEqSQ.jpeg" /></figure><ul><li>Let the guys from above work on specs for a year. After that open up for comments from people who actually build websites: Facebook, Gmail team (<em>not</em> Google, <em>not </em>Chrome team), Asana, even Medium. Ask actual people who build sites about what they want and need.</li><li>Implement/fix whatever issues/comments you gather from web-developers (leaving larger issues for next iteration). Release this as CSS4 spec:<br>- CSS4 cannot be mixed with CSS3 on the same page<br>- CSS4 is triggered either by media-type (text/css-v4), file extension (.css4), or embedded directive (/* css-v4 */), in this order<br>- work with browser implementors on implementing CSS4. They will thank you for that<br>- unleash it on the world. The world will thank you for that</li></ul><p>Last step:</p><p>Dig W3C and WHATWG out of their graves, kill and bury them again.</p><p><em>Don’t forget to read the </em><a href="https://medium.com/@dmitriid/ok-w3c-and-whatwg-dont-die-but-7952221fcbe4"><em>followup</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7cff5e1da8f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[О ЮЮ]]></title>
            <link>https://medium.com/gayropa-on-my-mind/faf6ea3833c8?source=rss-cfa467f09967------2</link>
            <guid isPermaLink="false">https://medium.com/p/faf6ea3833c8</guid>
            <dc:creator><![CDATA[Dmitrii]]></dc:creator>
            <pubDate>Sun, 28 Sep 2014 23:15:00 GMT</pubDate>
            <atom:updated>2015-01-21T17:27:47.007Z</atom:updated>
            <content:encoded><![CDATA[<p>Ваше «практическое видение, до чего скатилась Европа» кратко можно выразить так: «АААААА НЕПРАВИЛЬНО ПОСМОТРИШЬ НА РЕБЕНКА ПРИДЕТ ЮЮ ЗАБЕРЕТ РЕБЕНКА ДАЖЕ В ПОХОД НЕ ПОЙДЕШЬ ВСЕ ЖИВУТ В СТРАХЕ ТЫСЯЧИ ДЕТЕЙ ЗАБРАЛИ ИЗ СЕМЕЙ ВСЕ БОЯТСЯ».</p><p>При этом реальность такова:</p><p>1. Я наблюдаю сотни детей всех возрастов (начиная класса с третьего), которые, например, самостоятельно передвигаются по городу. Даже зимой, когда световой день — четыре часа, а в 8, когда большинство идет в школу, на улице темень. Более того, каждое утро наблюдаю трех пацанов лет 12–13, которые едут 20 минут на пригородной электричке, а потом едут на автобусе еще 20 минут до школы. Каждый будний день. И ничего, дети спокойны, счастливы, за родителями ЮЮ не приходит</p><p>2. Я наблюдаю каждый день родителей на велосипедах, за которыми едут дети разных возрастов на велосипедах. В том числе по велосипедным дорожкам, проходящим по проезжей части, и через сложные перекрестки. ЮЮ не приходит.</p><p>3. На детских площадках я постоянно наблюдаю детей, спокойно играющих на вполне себе травмоопасных площадках <a href="https://scontent-b.xx.fbcdn.net/hphotos-xpf1/t1.0-9/p180x540/10517545_10152505636686049_4409467245744960313_n.jpg">типа</a> <a href="https://scontent-b-ams.xx.fbcdn.net/hphotos-xap1/t1.0-9/p180x540/10509665_10152505636806049_9063434726077194602_n.jpg">таких</a>, причем часто родителей там намного меньше, чем детей, или они сидят на достаточном удалении. Никакой ЮЮ не приходит</p><p>4. Я наблюдаю детей, которых родители спокойно водят (или дети сами ходят) на множество травмоопасных видов спорта — хоккеи, футболы, велосипеды, хайкинги — да все подряд. Про катание на городских публичных катках в любое время суток я вообще промолчу. Никакое ЮЮ не приходит.</p><p>5. Я наблюдаю детей, которых родители учат кататься на лыжах на красных склонах (очень редко, но бывает, и на черных. Но там уже скорее не обучение, а просто совместное катание). Я наблюдаю детей разного возраста, которые самостоятельно катаются на склонах любой сложности. ЮЮ не приходит.</p><p>6. Я наблюдаю людей, которые уходят с детьми в леса на хайкинг, кэмпинг на неделю-две-три, в любое время года. ЮЮ не приходит.</p><p>7. Я наблюдаю людей, которые уходят с детьми в морское плавание на на неделю-две-три. Отдаленный знакомый вообще летом уходит в море с детьми на полтора месяца и пристает к плавучим гостиницам раз в неделю, принять душ и пополнить запасы еды. ЮЮ не приходит.</p><p>8. Я наблюдаю людей, у которых теряются дети. Они обращаются в полицию, полиция находит детей. Первый вопрос, который они задают: «Объясните, почему от вас убежал ребенок», записывают ответ, отдают ребенка и все. ЮЮ не приходит.</p><p>9. Я наблюдаю людей, которые приходят с детьми купаться, когда на улице 12–15 градусов, а температура воды — градусов 9–10. ЮЮ не приходит</p><p>10. Я наблюдаю людей, которые со смехом, или со страхом, или с ужасом, или с облегчением от пережитого рассказывают, как дети получают или почти получают травмы — обжегся о плиту, упал с качелей, споткнулся и ударился, поцарапала когка, коляска наткнулась на бордюр и перевернулась, подрались в школе. ЮЮ не приходит</p><p>11. Я наблюдаю родителей, которые наказывают детей: отказывают в сладком, отказывают смотреть телевизор, играть в приставки, отсылают раньше спать. ЮЮ не приходит.</p><p>Если все, что вы умеете делать с детьми — это орать на них и бить по жопе по первому же поводу — это ваши проблемы, и к вам придет ЮЮ. Но даже тогда у вас ребенка <a href="http://www.rsdn.ru/forum/flame.politics/5717294.1">не заберут</a>, если вы не будете упорствовать в своем «как это, мне кто-то будет говорить, как воспитывать детей?». Поэтому вы так до судорог боитесь стран, где такие методы «воспитания» запрещены. Вы не представляете, что может быть по-другому. И такие, как вы, к сожалению, не единственные. И к таким — да, приходит ЮЮ. И да, у таких да, забирают детей.</p><p>Но это не проблема ЮЮ. А проблема таких, как вы.</p><p>Также отсюда <a href="http://rsdn.ru/forum/flame.politics/5860884.1">http://rsdn.ru/forum/flame.politics/5860884.1</a></p><p>Sinclair:</p><p>I&gt;Да мы как раз никуда не едем. Смотрим отсюда, ужасаемся и говорим, что видали мы такую европейскую культуру в гробу в белых тапочках.<br>Ну, так ведь раздуваются-то истории как раз про тех, кто едет. У тех, кто никуда не едет, никакие голландцы ещё детей не отобрали.<br>Нужно понимать, что “отсюда” вы смотрите, мягко говоря, пропаганду. Которая берёт, скажем, три случая за год на всю европу (over 800 миллионов человек, есличё), и раздувает из этого про “бесправие европейских родителей” и пугает тем, что если будем плохо себя вести, то европа и нам это навяжет.</p><p>Я лично как бы не большой фанат европейских ценностей. Но при этом меня очень мало беспокоит то, что там делает ювенальная юстиция в Норвегии или Голландии. Меня гораздо больше беспокоит частота случаев вроде “отец убил двухлетнего ребёнка, который отказывался есть кашу”, происходящих в радиусе 30 км от меня. Что характерно, никакой Астахов к нам не приезжает. Эти случаи не получают освещения на первом канале. Только местный новостной портал их и публикует.</p><p>А ещё больше меня беспокоит то, что окружающие меня в сети люди почему-то озабочены проблемами голландских детей больше, чем проблемами новосибирских детей.<br>Хотя логично было бы наоборот — сначала довести уровень подростковых самоубийств и убийств несовершеннолетних хотя бы до уровня той же Италии. А потом уже вмешиваться в их культурные традиции, и обяснять, что российские педагогические практики — самые передовые.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=faf6ea3833c8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gayropa-on-my-mind/faf6ea3833c8">О ЮЮ</a> was originally published in <a href="https://medium.com/gayropa-on-my-mind">Gayropa on my mind</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Рождаемость]]></title>
            <link>https://medium.com/gayropa-on-my-mind/-4a93925151eb?source=rss-cfa467f09967------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a93925151eb</guid>
            <dc:creator><![CDATA[Dmitrii]]></dc:creator>
            <pubDate>Sun, 28 Sep 2014 22:40:57 GMT</pubDate>
            <atom:updated>2014-10-26T10:18:16.364Z</atom:updated>
            <content:encoded><![CDATA[<p>Заготовка, собранная из одного из сообщений на d3.ru.</p><p>Следите за руками:</p><h4>Швеция</h4><p>— коэффициент фертильности <a href="https://www.google.com/search?client=safari&amp;rls=en&amp;q=children+per+woman&amp;ie=UTF-8&amp;oe=UTF-8#q=Sweden+fertility+rate&amp;rls=en">1.90</a></p><p>— фертильность <a href="http://en.wikipedia.org/wiki/Demographics_of_Sweden#Vital_statistics_since_1900">по годам</a>:</p><p>— — самая низкая (1.50) в 1999–м году</p><p>— — в 2012–м — 1.92, что выше, чем в 2011–м и рекордом не является</p><p>— <a href="http://www.thelocal.se/20081103/15408">иммигранты против коренных</a>:</p><p>— — иммигранты: 2.21</p><p>— — коренные: 1.82</p><p>— — коэффициент рождаемости иммигрантов постепенно приближается к к.р. коренных (см. последний абзац)</p><p>— <a href="http://www.ssd.scb.se/databaser/makro/Visavar.asp?yp=tansss&amp;xu=C9233001&amp;omradekod=BE&amp;huvudtabell=BefProgFruktFodLGr&amp;omradetext=Befolkning&amp;tabelltext=Summerade+fruktsamhetstal+efter+moderns+f%F6delselandgrupp%2E+Prognos%E5r+2008+%2D+2110&amp;preskat=O&amp;prodid=BE0401&amp;deltabell=&amp;deltabellnamn=Summerade+fruktsamhetstal+efter+moderns+f%F6delselandgrupp%2E+Prognos%E5r+2008+%2D+2110&amp;innehall=Fruksamhet&amp;starttid=2008&amp;stopptid=2110&amp;Fromwhere=M&amp;lang=1&amp;langdb=1">здесь</a> можно самому в этом убедиться. В частности с 2008 по 2014(прогноз):</p><p>— — к.р. шведов медленно растет вверх: с 1.829 до 1.849</p><p>— — к.р. иммигрантов из Европы (исключая ЕС) падает: с 2.22 до 2.106</p><p>— — к.р. иммигрантов из стран с низким индексом человеческого развития падает: с 3.186 до 2.825</p><p>— — к.р. иммигрантов из стран со средним индексом человеческого развития медленно падает: с 2.432 до 2.264</p><p>— — к.р. иммигрантов из стран с высоким индексом человеческого развития остается неизменным, на уровне шведов: 1.864</p><h4>Россия</h4><p>— коэффициент фертильности <a href="https://www.google.com/search?client=safari&amp;rls=en&amp;q=fertility+rate+russia&amp;ie=UTF-8&amp;oe=UTF-8">1.54</a></p><p>— <a href="http://ru.wikipedia.org/wiki/%D0%A1%D1%83%D0%BC%D0%BC%D0%B0%D1%80%D0%BD%D1%8B%D0%B9_%D0%BA%D0%BE%D1%8D%D1%84%D1%84%D0%B8%D1%86%D0%B8%D0%B5%D0%BD%D1%82_%D1%80%D0%BE%D0%B6%D0%B4%D0%B0%D0%B5%D0%BC%D0%BE%D1%81%D1%82%D0%B8#.D0.A0.D0.BE.D1.81.D1.81.D0.B8.D1.8F">коэффициент фертильности по регионам</a>:</p><p>— — в 2012–м к.р: 1.61 по данным Росстата</p><p>— — максимальное значение — в Чечне: 3.362 (в целом по Кавказу — 2.006, выше, чем в любом другом регионе), но даже это не помогает общей картине</p><h4>Молдова</h4><p>— кожффициент рождаемости <a href="https://www.google.com/search?client=safari&amp;rls=en&amp;q=moldova+fertility+rate&amp;ie=UTF-8&amp;oe=UTF-8">1.46</a></p><h4>Мир</h4><p>— <a href="http://www.ted.com/talks/hans_rosling_religions_and_babies.html">Лекция Ханса Рослинга</a> на TED Talks: с увеличением благосостояния и доступа к нормальной медицине к.р. резко падает до 2 детей на женщину, вне зависимости от климата, географии и религии, есть русские субтитры.</p><p>— Все эти данные можно проверить в <a href="http://www.google.com/publicdata/directory">Google Public Data Explorer</a>. Например, прекрасный график (по годам): <a href="http://www.google.com/publicdata/explore?ds=d5bncppjof8f9_&amp;ctype=b&amp;strail=false&amp;nselm=s&amp;met_x=sp_dyn_le00_in&amp;scale_x=lin&amp;ind_x=false&amp;met_y=sp_dyn_tfrt_in&amp;scale_y=lin&amp;ind_y=false&amp;met_s=sp_pop_totl&amp;scale_s=lin&amp;ind_s=false&amp;dimp_c=country:region&amp;ifdim=country&amp;iconSize=0.5&amp;uniSize=0.035#!ctype=b&amp;strail=false&amp;bcs=d&amp;nselm=s&amp;met_x=sp_dyn_le00_in&amp;scale_x=lin&amp;ind_x=false&amp;met_y=sp_dyn_tfrt_in&amp;scale_y=lin&amp;ind_y=false&amp;met_s=sp_pop_totl&amp;scale_s=lin&amp;ind_s=false&amp;dimp_c=country:region&amp;ifdim=country&amp;pit=1296601200000&amp;hl=en_US&amp;dl=en_US&amp;ind=false">живи дольше, с меньшим коэффициентом рождаемости</a>. Прекрасно показывает, как за последние 50 лет резко упал к.р. по всему миру.</p><p>— эти же данные соответсвуют отчету ООН <a href="http://www.un.org/esa/population/publications/longrange2/WorldPop2300final.pdf">World Population to 2300</a> (см. графики в отчете)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a93925151eb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gayropa-on-my-mind/-4a93925151eb">Рождаемость</a> was originally published in <a href="https://medium.com/gayropa-on-my-mind">Gayropa on my mind</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>