<?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[Coding Big — The Crowdfire Engineering Blog - Medium]]></title>
        <description><![CDATA[We’re the developers of Crowdfire and this is where we share the technical aspects and challenges of building a product that is helping over 15 million users. Join our tribe: https://careers.crowdfireapp.com/ - Medium]]></description>
        <link>https://medium.com/crowdfire-tech?source=rss----212c5945ed6c---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Coding Big — The Crowdfire Engineering Blog - Medium</title>
            <link>https://medium.com/crowdfire-tech?source=rss----212c5945ed6c---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 03:54:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/crowdfire-tech" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Dealing With Errors in Go Projects]]></title>
            <link>https://medium.com/crowdfire-tech/dealing-with-errors-in-go-projects-36aa09fc1496?source=rss----212c5945ed6c---4</link>
            <guid isPermaLink="false">https://medium.com/p/36aa09fc1496</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Crowdfire Engineering]]></dc:creator>
            <pubDate>Fri, 15 Sep 2017 16:01:01 GMT</pubDate>
            <atom:updated>2017-09-15T16:01:01.617Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zf-PAHOjW70eF-wWOjNpUg.png" /><figcaption><a href="http://reneefrench.blogspot.in/">Gopher Design by Renee French</a></figcaption></figure><p>I come from a NodeJS background and my coding habits have been heavily influenced by the paradigms most used in Node. I started coding in Go quite recently and I immediately fell in love with the language. I love a lot of things about Go, but let’s not get into that right now or we’ll never get to the point.</p><p>Let’s talk, instead, of what caused me a lot of headache and frustration: <strong>errors</strong>.</p><p>I didn’t know what to do with the darned things. The idiomatic way in Go is to return errors as a second value and that’s what pretty much all libraries do. There is a panic-recover mechanism but I’ve found it being used to recover from things like illegal memory access or nil pointer dereference (which shouldn’t happen if you code properly).</p><p>My only viable choices were either handling and logging errors on the spot, or returning them up the chain of function calls. Neither sounded like a good idea. Here’s why:</p><p><strong>If you handle errors on the spot and log them</strong> you lose context of the steps that led to this error. You can log variables local to the function where the error occured, but you have no idea what path your program took to finally call this function and face this error.</p><p><strong>If you return errors up the chain</strong> and then handle them at the top-most level, you end up with almost the same thing. You have the error and you know which entry point of your function eventually led to that error, but now you’ve lost context of the function where the error originated.</p><p>Neither is a good idea, especially not at 4 in the morning when your boss calls you up to debug some obscure bug made all the more obscure by insufficient information. You need to know where the error originated, which entry point led to it and what path it followed. And of course, the details of the error itself.</p><p>To work around these issues, I had this idea of annotating the error message at each stage. So say I have the following extremely contrived code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a9dc1b3fde4224de63b1e202522a2de9/href">https://medium.com/media/a9dc1b3fde4224de63b1e202522a2de9/href</a></iframe><p>By concatenating the errors at each step I retain context. At the top level, when I log, I can see the calls that led to the error. This is better than not having much context but is extremely tedious in practice.</p><p>Then I came across <a href="https://dave.cheney.net/2016/06/12/stack-traces-and-the-errors-package">this excellent blog post</a> by Dave Cheney. And once you’ve read through it (seriously, read through it before continuing), you’ll see that he’s implemented the same idea I had but done it a gazillion times better. So I started perusing more things he’d written. The presentation link includes most of the content of the preceding articles.</p><ul><li><a href="https://dave.cheney.net/2016/04/07/constant-errors">Constant Errors</a></li><li><a href="https://dave.cheney.net/2016/04/27/dont-just-check-errors-handle-them-gracefully">Don’t just check errors, handle them gracefully</a></li><li><a href="https://dave.cheney.net/2014/12/24/inspecting-errors">Inspecting Errors</a></li><li><a href="https://godoc.org/github.com/pkg/errors">pkg/errors</a></li><li>Dave Cheney’s presentation on Error Handling <a href="https://www.youtube.com/watch?v=lsBF58Q-DnY">youtube</a> <a href="https://dave.cheney.net/paste/gocon-spring-2016.pdf">pdf</a></li></ul><p>After reading through all that and tinkering around for a while, I came up with a set of sensible guidelines for handling errors. Some of them are taken directly from Dave Cheney’s blog, some I added based on my own experiences.</p><h3>Let’s Begin</h3><ul><li><strong>Always</strong> check for errors if the function returns one. I know that sounds obvious but you’d be surprised at how much code I’ve seen that doesn’t do this.</li><li>Create custom error types for the errors you <em>know</em> you are gonna face (bad input, duplicate request, etc.). Return these, wrapped by the errors package, when you face them.</li><li>When dealing with errors returned from a library, wrap it with errors.Wrap or errors.Wrapfand return.</li><li>When dealing with errors returned from your own code, if:<br> — it requires no further context, just return it.<br> — if it requires some extra context (perhaps data points captured within that function), use Wrap or Wrapf.</li><li>Handle errors without further propagation at the entry point of your program (commands in a cli or handlers in a web server). Unwrap it with errors.Cause and test it:<br> — If it is of the custom type you have defined for your project, handle accordingly (you might wanna log these at level Error or Warning since these were expected). If it’s an endpoint facing your users, you might wanna have a contract with the client on what codes to return and act accordingly (you might even end up returning a generic error message). If it is an internal endpoint (think microservices), you could return an appropriate status code and message while logging the same.<br>— If it is of an unknown type, you might wanna log a fatal. This is an error that should never have happened. After that it’s up to you.</li></ul><p>I use these guidelines to make sure I have enough information during debugging to figure what’s going wrong. I still have to do error != nil everywhere but I think that’s not as bad a thing as I first thought. Unlike exception propagation, this way of doing things makes me stop and think at each step if I wanna let the error propagate on its own or add more context.</p><h3>Lastly</h3><p>This approach works for me, for now. Is there a better way to do this? I don’t know. There’s still a lot for me to learn and I’m hoping that as I keep coding, I’ll face enough new challenges to keep me reaching for better ways to code. I’d love to hear about your own experiences and challenges with Go. Hit me up on Twitter at <a href="http://twitter.com/@scionofbytes">@scionofbytes</a> or leave a comment below 👇</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/100/1*LAYhxZHlYzrF3lE4iejXxA.png" /><figcaption><a href="https://medium.com/u/39f2954e09bc">Shaun</a> is a Backend Developer at Crowdfire. He likes automating everything, including coffee breaks.</figcaption></figure><p><em>*</em><a href="http://scionofbytes.me/coding-practices/error-handling-in-go/"><em>This article was first published on Shaun’s Blog.</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36aa09fc1496" width="1" height="1" alt=""><hr><p><a href="https://medium.com/crowdfire-tech/dealing-with-errors-in-go-projects-36aa09fc1496">Dealing With Errors in Go Projects</a> was originally published in <a href="https://medium.com/crowdfire-tech">Coding Big — The Crowdfire Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why ORM shouldn’t be your best bet]]></title>
            <link>https://medium.com/crowdfire-tech/why-orm-shouldnt-be-your-best-bet-887e3e4ded2a?source=rss----212c5945ed6c---4</link>
            <guid isPermaLink="false">https://medium.com/p/887e3e4ded2a</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Crowdfire Engineering]]></dc:creator>
            <pubDate>Tue, 16 May 2017 16:01:02 GMT</pubDate>
            <atom:updated>2017-05-18T05:49:30.951Z</atom:updated>
            <content:encoded><![CDATA[<p>When I started programming a few years back, ORM was like the life blood of software projects. The environment emphasised the tight coupling between the code base and the ORM layer. It can be said that I was trained not to think of projects without an ORM.</p><p>But as I gained experience and deeper knowledge of specific projects, I realised that most of the improvements are ultimately coming to the point where the flow was entering into ORM framework. That was when I asked myself: <em>what if this project had no ORM?</em></p><p>I started thinking about the problems ORM had introduced:</p><ul><li>You can’t optimise your code even if you really need that extra burst of speed; ORM code lives in a land of its own.</li><li>Visibility into what is happening is at a minimum.</li><li>The documentation is usually massive and fragmented making it difficult to search for specifics.</li></ul><p>These may sound like small problems but they significantly hurt productivity. Apart from these, I realised that the ORM ecosystem is detached from mainstream web development with its own brand of issues and limitations. ORMs generally bring unnecessary complexity, providing “leaky abstraction” over database interactions. They sometimes have a steep learning curve and developers tend to treat them as a blackboxes.</p><p>I have seen developers take various approaches to tackle the ORM issue. Some completely remove ORM frameworks which is often a Herculean task depending on the complexity of the project. Some accept ORM and adapt code in their project; they’re ready to compromise on the performance and do not care about the added complexity. Many of them choose the golden path where they continue to use the ORM but new or complex queries are excluded. Some of them actually create their own mapping layer specific to the project and according to the need.</p><p>So far, I have worked with Hibernate (Java), and Mongoose (ORM framework in Node for MongoDB). When I came to a Node project which was already using Mongoose as an ORM, I had the monumental task of refactoring almost the entire project. At first I thought about removing the ORM framework altogether. But my fellow colleagues would not be satisfied without numbers backing me up. So I benchmarked the query time with and without Mongoose. Here are the results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SDPbY5d3RwhdfgN_BQoygA.png" /></figure><p>They took me by surprise. I had expected a performance gain when not using Mongoose but not to this extent. With this data in hand the choice was clear: ORM was out. A few months later, a <a href="https://medium.com/@aniketdivekar">colleague</a> asked me whether they should use <a href="https://github.com/sequelize/sequelize">Sequelize</a> or <a href="https://github.com/brianc/node-postgres">Pg</a> to access a Postgres database. Realising that Sequelize was an ORM, I gave my vote to Pg, but asked him to benchmark the two. I wanted to verify whether the ORM hate was justified and once the numbers came back, it turns out that it was, indeed, completely justified.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sJBKkiz4f0yQZ4XrhrH0jA.png" /></figure><p>Guess which library he went ahead with.</p><p>A thing to remember here is when we gave up ORMs, be it Mongoose or Sequelize, we were aware of what it was that we’re giving up. Specifically schema checking, pre-built methods, abstractions etc. were the perks of using an ORM framework. A major concern was the lack of schema checking (when not using ORMs), something that could lead to bad data entering the DB. To get around this we used <a href="https://github.com/hapijs/joi">Joi</a>, which made our task easier while keeping performance intact. For other parts we needed to write a few lines of extra code but it was worth it. Better that than lose tens of milliseconds (sometimes even seconds) on every query.</p><p>I am not trying to bash ORMs and they are really good for beginners and small scale projects. But when your project scales to a large number of queries and documents, ORMs can become a bottleneck. Think of it as the Vietnam of Computer Science - you need to decide when to pull out and run, or else major damage is unavoidable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/92/1*-gFpstQ1uEOMWG9n0CaSDQ.png" /><figcaption><a href="https://medium.com/u/df4c80a03c24">Amey</a> is the database guy at Crowdfire. He’s a Java, Node &amp; Go person, NoSQL addict, and a Big Data enthusiast.</figcaption></figure><p><em>*</em><a href="https://medium.com/@ameykpatil/why-orm-shouldnt-be-your-best-bet-fffb66314b1b"><em>This post was originally published on Amey’s Medium.</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=887e3e4ded2a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/crowdfire-tech/why-orm-shouldnt-be-your-best-bet-887e3e4ded2a">Why ORM shouldn’t be your best bet</a> was originally published in <a href="https://medium.com/crowdfire-tech">Coding Big — The Crowdfire Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RTL Support on Android — Here’s all you need to know]]></title>
            <link>https://medium.com/crowdfire-tech/rtl-support-on-android-heres-all-you-need-to-know-761ec131a53a?source=rss----212c5945ed6c---4</link>
            <guid isPermaLink="false">https://medium.com/p/761ec131a53a</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[language]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Crowdfire Engineering]]></dc:creator>
            <pubDate>Wed, 19 Apr 2017 12:08:46 GMT</pubDate>
            <atom:updated>2017-04-19T12:08:46.158Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5YFj_KqpwZIWp7lKcCTOeg.png" /></figure><p>There comes a point in an app’s lifecycle when you decide to widen your audience. Although your app works great and your daily downloads are off the charts, not everyone is happy. Why?🤔</p><p><em>No RTL (Right to Left) Layout support</em>.</p><p>A few languages — like Arabic, Hebrew or Persian — are written from Right to Left. To handle them, Android supports RTL layouts from API 17+ i.e., <em>Android 4.1 (Jelly Bean)</em>.</p><h3>Getting Started</h3><ul><li>In order to support RTL in your app, you first need to add android:supportsRtl=&quot;true&quot; to the &lt;application&gt; element in your manifest file.</li></ul><p>Woohoo… 🎉 Done!!! Your app now supports RTL. But lets see how it looks. You can check your app in RTL mode by doing one of two things.</p><ul><li>Select one of the RTL languages as your device language.</li><li>Or from Developer Options in Settings, check Force RTL layout Direction. I find this option more convenient but, do note, this does not change your System language.</li></ul><h3>XML Layouts</h3><p>You’ll need to make the following changes in all your Layouts</p><ul><li>If your app only supports API ≥ 17, replace all the layout_marginLeft/layout_marginReft/paddingLeft/paddingRight or any other Left and Right layout property with Start and End equivalent. For example android:paddingLeft will be replaced with android:paddingStart.</li><li>If your app supports API&lt;17 then instead of replacing the Left and Right layout properties, add their Start and End layout property equivalent alongside.</li></ul><p>There is a much easier way to do the above changes without going through all the files and then doing it manually. Android Studio can do this for you. Just go to Android Studio &gt; Refactor &gt; Add RTL support where possible…</p><p>I would recommend checking your app once after applying this change as you might not want all your Layouts/Views to be RTL. If you want to force any layout to LTR then just add android:layoutDirection=&quot;ltr&quot; to that view.</p><h3>Drawables</h3><p>Time to search for all those drawables that you’d want to mirror for RTL. Since resources can have variants based on device aspects like Orientation, Screen Density, API version, you can also have variants for different Layout Directions i.e., RTL or LTR. All you need to do is add the RTL variants of the drawables that you want to be mirrored.</p><h4>📌 Small Tip :</h4><blockquote>If your Toolbar defines back arrow nav icon like this <br><em>app:navigationIcon=&quot;?attr/homeAsUpIndicator&quot;</em><br>This back button is consistent with Layout Directions. <br>But only works on API 23+ <em>😣, below that it just points Left.</em></blockquote><p>And what if you don’t have RTL variant for your drawables? You can use android:<a href="https://developer.android.com/reference/android/R.attr.html#autoMirrored">autoMirrored</a>=&quot;true&quot;. But this works on api 19+ only. If you want to mirror Drawables or any View on API &lt;19, there is sort of a temporary workaround that can come in handy. You can just add android:rotationY=&quot;@integer/locale_mirror_flip&quot; to the View you want to be mirrored. And define</p><h4>res/values/integers.xml</h4><p>&lt;integer name=&quot;locale_mirror_flip&quot;&gt;0&lt;/integer&gt;</p><h4>res/values-ldrtl/integers.xml</h4><p>&lt;integer name=&quot;locale_mirror_flip&quot;&gt;180&lt;/integer&gt;</p><p>I used this trick to mirror a Progress Indicator that doesn’t support RTL. This works on API 11+.</p><h3>Animations</h3><p>Animations that use X axis for transitions will not work properly. For example TranslateAnimation — You will need to add a RTL variant for these as well. <br>For example: android:fromXDelta=&quot;-100%p&quot; will become android:fromXDelta=&quot;100%p&quot; in RTL variant of this animation, <br>android:pivotX=&quot;25%&quot; will become android:pivotX=&quot;75%&quot;.</p><h3>Java Files</h3><p>I would recommend defining all animations, layout, etc as xml resource only. Because RTL support for those programmatically defined layouts and animations is painful. Also, the compilation will take more time if you modify a Java file instead of XML.</p><p>If you still find these defined in your java files then this is what you’ll need to do:</p><ul><li>Programmatically defined Animations with X axis values need to have different values for RTL, as the X axis always starts from Left in both layout directions. Basically any X anywhere in android means from left.</li><li>If you have setMargin(left, top, right, bottom) then also add setMarginStart(start) and setMarginEnd(end).</li><li>setPadding(left, top, right, bottom) will be replaced with setPaddingRelative(start, top, end, bottom).</li><li>setGravity(Gravity.LEFT/RIGHT) will be replaced with setGravity(Gravity.START/END).</li><li>Any other layout property like LayoutParams rules for RelativeLayoutwill also need to be changed.</li><li>All those Horizontal RecyclerView, ListView, ViewPager, etc will need your attention as well. <br><strong><em>For Example</em></strong><em>: A Horizontal </em><em>RecyclerView can use </em><em>setStackFromEnd(true)on it’s </em><em>LayoutManager in case of RTL layout.</em></li><li>If you want Layout Direction of a View on runtime then use<br>ViewCompat.<em>getLayoutDirection</em>(view)<br><strong><em>Note</em></strong><em>: This always returns </em><em>LTR if called from the Constructor of a View.</em></li><li>If you want Layout Direction from a Context then use <br>Configuration config = context.getResources().getConfiguration();<br>if (config.getLayoutDirection() == View.<em>LAYOUT_DIRECTION_RTL</em>) {<br> //RTL<br>}</li></ul><h3>Extras</h3><p>If you have completed all of the above then I believe you should have pretty good RTL Support. There are few more things you can look at for your final touch.</p><ul><li>TextAlignment</li><li>TextDirection</li></ul><h3>Conclusion</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P7u6LkSTmXMv-bIzCKUh3w.gif" /></figure><p>Support for RTL is not that difficult on Android. I wish I had supported it from day 1 instead of doing it at a later stage. If you found something missing or have suggestions then do comment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*RPqOZDIEFJjmPblXraCylw.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/94/1*MNVfakAszkb-0M9dsI6pOQ.png" /><figcaption><a href="https://medium.com/u/da8226430780">Rishabh Harit</a> is an Android Developer at Crowdfire.</figcaption></figure><p><em>*This post was first published on </em><a href="https://medium.com/@rishabhharit/rtl-support-on-android-here-is-all-you-need-know-e13f2df512e2"><em>Rishabh’s Medium</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=761ec131a53a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/crowdfire-tech/rtl-support-on-android-heres-all-you-need-to-know-761ec131a53a">RTL Support on Android — Here’s all you need to know</a> was originally published in <a href="https://medium.com/crowdfire-tech">Coding Big — The Crowdfire Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jumping between languages]]></title>
            <link>https://medium.com/crowdfire-tech/jumping-between-languages-d1463fe03b85?source=rss----212c5945ed6c---4</link>
            <guid isPermaLink="false">https://medium.com/p/d1463fe03b85</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Crowdfire]]></dc:creator>
            <pubDate>Mon, 27 Mar 2017 16:02:00 GMT</pubDate>
            <atom:updated>2017-03-27T16:02:00.787Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NTJDyP6B8vX1Z1qYhKyivQ.jpeg" /><figcaption>Photo Credits — <a href="https://unsplash.com/@albertosaure">Luis Llerena</a></figcaption></figure><p>I code for a living. Blogging isn’t something I thought of until I actually thought about it. There are things I can finish at blazing speed — 100 lines of code? Bring it on! But when I thought of writing a blog post, it took me a while. I don’t want to be harsh on myself and set really high expectations so I decided to start with something basic. We all started with basic, right?</p><p>I’m just putting down my experience when I switched from one language to another. I will leave the sharing of insights of different programming languages that I worked on for later.</p><p>So here’s the story.</p><p>Once, I was reluctant of using any other language than <em>Java</em> and related frameworks for writing an application. I had graduated with knowledge of <em>C</em> and <em>C++</em>. Though I don’t deny writing <em>Hello World</em> programs in Java.<br>I “really” learned Java when I started working for a company as a fresher. I found the language interesting, so I started reading more on deeper concepts of JVM, compiler, GC algorithms etc. I started liking it more.</p><p>I worked primarily on Java for the first 3 years. It was after two job switches that I started working on Node or basically coding using <em>JavaScript(JS)</em>. I found the change a little drastic. Like, <em>‘3’ &gt; 2</em> returned true. I could send 2 parameters in the method, which actually expects 5 (it sounded silly but yeah it could be done — and then break the code at your own risk). <a href="http://callbackhell.com/"><em>Callback Hell</em></a> was something which was difficult initially. These were the things I never expected.</p><p>The development time was a little faster with JS. I could just create response JSON on the fly than writing a template for the same. Though I had to be very careful about using the variables since there is no enforced type-safety. Slowly, but truly, I got familiar with these, avoiding callbacks by using co-routines. Interestingly, I use JS more than Java nowadays.</p><p>There is another programming language I’ve used i.e., <a href="https://golang.org/"><em>Go</em></a>. One of my colleagues had already started exploring the language and wrote a feature using Go. I was supposed to write another feature and he managed to convince me to write it in Go. So I started exploring the language and the syntax. I had come back to the environment of type-safety, following method signatures, compilation errors etc. I felt a little good since I’m a little pro for these enforcements. When it comes to syntax, it’s a little different from many (or at least from the languages I know), like Method signatures, declaring variables are kind of reversed, you can return multiple values from a function (one of the features of the language I like the most). We did struggle a bit writing test cases with Go and packaging in Go.</p><p>I don’t really want to compare the languages here. Every language has its own advantages and disadvantages. JS can really speed up coding, but a developer’s mistake can screw up the application. Go syntax was difficult to adapt to but has type-safety, compilation etc which I prefer in a language.</p><p>What happened while I went from one language to another? Well, I’m not stubborn about a particular programming language anymore. I’m open to taking up any programming language and already have a long list to cover.</p><blockquote>When you open your mind you see something good in everything and it’s up to you to utilise it in the best possible way!</blockquote><p>That’s one thing I learnt at <a href="https://medium.com/u/239c59159dda">Crowdfire</a> — Always Be learning, Be burning!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/97/1*2hK1HACnRlicm-rx6fwtbg.png" /><figcaption><a href="https://medium.com/u/a33d2b92456b">Aniket</a> is a Backend Developer at Crowdfire. He’s fluent in Java, Formula 1 and food.</figcaption></figure><p><em>originally posted on </em><a href="https://medium.com/u/a33d2b92456b"><em>Aniket</em></a><em>’s Medium</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1463fe03b85" width="1" height="1" alt=""><hr><p><a href="https://medium.com/crowdfire-tech/jumping-between-languages-d1463fe03b85">Jumping between languages</a> was originally published in <a href="https://medium.com/crowdfire-tech">Coding Big — The Crowdfire Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How We Open Sourced Our First iOS Project]]></title>
            <link>https://medium.com/crowdfire-tech/how-we-open-sourced-our-first-ios-project-133772c430c0?source=rss----212c5945ed6c---4</link>
            <guid isPermaLink="false">https://medium.com/p/133772c430c0</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Shardul Patel]]></dc:creator>
            <pubDate>Wed, 22 Jun 2016 12:46:53 GMT</pubDate>
            <atom:updated>2016-06-22T14:58:03.599Z</atom:updated>
            <content:encoded><![CDATA[<p>It happened while we were redesigning the iOS version of Crowdfire and facing a lot of design constraints with the default UIAlertController. We realised that the system’s default alerts and action sheets didn’t go with our app design theme, and offered no flexibility to modify its UI. We needed our own theme-styled alerts and action sheets and our talented design team were already ready with some really good alerts and action sheets designs. All we needed to write code. From scratch<em>.</em></p><p>We launched a basic version of CFAlertViewController to enhance our alert and action sheet functionality as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S03scVU-iKbXuGOt5z8z5Q.png" /><figcaption>Alerts and Action sheet styles</figcaption></figure><p>Here’s the code snippet to help you create a basic alert view as shown in the top left image.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/392290d89a11b8f1a00443927089b13a/href">https://medium.com/media/392290d89a11b8f1a00443927089b13a/href</a></iframe><p>Later in the product development stage, our design team came up with an idea to display image or gifs as header in an alert.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nWKTw3b21QTjJ2EXnQIIyA.png" /><figcaption>Dollar image view used as header in the alert</figcaption></figure><p>Earlier, we would ask our free users to upgrade to a paid plan when they hit their daily limit. Our marketing team came up with a plan to give the free users the option to either upgrade to a higher plan or tweet something to increase the daily limits at the same time. The design team came up with the following pop-up design:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZH_devnDqY5eXUHSGsz6CQ.png" /><figcaption>The “OR” section view in the footer of the alert</figcaption></figure><p>However, as per the UI requirement, we needed to modify the control in a way that it would retain the existing alert properties and be able to handle and display different UI modules in top and bottom of the alert. We also had to make it scalable so that it would be able to fulfil different UI requirements in the future.</p><p>We were sure that there would be teams or individuals having similar requirements too, and hence, we decided that building a generic solution to the problem would make more sense. What we had in mind was a control that would not only retain the alerts and action sheet requirement functionality but also offer additional functionality to add header or footer view which is a subclass of UIView (e.g., UIImageView or your custom view).</p><p>We built CFAlertViewController and open-sourced it. We have designed its API in a way that it is similar to the system’s existing UIAlertController class structure and is modifiable, extendable, and offers new functionality. It comes with the following features:</p><ul><li>You can adjust the alignment of the title and subtitle of any alert. You can also align actions as per your requirement.</li><li>It functions on both iPhone and iPad. It offers adaptive UI and screen rotation support.</li><li>It supports header and footer view in an alert. In fact, it comes with numerous configurations and possibilities so that you can even create a custom alert out if it. You can even pass your custom header or footer view and ignore all the basic alert or action sheet functionalities. This way, your own view can behave like an alert or action sheet and automatically get features like rotation, keyboard support and adaptive layout functionality without ever writing a single line of code!</li></ul><p>You can have a look at the demo project and open source code on <a href="http://bit.ly/cfAlertVC"><strong>Github</strong></a>.</p><p>If you found the post helpful, please recommend and share. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=133772c430c0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/crowdfire-tech/how-we-open-sourced-our-first-ios-project-133772c430c0">How We Open Sourced Our First iOS Project</a> was originally published in <a href="https://medium.com/crowdfire-tech">Coding Big — The Crowdfire Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I learnt Redux concepts]]></title>
            <link>https://medium.com/crowdfire-tech/redux-explained-in-4-simple-steps-12266c39b72f?source=rss----212c5945ed6c---4</link>
            <guid isPermaLink="false">https://medium.com/p/12266c39b72f</guid>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Narendra N Shetty]]></dc:creator>
            <pubDate>Wed, 15 Jun 2016 09:02:31 GMT</pubDate>
            <atom:updated>2016-06-16T07:57:45.563Z</atom:updated>
            <content:encoded><![CDATA[<p>So in the past few months there is a lot of fuss going on in Javascript community about React and Redux. Everyone is writing their application in React.</p><p>At <a href="https://medium.com/u/239c59159dda">Crowdfire</a>, we had a new product coming up and we had the same question on which framework to pick and which would best be suitable for our needs.</p><p>So we decided to list out the requirements and check which philosophy would solve the problems.</p><p>No prizes for guessing which one we went with. We chose React + Redux. Instead of blindly following framework we decided to understand the concept so it would help us understand what is happening under the hood.</p><p>Best way to understand a framework is you recreate a basic concept of it yourself. That is what we did.</p><p>I am going to talk only about Redux concepts here. Let’s get into the detail.</p><h4>Three key principles of Redux are :</h4><ol><li><strong>Single source of truth</strong><br>The state of your whole application is stored in an object tree within a single store<strong>.</strong></li><li><strong>State is read-only</strong><br>The only way to mutate the state is to emit an <a href="http://redux.js.org/docs/Glossary.html#action">action</a>, an object describing what happened.</li><li><strong>Changes are made with pure functions</strong><br>To specify how the state tree is transformed by actions, you write pure reducers.</li></ol><p>For detail you can read more on <a href="http://redux.js.org/docs/introduction/ThreePrinciples.html">Redux official docs</a>.</p><h4>How did we rebuild it:</h4><p>We rewrote the basic concepts in pure JS.</p><p><strong>1. Created a Store which would hold the state of our application.<br></strong>This is how our store looked. <em>this.state</em> is initialized with initial state.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/337e88bc3bf365392bc815a467bbf363/href">https://medium.com/media/337e88bc3bf365392bc815a467bbf363/href</a></iframe><p><strong>2. Created a dispatcher method<br></strong>This is the only way to change the state of the application. Dispatcher is called along with the action type which indicates how the state has to be changed.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/365fa0c99430d8d693131a7059ba16b6/href">https://medium.com/media/365fa0c99430d8d693131a7059ba16b6/href</a></iframe><p><strong>3. Created a function which modifies the state based on the action<br></strong>This method is passed with the action.type and a switch case is used to trigger a state change based on the action.type.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2e3194e8367197c9c10a22222314b734/href">https://medium.com/media/2e3194e8367197c9c10a22222314b734/href</a></iframe><p><strong>4. Created a method to subscribe for the state change<br></strong>This method is used when an app needs to listen to the changes happening to the state.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eb1692948976735c85d356cc9a757da1/href">https://medium.com/media/eb1692948976735c85d356cc9a757da1/href</a></iframe><p>With this we now have basic concepts on Redux implemented.</p><p>We can now use any rendering logic to create a UI based on the state of the application and if any user actions needs to change the state, it has to go through dispatcher.</p><h4>What we learnt</h4><p>We now have concepts clear on how redux works internally which helps us debug problems easily and predict our application much better.</p><p>Thanks for reading, If you liked this article, click “Recommend” or write a response below. You can connect with me on Twitter <a href="https://twitter.com/narendra_shetty">@narendra_shetty</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12266c39b72f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/crowdfire-tech/redux-explained-in-4-simple-steps-12266c39b72f">How I learnt Redux concepts</a> was originally published in <a href="https://medium.com/crowdfire-tech">Coding Big — The Crowdfire Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Debug like never before]]></title>
            <link>https://medium.com/crowdfire-tech/debug-like-never-before-4d2c4eae7487?source=rss----212c5945ed6c---4</link>
            <guid isPermaLink="false">https://medium.com/p/4d2c4eae7487</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[logging]]></category>
            <category><![CDATA[debugging]]></category>
            <dc:creator><![CDATA[Amanpreet Singh]]></dc:creator>
            <pubDate>Mon, 01 Feb 2016 08:25:01 GMT</pubDate>
            <atom:updated>2016-02-01T11:29:49.909Z</atom:updated>
            <content:encoded><![CDATA[<p>You have written a good amount of code, and finally have an application ready to serve its users. But how would you see what’s really going on inside this application? The best way to do this, as the <a href="http://12factor.net/logs">the twelve-factor app</a> rightly suggests, is <strong>logging</strong>.</p><blockquote><em>“Logs</em> provide visibility into the behavior of a running app.”</blockquote><p>However, running a piece of code in development is very different from running it in production. When running locally, you just have a single server responding to the tiny number of requests you are sending. You can clearly see the stream of logs in your terminal and know exactly what’s happening. That is not the case when you’re running at least two servers for high availability or load distribution. It gets even more troublesome to comprehend if you have a Service Oriented Architecture (SOA), where you have hundreds (if not thousands) of servers. And these servers keep coming and going based on scaling events. If you’re downloading logs from each server repeatedly, you’re doing it wrong. In that case, how do we deal with this kind of situation?</p><p><strong>Enter, Centralized logging.</strong></p><p>This seems the most natural of approaches. You have a central location, where you can see logs from all your servers, filter them based on service, log type and of course, time. Maybe even parse them to create fields. Or even perform a full-text search.</p><p>So centralized logging is not so bad after all. But how do we make use of it? There are quite a number of options, including hosted logging services. We went with an approach that is cost effective for our scale. The key areas: collection, shipping, storage, analysis and alerting. The solution - <a href="https://github.com/elastic/elasticsearch/">Elasticsearch</a>, <a href="https://github.com/elastic/logstash">Logstash</a> and <a href="https://github.com/elastic/kibana/">Kibana</a> - commonly known as the ELK stack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Dero0I-mgETSYUIgXlM7Q.jpeg" /><figcaption>Basic architecture of ELK stack</figcaption></figure><p><a href="https://github.com/elastic/logstash-forwarder">Logstash-forwarder</a> runs as an agent on every server, tailing the required log files and shipping them to the central logstash server via lumberjack protocol. Logstash parses these logs line by line, according to the provided configuration. Logstash has a lot of plugins for different kinds of inputs, parsing filters and outputs. In our case, we use lumberjack input plugin for receiving log events from logstash-forwarders running on various servers. In addition to that, we use S3 input plugin to get in the the AWS Elastic Load Balancer (ELB) logs. For better analysis and aggregation, we parse these logs using:</p><ul><li>Grok filter for nginx and ELB logs</li><li>JSON filter for application logs (we put logs in json format)</li><li>Multiline filter for keeping stack-traces together</li><li>date filter to keep the timestamps in logs in sync</li></ul><p>The output goes to an Elasticsearch cluster which indexes and stores the logs, making it ready to be accessed and searched via Kibana. Kibana is basically a front-end app that connects to the Elasticsearch cluster and queries it for relevant logs. It can be used to simply view the logs, based on a number of filters, or draw charts based on the logs. For retention purposes, we just let the logs sit in Elasticsearch for about a month or so. The older indices are deleted using <a href="https://github.com/elastic/curator">curator</a>.</p><p>To make ELK highly available and reliable, we use multiple logstash instances behind an ELB. Elasticsearch cluster also runs multiple data and master nodes for replication, and a client node for load balancing. There is one thing missing here, and that is Redis. A lot of people use Redis as a broker before logstash. It acts as a buffer for coming logs in case logstash machine is down under heavy load. In our experience, we didn’t need it since we’re running multiple logstash instances behind a load balancer. Also, logstash-forwarder spools the logs in case the target logstash instance is unable to receive them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CgHAoFbYeM9ul9lHywdFdg.png" /><figcaption>Kibana 4 dashboard</figcaption></figure><p>That’s pretty much about it. Don’t wait, put on your debugging goggles, and play with ELK. Do share your thoughts or questions in the comments below. :)</p><p>P.S.: logstash-forwarder project has been recently replaced by <a href="https://github.com/elastic/beats/tree/master/filebeat">filebeat</a>. That would mean just use filebeat instead of logstash-forwarder on your servers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d2c4eae7487" width="1" height="1" alt=""><hr><p><a href="https://medium.com/crowdfire-tech/debug-like-never-before-4d2c4eae7487">Debug like never before</a> was originally published in <a href="https://medium.com/crowdfire-tech">Coding Big — The Crowdfire Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How We Built The Fastest Extension for Chrome]]></title>
            <link>https://medium.com/crowdfire-tech/how-we-built-the-fastest-extension-for-chrome-65d695972dee?source=rss----212c5945ed6c---4</link>
            <guid isPermaLink="false">https://medium.com/p/65d695972dee</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[chrome]]></category>
            <dc:creator><![CDATA[Narendra N Shetty]]></dc:creator>
            <pubDate>Fri, 15 Jan 2016 11:35:14 GMT</pubDate>
            <atom:updated>2016-01-15T11:35:13.656Z</atom:updated>
            <content:encoded><![CDATA[<p>We have always thought of finding a way to share anything instantly from anywhere. The idea was to have something so simple that we could just right click and share. We built Crowdfire share and then thought of building its extension.</p><p>We built Crowdfire extension for Chrome to solve two problems:</p><ul><li>Crowdfire is the first extension that helps you share photos on Twitter and Instagram simultaneously.</li><li>It is the only extension that loads within half a second unlike its peers.</li></ul><p>We had one aim while building Crowdfire share extension: To make it faster and better. If you use Crowdfire extension for Chrome, you would notice that the accounts are already loaded as soon as you click on the extension. After looking at similar extensions available on web, we found out that the first API call of the user that we make is time consuming after which the DOM renders. So the whole process would take a minimum of 1–2 seconds. We wanted to reduce the API call time which is an impossible feat.</p><p>So here’s what we did: We made an async API call which didn’t block the DOM rendering. This was a first time process. Hereafter, we stored the data we got every time. As a result, the next time we would take the data from the stored data and render it. Since we store the data every time we get it, it is faster the next time we load it. Meanwhile, we also kept making API call in the background to make sure the account data would not be stale.</p><p>We used the native functionality offered by Google Chrome to make our extension even faster. Most extensions use iframes within the website to open the extension which takes a lot of time. Instead, we shipped our extension with HTML and other assets packaged with it. This makes sure that whenever you click the publish icon, the compose window will be available to you instantly.</p><p>We load the same page popup.html in content script. We do that by loading it through iframe due to which we don’t have to maintain two different pages. There were problems as we needed to prefill the form in the iframe based on the user action in the page. This was not simple as it would give us cross-origin issue because iframe is of a different origin. We solved this problem by using the background page as the mediator between webpage and the iframe. We used the chrome messaging API where we sent the message from webpage to background page and then to the iframe.</p><p>We plan to make the extension available for other browsers (Firefox, Safari etc) but we did not want to write code multiple times for the same kind of extension. We isolated the code specific to the particular browser (Chrome, in this case) and the rest of the functionality in such a way that these functionalities could be used in other browsers and we would just have to write the browser-specific code. We used Grunt CLI — we wrote a script which takes the commonly used code and combines with the browser specific code and creates a different folder for every browser. The team is working is hard to enhance its functionality and ship it soon.</p><p>You can install the extension by clicking <a href="http://crowdfireapp.com/extension">here</a>.</p><p><em>Published on October 16, 2015.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65d695972dee" width="1" height="1" alt=""><hr><p><a href="https://medium.com/crowdfire-tech/how-we-built-the-fastest-extension-for-chrome-65d695972dee">How We Built The Fastest Extension for Chrome</a> was originally published in <a href="https://medium.com/crowdfire-tech">Coding Big — The Crowdfire Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[4 simple principles to win the Onboarding game]]></title>
            <link>https://medium.com/crowdfire-tech/4-simple-principles-to-win-the-onboarding-game-41acf04afb2f?source=rss----212c5945ed6c---4</link>
            <guid isPermaLink="false">https://medium.com/p/41acf04afb2f</guid>
            <category><![CDATA[design]]></category>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Life At Crowdfire]]></dc:creator>
            <pubDate>Fri, 15 Jan 2016 11:27:38 GMT</pubDate>
            <atom:updated>2016-01-15T11:27:38.005Z</atom:updated>
            <content:encoded><![CDATA[<p>by Ahmed Abbas</p><p>Last month, the entire team had gone on a <a href="https://medium.com/@WeAreCrowdfire/how-we-discovered-that-workcation-actually-works-9411c2a8da72">workcation</a> to brainstorm about the Crowdfire v2.0. We split ourselves into teams and every team took up the task of solving one problem. Our team took up the challenge of researching on and reviewing the on-boarding experience of 50 apps.</p><p>The goal was simple: Analyse what makes the on-boarding experience of these apps great and why a user falls in love with a product.</p><blockquote><em>Very often, on-boarding is the most immediate way of defining what product becomes in people’s minds.</em></blockquote><p>We decided to measure things which define the perception of a product to a user’s mind. These were listed down into 3 categories -</p><p>a) The <em>principles</em> which make the on-boarding of an app great. They are mostly well known UX principles that should drive the workflow and design of all online as well as real life experiences.</p><p>b) The <em>mistakes — </em>the ‘don’ts<em>’ </em>or the<em> </em>opposite of what can be translated to ‘principles’.</p><p>c) The <em>excitation points </em>or the promises or pleasurable moments which give the user the momentum to go ahead and use the app.</p><p>After listing down these extensive principles and excitation points, we could clearly identify there are limited principles great products follow to be successful.</p><p>Four primary principles which if followed diligently, can make you win the on-boarding game:</p><ol><li>Clear purpose, story telling, and creating context</li><li>Gaining trust and excitation</li><li>Learn by doing</li><li>Creating FOMO (Fear of missing out)</li></ol><p>Let’s understand each of the principles with the help of a couple of examples:</p><h3>Clear Purpose</h3><p>Let your audience know what your product does in the simplest way possible. The output of the product needs to be as clear as possible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*fHlVCsAuZClfkzje.png" /></figure><p><em>Foursquare and Periscope — defining the primary thing they do in one simple sentence</em></p><h3>Story Telling</h3><p>Stories go complementary with stating the purpose of your product. Stories help your audience connect with the way they would utilise your product or service. They are more useful than the features listing or product testimonials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*sZfl2iO5s7qb4Rk7.png" /></figure><p><em>Evernote has stories of how people from various walks of life used it to simplify their life</em></p><h3>Creating Context</h3><p>Correct intent is more rewarding than vague compelling claims.</p><p>CTA’s should set the intent of the next screen rather than just asking the user to Do Something.</p><p>Replace vague words like Next or <em>Get Started </em>; use active words like Start exploring, or Search a cat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*1F2NFGy6lxnPfsyk.png" /></figure><p><em>Saying “Start Learning” helps your user think forward as compared to “Get Started”</em></p><h3>Gaining Trust and Excitation</h3><p>From the moment a user lands on your product, every step, every screen either excites and gains him some trust, or could make him skeptical about your product. So we should question each step of our on-boarding to check with example users, if its helping in gaining trust or reversing it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*goix4t6FFlGHaG3T.png" /></figure><p><em>Evernote’s incentive to its users is that they would “Remember Everything”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*uyAimie8AsZ8EJVZ.png" /></figure><p><em>Foursquare pre-addressing the user’s worry by saying that he can still chose to remove it at a later point</em></p><p>There are a few ways to do this — with a well-timed compliment (Nice Job), you can incentivise them to progress through your product by rewarding them for completing something (we got some points &amp; savings ready for you) or pre-addressing worries (don’t worry you can choose to switch off x feature). Let the user feel like a Superman</p><h3>Learn By Doing</h3><p>Let your user do a demo exercise to learn your product, followed by celebrating the success with him. Mailbox, for example, does this well by teaching user the gestures by walking them through some dummy mails. This is true for on-boarding your users to a fresh product as well as to a feature within your product.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*MhveXdJ3SGxi45I3.png" /></figure><p><em>Slack allows its users to test how the desktop notification would look by testing them.</em></p><p>Guided interactions makes your user feel more confident about the ease of using your product.</p><p>Remember, this is the stepping stone where your users get used to your habit forming game. Don’t forget to give them their first reward wherever possible!</p><h3>FOMO (Fear Of Missing Out)</h3><p>Whatever we do, we always have a fear of losing. Give your users an attractive incentive. It could be a complimentary cake on first order from a cakeshop, telling them they would miss on savings if acted late or the fact that they would be the updated with latest news or swag if they sign up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*wg8RFZMWcjcndShS.png" /></figure><p><em>Dropbox indirectly creates a fear in the user’s mind that he maybe missing free space, if he doesn’t invite friends.</em></p><p>For the best FOMO creation, follow what crowdfireapp ’s founder, Nischal Shetty, defines it as -</p><blockquote><em>Be </em><strong><em>CUTE</em></strong><em>: Attack on user’s </em><strong><em>C</em></strong><em>uriosity, </em><strong><em>U</em></strong><em>rgency, </em><strong><em>T</em></strong><em>emptation and </em><strong><em>E</em></strong><em>go!</em></blockquote><p>Lastly, to win your users, your on-boarding needs to be extremely easy. Be simple, be transparent. Remember, simplicity wins!</p><p><em>Published on September 1, 2015.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41acf04afb2f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/crowdfire-tech/4-simple-principles-to-win-the-onboarding-game-41acf04afb2f">4 simple principles to win the Onboarding game</a> was originally published in <a href="https://medium.com/crowdfire-tech">Coding Big — The Crowdfire Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Power up your Sublime Text as Ruby/Rails IDE]]></title>
            <link>https://medium.com/crowdfire-tech/power-up-your-sublime-text-as-ruby-rails-ide-f0a7fa8b1fcb?source=rss----212c5945ed6c---4</link>
            <guid isPermaLink="false">https://medium.com/p/f0a7fa8b1fcb</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <dc:creator><![CDATA[Life At Crowdfire]]></dc:creator>
            <pubDate>Fri, 15 Jan 2016 11:24:13 GMT</pubDate>
            <atom:updated>2016-01-15T11:24:12.812Z</atom:updated>
            <content:encoded><![CDATA[<p>by Sudhagar S.</p><blockquote><em>“Manners maketh man”.</em></blockquote><p>and</p><blockquote><em>“Tools maketh developer”.</em></blockquote><p>Every programmer’s most basic tool is the editor that he uses to write code. The oldest software <a href="http://www.slate.com/articles/technology/bitwise/2014/05/oldest_software_rivalry_emacs_and_vi_two_text_editors_used_by_programmers.html">rivalry</a> says a lot about how editors form a base of everything we do.</p><p>After my failed attempts with Vim, I decided to stick with Sublime Text and make it so powerful that I don’t have to think about any other editor anymore. As a regular user of Sublime Text, you might already be using plugins like <strong>Package Control, SideBarEnhancements, SublimeLinter, AllAutoComplete </strong>and few themes.</p><p>Here’s a list of the plugins you should install, the tweaks you should do and the tricks you should know for Sublime Text to function like an IDE.</p><h3>Plugins</h3><p><strong>1. </strong><a href="https://github.com/CraigWilliams/BeautifyRuby"><strong>BeautifyRuby</strong></a><strong>:</strong></p><blockquote><em>Code that is aesthetically pleasing is easy to read and therefore easy to understand.</em></blockquote><p>BeautifyRuby makes sure your code is well formatted. It maps the beautify_ruby command to cmd+ctrl+k by default. If you want to customise it, put the following entry in user key bindings. I use cmd-shift-k.</p><pre>{<br>  “keys”: [“super+shift+k”],<br>  “command”: “beautify_ruby”<br>}</pre><p><strong>2. </strong><a href="https://github.com/facelessuser/BracketHighlighter"><strong>BracketHighlighter</strong></a></p><p>When your code is having more than 3 levels of indentation, it is chaos. This plugin highlights the enclosing/respective if..end, do..end, def..end, class..end, thus making your navigation easier.</p><p><strong>3. </strong><a href="https://github.com/janlelis/productive-sublime-snippets-ruby"><strong>ProductiveSnippetsRuby</strong></a><strong>, </strong><a href="https://github.com/tadast/sublime-rails-snippets"><strong>Ruby On Rails Snippets</strong></a></p><p>Though Sublime Text provides basic code snippets, this plugin takes them to the next level. My favourite snippets are ‘b-p’ for binding.pry, ‘d-o-zero’ for no argument blocks and ‘d-o-tab’ for blocks that take a argument.</p><p>Creating snippets for sublime is really easy and this plugins’s <a href="https://github.com/janlelis/productive-sublime-snippets-ruby/">repo</a> is a great place to get started.</p><p>Here is a sample,</p><pre>// ft for &#39;focus: true&#39;<br>&lt;snippet&gt;<br> &lt;content&gt;&lt;![CDATA[focus: true]]&gt;&lt;/content&gt;<br> &lt;tabTrigger&gt;ft&lt;/tabTrigger&gt;<br> &lt;scope&gt;source.ruby&lt;/scope&gt;<br> &lt;description&gt;focus: true&lt;/description&gt;<br>&lt;/snippet&gt;</pre><p><strong>4. </strong><a href="https://github.com/SublimeText/RSpec"><strong>RSpec</strong></a></p><p>This plugin provides rspec language syntax, rspec snippets (des, con, eql, neql, etc) and the best of all — you can run your specs from the editor itself with cmd-b(build).</p><p><strong>5. </strong><a href="https://github.com/SublimeLinter"><strong>SublimeLinter</strong></a></p><p>Linting helps in finding out potential errors, so have at least one linter plugin. I use SublimeLinter. There are others like <a href="https://github.com/SublimeLinter/SublimeLinter-rubocop">SublimeLinter-rubocop</a>and <a href="https://github.com/SublimeLinter/SublimeLinter-ruby">SublimeLinter-ruby</a>.</p><p><strong>6. </strong><a href="https://github.com/wuub/SublimeREPL"><strong>SublimeREPL</strong></a></p><p>With this plugin, you can spin up a pry/rails console in a new editor tab. It doesn’t work out of the box if you are using rbenv. Some plugin files have to be edited to make it work. Follow <a href="https://gist.github.com/SudhagarS/cade2b918f7a16c4b0c5">this</a> link to get it working smooth. Also its super aggressive auto-complete can be irritating at times.</p><p>Sometimes, I have rails console running in the bottom right screen when I am on gird layout in bigger screens. This way I don’t have to go to terminal just to evaluate an expression.</p><p><strong>7. </strong><a href="http://gluedocs.readthedocs.org/en/latest/"><strong>Glue</strong></a></p><p>Glue makes it possible to run terminal commands from editor. Though it is not as powerful as terminal, I use it to quickly run git status and to copy/paste/delete files.</p><p><strong>8. </strong><a href="https://github.com/temochka/sublime-text-2-github-tools"><strong>Github Tools</strong></a></p><p>With this plugin you can open from the editor the following things on Github,</p><ol><li>Repository home page</li><li>Pull requests page</li><li>Issues page</li><li>Current file</li><li>Blame page (i.e. commits history)</li></ol><p><strong>9. </strong><a href="https://github.com/jisaacks/GitGutter"><strong>GitGutter</strong></a></p><p>Gutter is the area in your editor where line numbers are typically displayed. This plugin shows git diff by placing an icon in the gutter area indicating whether a line has been inserted, modified or deleted.</p><p>10. Other plugins you can install based on your needs,</p><ol><li><a href="https://github.com/JasonMortonNZ/bs3-sublime-plugin">Bootstrap</a></li><li><a href="https://github.com/sergeche/emmet-sublime">Emmet</a></li><li><a href="https://github.com/victorporof/Sublime-HTMLPrettify">HTML-CSS-JS prettify</a></li><li><a href="https://github.com/jprichardson/sublime-js-snippets">Javascript snippets</a></li><li><a href="https://github.com/nathos/sass-textmate-bundle">SASS</a></li><li><a href="https://packagecontrol.io/packages/SCSS">SCSS</a></li><li><a href="https://github.com/slim-template/ruby-slim.tmbundle">Ruby slim</a></li></ol><h3>Shortcuts</h3><p>Anything you can imagine, sublime has a shortcut for that. Stop using touch pad when you are on the editor, you don’t need it.</p><p>1. <strong>Go to Definition</strong></p><p>In IDEs like eclipse and Intellij, cmd+click on a method name at the place where it is called, takes you to its definition. This is very useful as you are juggling between your classes and debugging.</p><p>Sublime has commands goto_definition and jump_back which you can map to the keys you want. Here is how I have mapped them.</p><pre>// Default (OSX).sublime-keymap<br>{ “keys”: [“super+down”], “command”: “goto_definition” },<br>{ “keys”: [“super+up”], “command”: “jump_back” }</pre><p>I do cmd+down on a method call to see its implementation and cmd+up to go back again to the method call. Pretty neat, huh?</p><p><strong>2. Variable Renaming</strong></p><p>If you want to change a variable name, keep the cursor on the variable name and keep hitting cmd+d until it selects all the occurrences you want to edit. After you are done selecting, you can edit them all at once.</p><p><strong>3. Swap lines</strong></p><p>cmd+ctrl+(up|down) swaps a line with the above or below line.</p><p><strong>4. Navigate between views</strong></p><p>Use cmd+shift+[ and cmd+shift+] to navigate back and forth between files.</p><p>Shortcuts cmd+alt+left and cmd+alt+right also do the same thing. So pick which ever your fingers prefer.</p><p><strong>5. Paste from history</strong></p><p>Doing cmd+k, cmd+v opens a panel with everything you have copied so far and you can select which one to paste.</p><p><strong>6. Go to line</strong></p><p>You can go to a line number by doing ctrl+g and typing the line number.</p><p>You can map it to the key you want, by putting this entry in user key bindings.</p><pre>{ <br>  “keys”: [“cmd+l”], <br>  “command”: “show_overlay”, <br>  “args”: {“overlay”: “goto”, “text”: “:”} <br>}</pre><p>I use <em>cmd+l</em> which — by default — is mapped to extend_selection command which I don’t think I would ever use.</p><p>So that’s all I got. If all these seem overwhelming to you in the beginning, give it a week and you will notice a positive change in how write ruby code in Sublime Text. I am <a href="https://twitter.com/shotwhat">@shotwhat</a> on Twitter. Let me know how this helped you.</p><p><em>Published on July 28, 2015.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f0a7fa8b1fcb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/crowdfire-tech/power-up-your-sublime-text-as-ruby-rails-ide-f0a7fa8b1fcb">Power up your Sublime Text as Ruby/Rails IDE</a> was originally published in <a href="https://medium.com/crowdfire-tech">Coding Big — The Crowdfire Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>