<?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: Mervin</title>
    <description>The latest articles on DEV Community by Mervin (@mervinsv).</description>
    <link>https://dev.to/mervinsv</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%2F38362%2Fae4c293e-2c64-4444-a02e-dd2217e11c66.jpg</url>
      <title>DEV Community: Mervin</title>
      <link>https://dev.to/mervinsv</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mervinsv"/>
    <language>en</language>
    <item>
      <title>Slim framework with Swoole</title>
      <dc:creator>Mervin</dc:creator>
      <pubDate>Fri, 09 Aug 2019 08:27:07 +0000</pubDate>
      <link>https://dev.to/mervinsv/slim-framework-with-swoole-3bjb</link>
      <guid>https://dev.to/mervinsv/slim-framework-with-swoole-3bjb</guid>
      <description>&lt;p&gt;Hi PHP developers.&lt;/p&gt;

&lt;p&gt;Does someone here tried using slim framework with swoole?&lt;br&gt;
How was it? and does it make your api much faster?&lt;/p&gt;

&lt;p&gt;Have you also tried SSR with slim?&lt;/p&gt;

&lt;p&gt;Thank you.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>php</category>
      <category>slimframework</category>
      <category>swoole</category>
    </item>
    <item>
      <title>Best way to learn on React Native</title>
      <dc:creator>Mervin</dc:creator>
      <pubDate>Wed, 05 Sep 2018 10:08:56 +0000</pubDate>
      <link>https://dev.to/mervinsv/best-way-to-learn-on-react-native-3k0</link>
      <guid>https://dev.to/mervinsv/best-way-to-learn-on-react-native-3k0</guid>
      <description>&lt;p&gt;I am new in React and React Native but I'm a JS Developer and already deployed some apps in Ionic platform. I want to study react native because Ionic has a performance issue but Ionic 4 is coming and they said that it has a better performance.&lt;/p&gt;

&lt;p&gt;React on the other side has a bigger community and no performance issue. So my question is should I stick to Ionic and wait for Ionic 4 or learn React native? And what are your recommendations in learning react native?&lt;/p&gt;

&lt;p&gt;Thank you! :D&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>reactnative</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Refactoring Web Services</title>
      <dc:creator>Mervin</dc:creator>
      <pubDate>Tue, 14 Nov 2017 03:56:47 +0000</pubDate>
      <link>https://dev.to/mervinsv/refactoring-web-services-85e</link>
      <guid>https://dev.to/mervinsv/refactoring-web-services-85e</guid>
      <description>&lt;p&gt;Hi everyone! I have a web service with multiple methods and I just want to ask if it is better to combine all the methods into one and put a parameter('action') to determine what controller to run. &lt;/p&gt;

&lt;p&gt;What do you think is faster, maintainable and easy to extend? &lt;/p&gt;

&lt;p&gt;Thank you!&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>programming</category>
      <category>coding</category>
      <category>webservice</category>
    </item>
    <item>
      <title>Refactoring If-else statement</title>
      <dc:creator>Mervin</dc:creator>
      <pubDate>Mon, 13 Nov 2017 10:17:55 +0000</pubDate>
      <link>https://dev.to/mervinsv/refactoring-if-else-statement-4g</link>
      <guid>https://dev.to/mervinsv/refactoring-if-else-statement-4g</guid>
      <description>&lt;p&gt;Hi everyone! I just want your opinions/thoughts on how to use if-else statements to make it more readable and maintainable or what are the best practices on using if-else statements. So let's start!&lt;/p&gt;

&lt;h3&gt;
  
  
  First
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;Nested if statements&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;isEmpty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;object&lt;/span&gt;&lt;span class="p"&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="nx"&gt;IsString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;number&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
        &lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Is a String&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
    &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;IsNumber&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;number&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
        &lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Is a number&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;
    &lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Is a special character&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;      
&lt;span class="p"&gt;}&lt;/span&gt;   
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or you can have it like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;bool&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;isEmpty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;object&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="nx"&gt;bool&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;IsString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;number&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Is  a String&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;    
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bool&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;IsNumber&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;number&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Is a number&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Is a special character&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Which do you think is better? Which one is easy to maintain and read? And what will happen if these &lt;em&gt;IF statements&lt;/em&gt; get bigger?&lt;/p&gt;

&lt;h3&gt;
  
  
  Second
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;Ternary operator vs if-else-if statements&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;tempVar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&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="nx"&gt;number&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nx"&gt;tempVar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;number&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nx"&gt;tempvar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;
    &lt;span class="nx"&gt;tempvar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;tempVar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;number&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)?&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;number&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)?&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Which one is better if we are talking about maintainability? &lt;/p&gt;

</description>
      <category>discuss</category>
      <category>coding</category>
      <category>learning</category>
    </item>
    <item>
      <title>The Progressive JavaScript Framework</title>
      <dc:creator>Mervin</dc:creator>
      <pubDate>Mon, 13 Nov 2017 05:39:21 +0000</pubDate>
      <link>https://dev.to/mervinsv/the-progressive-javascript-framework-4kc</link>
      <guid>https://dev.to/mervinsv/the-progressive-javascript-framework-4kc</guid>
      <description>&lt;p&gt;Vue.js is a javascript framework developed by Evan You. It is a progressive framework for building user interfaces. It focuses on a view layer of the application and it is use to build Single Page Applications(SPA). This framework is like AngularJS but much faster and lighter.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcoligo.io%2Fvuejs-the-basics%2Fcover-850x416.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcoligo.io%2Fvuejs-the-basics%2Fcover-850x416.jpg" alt="Vue.js"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm still studying about this framework and I haven't tried using it in a real project. As what I have learned so far is that it is easier to learn unlike Reactjs and AngularJS 2. And also it is easier to use and integrate with other libraries and frameworks.&lt;/p&gt;

&lt;p&gt;Vue.js currently has no stable way to develop mobile applications unlike the other frameworks. But there developers are now working with this two frameworks that could help us build mobile applications. This two frameworks are Weex and NativeScript.&lt;/p&gt;

&lt;p&gt;What I like with Vue.js is that it has a small size and it's very easy to integrate in the application just like jQuery. And as a programmer, it also saves a lot of time to build apps because it has a well-written documentation &lt;a href="https://vuejs.org/v2/guide/" rel="noopener noreferrer"&gt;(Vue.js documentation)&lt;/a&gt; and has a very simple code structure.&lt;/p&gt;

&lt;p&gt;To write applications using Vue.js, you just only have to know some basic Javascript and HTML language.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Self-taught programmers</title>
      <dc:creator>Mervin</dc:creator>
      <pubDate>Mon, 13 Nov 2017 02:33:58 +0000</pubDate>
      <link>https://dev.to/mervinsv/self-taught-programmers-6hg</link>
      <guid>https://dev.to/mervinsv/self-taught-programmers-6hg</guid>
      <description>&lt;p&gt;Someone said that self-taught programmers are better than educated programmers. Because they are smarter and good at coding and problem solving. And also they are so passionate on learning new technologies and languages. &lt;/p&gt;

&lt;p&gt;So what do you think? Is it true that self-taught programmers are better?&lt;/p&gt;

</description>
      <category>discuss</category>
    </item>
    <item>
      <title>Why are global variables bad?</title>
      <dc:creator>Mervin</dc:creator>
      <pubDate>Sun, 12 Nov 2017 05:45:54 +0000</pubDate>
      <link>https://dev.to/mervinsv/why-global-variables-are-bad-4pj</link>
      <guid>https://dev.to/mervinsv/why-global-variables-are-bad-4pj</guid>
      <description>&lt;p&gt;Global variables are variables that are declared outside to be accessible by everyone in the application.&lt;/p&gt;

&lt;p&gt;But if you search it in goole. The second query result is that global variables are bad. Why?&lt;/p&gt;

&lt;p&gt;I think everything has its own pros and cons. And global variables' pros and cons depends on how it is being used. It also depends on how big or small your application is.&lt;/p&gt;

&lt;p&gt;For smaller applications, global variables are not a problem. It helps your code to easily pass and access data from other classes and methods. You don't need to pass a variable every time you call a method or class.&lt;/p&gt;

&lt;p&gt;Sharing data inside the application using global variables will also help you minimize local variable creation and lesser memory usage.&lt;/p&gt;

&lt;p&gt;But for larger applications, using global variables are bad. It will make your application hard to maintain and read. Looking for global variables just to know how they were created or manipulated will take you some time. And in OOP, it destroys the idea of encapsulation. &lt;/p&gt;

&lt;p&gt;But if you do understand what global variables are, then you just have to make your own decision in your implementation. Just code at your risk :D  &lt;/p&gt;

</description>
      <category>programming</category>
      <category>coding</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Elon Musk's new company</title>
      <dc:creator>Mervin</dc:creator>
      <pubDate>Sat, 11 Nov 2017 15:17:41 +0000</pubDate>
      <link>https://dev.to/mervinsv/elon-musk-new-company-3jd</link>
      <guid>https://dev.to/mervinsv/elon-musk-new-company-3jd</guid>
      <description>&lt;p&gt;Neuralink is an American neurotechnology company founded by Elon Musk and eight others. Is this a possible 'neural lace' company?&lt;/p&gt;

&lt;p&gt;This company was only registered as a medical research company. But we know that Elon Musk's new goal is to create a wireless interface between human brain and computers. &lt;/p&gt;

&lt;p&gt;Neural lace is a technology that will intertwine human brain and computers. They will implant a device in your brain to interact with computers. This can help to improve human memory and merge human brains with software and devices. You can also download your thoughts and upload new data into your brain. &lt;/p&gt;

&lt;p&gt;But is it okay to connect your brain with computers? There are still a lot of hackers out there. They can get/copy all your thoughts or viruses to your brain. &lt;/p&gt;

&lt;p&gt;This is a great technology for artificial intelligence and is a great help for medical purposes. But too dangerous for our brains to interact with computers. We'll just see in the future on how great this technology will bwcome.&lt;/p&gt;

</description>
      <category>technology</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Why I love Javascript</title>
      <dc:creator>Mervin</dc:creator>
      <pubDate>Fri, 10 Nov 2017 01:44:18 +0000</pubDate>
      <link>https://dev.to/mervinsv/why-i-love-javascript-9bg</link>
      <guid>https://dev.to/mervinsv/why-i-love-javascript-9bg</guid>
      <description>&lt;p&gt;Internet, web and computers are not just technologies. They are the reason why I love my job.&lt;/p&gt;

&lt;p&gt;I'm passionate about technologies especially web. I created my first web project using html, css, javascript, php and mysql way back 2015. And since then, I was amazed of how great it is when it comes to working with codes and solving logical problems. It made me realize that programming is so wide and there's a lot to learn to become an expert to it. But even though it's hard, learning is great and it's what I do everyday.&lt;/p&gt;

&lt;p&gt;Learning new frameworks, design patterns and how to make an efficient code are some of the things I do just to become an expert.&lt;/p&gt;

&lt;p&gt;I started working with javascript since 2015 and I loved it. I had also tried using some javascript frameworks like jQuery and Angularjs. These two frameworks are very powerful because of its great functionalities and features.&lt;/p&gt;

&lt;p&gt;Currently, I am studying this new framework called Vuejs. Vuejs is like Angularjs but more faster and lighter.&lt;/p&gt;

&lt;p&gt;Javascript is a language with so much power. It is a programming language for any platform. Today, you can write javascript to run on different platfoms. An example of it is Electron where you can build cross platform desktop apps using javascript, html and css. You can also build mobile apps using ionic. There is also Nodejs which is a server-side javascript framework.&lt;/p&gt;

&lt;p&gt;Recently, Javascript has a new version called ES6(Ecmascript2015) and it is more powerful because of its new features like 'let' and 'const' for scope variable declaration and arrow functions for writing function expressions.&lt;/p&gt;

&lt;p&gt;As of now, javascript is the most popular and widely used programming language for building applications.&lt;/p&gt;

&lt;p&gt;Thank you for reading! I just want to share my first post.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
