<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alexey Voinov</title>
    <description>The latest articles on DEV Community by Alexey Voinov (@voins).</description>
    <link>https://dev.to/voins</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F19975%2F82e28a80-1d86-4bb0-a05a-96539100b13a.jpeg</url>
      <title>DEV Community: Alexey Voinov</title>
      <link>https://dev.to/voins</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/voins"/>
    <language>en</language>
    <item>
      <title>On code::dive 2019</title>
      <dc:creator>Alexey Voinov</dc:creator>
      <pubDate>Fri, 22 Nov 2019 00:40:10 +0000</pubDate>
      <link>https://dev.to/voins/on-code-dive-2019-24dn</link>
      <guid>https://dev.to/voins/on-code-dive-2019-24dn</guid>
      <description>&lt;p&gt;Amazing crowd. I haven't seen so many geeks at one place for a very long time. I was actually surprised with the quality of questions. Many of them were very deep.&lt;/p&gt;

&lt;p&gt;Amazing speakers. I must admit, that watching videos of cool conference talks and actually being there is not the same at all. I almost forgot how it really feels.&lt;/p&gt;

&lt;p&gt;Amazing city. Wroclaw is very cozy. I know nothing about the feelings of the people who lives there, but from my touristic point of view it is very close to perfect. (And looking fir little dwarves, scattered everywhere is really fun.)&lt;/p&gt;

&lt;p&gt;I'm very happy, that my return to conference life started there. Even though I've been merely an attendee this time. I would certainly recommend this conference to everyone who's interested in C++ and everything related.&lt;/p&gt;

&lt;p&gt;If you have no idea what I'm writing about, go there: &lt;a href="http://codedive.pl"&gt;http://codedive.pl&lt;/a&gt;, read and find some videos.&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>techtalks</category>
    </item>
    <item>
      <title>On not-so-smart coding standards</title>
      <dc:creator>Alexey Voinov</dc:creator>
      <pubDate>Tue, 18 Jun 2019 20:44:07 +0000</pubDate>
      <link>https://dev.to/voins/on-not-so-smart-coding-standards-29jn</link>
      <guid>https://dev.to/voins/on-not-so-smart-coding-standards-29jn</guid>
      <description>&lt;p&gt;Sometimes bad naming conventions are biting us. Long before I joined the project someone decided that every class should have a 'C' prefix to its name. So, instead of Window we have CWindow etc. And all those reside in files named without the initial 'C'. This rule has a very nice side effect.&lt;/p&gt;

&lt;p&gt;Can you guess what class is in the file called Logger.cpp? :)&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>codequality</category>
    </item>
    <item>
      <title>On Job Interviews</title>
      <dc:creator>Alexey Voinov</dc:creator>
      <pubDate>Wed, 13 Feb 2019 15:36:08 +0000</pubDate>
      <link>https://dev.to/voins/on-job-interviews-3o65</link>
      <guid>https://dev.to/voins/on-job-interviews-3o65</guid>
      <description>&lt;p&gt;Just imagine what would they ask a published novelist, if they wanted to hire one:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;do you know what a comma is?&lt;/li&gt;
&lt;li&gt;please, tell me something about words.&lt;/li&gt;
&lt;li&gt;how do you write a word using letters? you know about letters, do you?&lt;/li&gt;
&lt;li&gt;could you please write a question? just any question.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And after he politely pointed out that he obviously knows all of that stuff and much more, they switch to "advanced" questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;have you ever heard of an "oxford comma"? (in a very suspicious voice)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;That's my very recent experience with one very large international investment bank. Almost literally.&lt;/p&gt;

</description>
      <category>career</category>
    </item>
    <item>
      <title>On typical naming anti-pattern in Java</title>
      <dc:creator>Alexey Voinov</dc:creator>
      <pubDate>Thu, 02 Aug 2018 08:55:12 +0000</pubDate>
      <link>https://dev.to/voins/on-typical-naming-anti-pattern-in-java-2od</link>
      <guid>https://dev.to/voins/on-typical-naming-anti-pattern-in-java-2od</guid>
      <description>&lt;p&gt;I think one word summarises it all: &lt;em&gt;OneEyedOneHornedFlyinPurplePeopleEater&lt;/em&gt;. Every time I see a typical javish 40+ character class name often composed of several short sentences, I remember this song and silently sing it a little bit. I think I'll give it a try to sing it aloud for a change. :)&lt;/p&gt;

&lt;p&gt;Anyway, I believe it is a great name for this anti-pattern. Opinions?&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/X9H_cI_WCnE"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>java</category>
      <category>cleancode</category>
    </item>
    <item>
      <title>On wrappers for standard library</title>
      <dc:creator>Alexey Voinov</dc:creator>
      <pubDate>Thu, 19 Apr 2018 20:53:05 +0000</pubDate>
      <link>https://dev.to/voins/on-wrappers-for-standard-library-59bm</link>
      <guid>https://dev.to/voins/on-wrappers-for-standard-library-59bm</guid>
      <description>&lt;p&gt;Every language has a standard library. Everybody uses it. Not everybody likes it. There are a couple of problems with standard libraries: they have to satisfy everybody and they have to be compatible at least with couple of previous versions (well, if the language is worth using). Sometimes I cannot help but notice that I am writing the same code over and over again just because the standard library was designed that way long time ago and even though there are already new tools present they have to support compatibility. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;size_type&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;filename&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;find_last_of&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;npos&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="c1"&gt;// use p in some meaningful way&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;when there’s already &lt;code&gt;std::optional&amp;lt;&amp;gt;&lt;/code&gt;, or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="n"&gt;loglist_t&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;iterator&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;loggers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;loggers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="c1"&gt;// dereference i and use the result&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="n"&gt;getSomeOptional&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;map&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nl"&gt;Optional:&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="n"&gt;of&lt;/span&gt;&lt;span class="o"&gt;).&lt;/span&gt;&lt;span class="na"&gt;orElse&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;getSecondOptional&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;when there’s &lt;code&gt;Optional::or()&lt;/code&gt; already, but my employer doesn’t plan to switch to Java 9. I would love to put those pieces of code into some small methods, but where should I place them?&lt;/p&gt;

&lt;p&gt;There is actually a very simple solution to this problem. I was a bit surprised to find out that it is described in details in Uncle Bob’s “Clean Code” in chapter 8, but for some reason I’ve never seen this approach actually implemented. We just need to create wrappers for everything we use from the standard library, but everyone is busy creating alternative implementations instead. Let me tell you a secret: modern compilers are very good at optimisations and this wrapper will probably cost you nothing or almost nothing. All of sudden magic happens, and you have home for a bunch of utility methods you used to make static and put in &lt;code&gt;OptionalUtil&lt;/code&gt; class, or you don’t care if your compiler renamed &lt;code&gt;std::experimental::optional&lt;/code&gt; to &lt;code&gt;std::optional&lt;/code&gt;, because only a single line will be changed in your application, or you can create better API for strings and utilise aforementioned &lt;code&gt;std::optional&lt;/code&gt;, or you can implement methods from newer version of standard library and happily use it already, or … you name it.&lt;/p&gt;

&lt;p&gt;The only drawback I see here is it’s very easy to get used to those wrappers, and when you move to another project, you’ll be missing them. But you already know what to do, don’t you?&lt;/p&gt;

</description>
      <category>cleancode</category>
    </item>
    <item>
      <title>Does anybody know a good working C++ formatting tool?</title>
      <dc:creator>Alexey Voinov</dc:creator>
      <pubDate>Wed, 31 Jan 2018 18:54:50 +0000</pubDate>
      <link>https://dev.to/voins/does-anybody-know-a-good-working-c-formatting-tool-2lpi</link>
      <guid>https://dev.to/voins/does-anybody-know-a-good-working-c-formatting-tool-2lpi</guid>
      <description>&lt;p&gt;I've tried &lt;a href="https://clang.llvm.org/docs/ClangFormat.html" rel="noopener noreferrer"&gt;clang-format&lt;/a&gt;. It doesn't do what I need, it is not very flexible and authors are refusing to create additional formatting options. But the main problem for me is that it cannot do incremental formatting. I cannot say: do just indentation and leave everything else as it is. It force to do my pet project in some corporate style, preventing even possibility of experiments with style.&lt;/p&gt;

&lt;p&gt;I've tried &lt;a href="http://astyle.sourceforge.net" rel="noopener noreferrer"&gt;astyle&lt;/a&gt;. It doesn't support complicated things like clang-format do, but it does a lot of options, and most of all, it does support incremental formatting. The problem is it fails to produce correct results on longer files. Looks like some buffer processing problem, because about every 300th line got weird. Sometimes even with syntax errors.&lt;/p&gt;

&lt;p&gt;I've tried &lt;a href="http://uncrustify.sourceforge.net" rel="noopener noreferrer"&gt;uncrustify&lt;/a&gt;. So far it is the best choice, but it still has some drawbacks. The configuration is really cryptic and I can't say that it is documented enough. I was able to configure it to do indentation only. And... it looks like it cannot properly indent nested classes.&lt;/p&gt;

&lt;p&gt;Yes, I know, all of them are open source projects and can fix them or change them as I like. But first, that's not what I want to do right now, and second, I don't want to end up supporting my own private branch and spend time incorporating my changes on every version update or stick to some old and obsolete modified version.&lt;/p&gt;

&lt;p&gt;Any other options?&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>cpp</category>
      <category>formatting</category>
    </item>
    <item>
      <title>On HackerX/Brno event</title>
      <dc:creator>Alexey Voinov</dc:creator>
      <pubDate>Fri, 01 Dec 2017 20:07:32 +0000</pubDate>
      <link>https://dev.to/voins/on-hackerxbrno-event-7o</link>
      <guid>https://dev.to/voins/on-hackerxbrno-event-7o</guid>
      <description>&lt;p&gt;I had quite an interesting experience yesterday. I've attended &lt;a href="https://www.hackerx.org"&gt;HackerX&lt;/a&gt; event. It's kind of speed dating between companies and potential employees. Totally worth attending even if you're not looking for a new job. (And not only because of free food. :) ).&lt;/p&gt;

&lt;p&gt;The main point for me was, that I found out, that I have a unique proposition for any potential employer: I'm not afraid of working with legacy code, I know how to work with it, and I actually &lt;a href="https://dev.to/voins/is-legacy-code-that-bad"&gt;love working with it&lt;/a&gt;. Almost everyone I met yesterday had some project that requires someone like me, and they're unable to find such person.&lt;/p&gt;

&lt;p&gt;I guess it is possibly true for everyone attending. Even without previous experience, and without any kind of preparation, you still can "extract" the essence of yourself during those 5 minute interviews. When all you've got is those 5 minutes, you tend to concentrate. And then those 5 minutes are repeated many times, and you are trying to say something relevant about yourself, and those guys on the other side of the table keep asking questions important to them, and it starts to look very much like some iterative process, and during those iterations you're getting closer and closer to understanding what's so good about you, what others see in you and what you can offer to the world. That's a really cool feeling. I wish there was more companies, but I got the idea even with those we had present.&lt;/p&gt;

&lt;p&gt;It's a pity, I cannot legally change my employer right now... :)&lt;/p&gt;

</description>
      <category>career</category>
    </item>
    <item>
      <title>A little rant on naming things</title>
      <dc:creator>Alexey Voinov</dc:creator>
      <pubDate>Tue, 21 Nov 2017 15:56:59 +0000</pubDate>
      <link>https://dev.to/voins/a-little-rant-on-naming-things-386</link>
      <guid>https://dev.to/voins/a-little-rant-on-naming-things-386</guid>
      <description>&lt;p&gt;Oh, how I'd love to forbid usage of &lt;code&gt;info&lt;/code&gt;, &lt;code&gt;data&lt;/code&gt;, and &lt;code&gt;context&lt;/code&gt; in variable and class names. Looks like everybody is using it without understanding what they really means. Who's able to tell the difference between &lt;code&gt;accountData&lt;/code&gt;, &lt;code&gt;accountInfo&lt;/code&gt; and just &lt;code&gt;account&lt;/code&gt;? Especially if they're in the same method. Or maybe what the hell is 'fieldContext' if that's the property of the field, and not something defining environment, where the field is used (or evaluated). Or maybe difference between three classes all named &lt;code&gt;SearchContext&lt;/code&gt;, with nothing in common. And yes, they're all used in the same project and sometimes even in the same packages.&lt;/p&gt;

&lt;p&gt;One other thing I like so much about naming: it is &lt;code&gt;handle&lt;/code&gt; or &lt;code&gt;process&lt;/code&gt; in the method names. Especially when this method is several hundred lines long. For me it is just like the giant sign above the method: "I don't know the hell what this method does or should do. Sincerely yours. Author."&lt;/p&gt;

&lt;p&gt;Sorry, I think I need to go try some Vulcan meditation techniques now.&lt;/p&gt;

</description>
      <category>cleancode</category>
    </item>
    <item>
      <title>Did you ever try to write Java equals() with clean code style?</title>
      <dc:creator>Alexey Voinov</dc:creator>
      <pubDate>Sat, 02 Sep 2017 07:49:23 +0000</pubDate>
      <link>https://dev.to/voins/did-you-ever-try-to-write-java-equals-with-clean-code-style</link>
      <guid>https://dev.to/voins/did-you-ever-try-to-write-java-equals-with-clean-code-style</guid>
      <description>&lt;p&gt;I've tried several ways of splitting it. All of them seem to be equally unreadable.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>cleancode</category>
    </item>
    <item>
      <title>One tiny detail about The Saff Squeeze</title>
      <dc:creator>Alexey Voinov</dc:creator>
      <pubDate>Fri, 11 Aug 2017 13:44:17 +0000</pubDate>
      <link>https://dev.to/voins/one-tiny-detail-about-the-saff-squeeze</link>
      <guid>https://dev.to/voins/one-tiny-detail-about-the-saff-squeeze</guid>
      <description>&lt;p&gt;The Saff Squeeze technique, introduced by Kent Beck few years ago is very nice. (Unfortunately, the original article has long gone, but there's an archived copy: &lt;a href="https://web.archive.org/web/20090301204625/http://www.threeriversinstitute.org/HitEmHighHitEmLow.html"&gt;Hit 'Em High, Hit 'Em Low&lt;/a&gt;) There's just one extra detail, worth noting. If you write a failing test, then on every failure, you'll need to check how exactly how it failed. Because if the reason for failure has changed, it means you did something wrong, and it's time to go one step back. But there's a trick. If you rewrite the test so it asserts on the wrong behaviour, it will be green (until you fix the code, of course). And what it means, is that your code is &lt;em&gt;failing in a certain known way&lt;/em&gt;. No surprises. I find this variation to be a bit more convenient.&lt;/p&gt;

</description>
      <category>tdd</category>
    </item>
    <item>
      <title>A short note about failing tests</title>
      <dc:creator>Alexey Voinov</dc:creator>
      <pubDate>Wed, 19 Jul 2017 17:28:56 +0000</pubDate>
      <link>https://dev.to/voins/a-short-note-about-failing-tests</link>
      <guid>https://dev.to/voins/a-short-note-about-failing-tests</guid>
      <description>&lt;p&gt;I've just noted, that when you are in the stage of failing test, not only it is the great time to make sure your test actually tests something, but also it is a chance to see &lt;em&gt;how&lt;/em&gt; it fails, and see if you can decipher the output, and make any sense of it. I believe it is a very good time to think about the names of methods, variables etc.&lt;/p&gt;

</description>
      <category>unittesting</category>
      <category>tdd</category>
    </item>
    <item>
      <title>Is legacy code that bad?</title>
      <dc:creator>Alexey Voinov</dc:creator>
      <pubDate>Tue, 04 Jul 2017 21:26:32 +0000</pubDate>
      <link>https://dev.to/voins/is-legacy-code-that-bad</link>
      <guid>https://dev.to/voins/is-legacy-code-that-bad</guid>
      <description>&lt;p&gt;I took almost 30 years of professional programming to understand my real passion in it. Oddly enough it appears to be working with legacy code. Don't get me wrong, I don't like legacy code at all. I swear all the time, while I work with it.&lt;/p&gt;

&lt;p&gt;But just think about it for a bit, legacy code comes already packed with all its real life usages. If  it's a piece of big proprietary monolith, then everything is there. Just start your favorite IDE and let it help you. If it is some open source project, you're probably aware of some other projects using it. You may even have a chance to find them all, if you care to look really good.&lt;/p&gt;

&lt;p&gt;Therefore, you can refactor all your way, basing your decisions on actual data, instead of guesses, like when you work with completely fresh code, which was never really used. And when you see that old rusty code improves after your changes, it feels sooo good. :) &lt;/p&gt;

</description>
      <category>legacy</category>
    </item>
  </channel>
</rss>
