<?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: buphmin</title>
    <description>The latest articles on DEV Community by buphmin (@buphmin).</description>
    <link>https://dev.to/buphmin</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%2F100433%2Fca724f12-3f29-4375-bba7-7d1ef2e0a3a7.jpg</url>
      <title>DEV Community: buphmin</title>
      <link>https://dev.to/buphmin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/buphmin"/>
    <language>en</language>
    <item>
      <title>Is ES6 just javascript at this point?</title>
      <dc:creator>buphmin</dc:creator>
      <pubDate>Fri, 03 Dec 2021 04:40:07 +0000</pubDate>
      <link>https://dev.to/buphmin/is-es6-just-javascript-at-this-point-39le</link>
      <guid>https://dev.to/buphmin/is-es6-just-javascript-at-this-point-39le</guid>
      <description>&lt;p&gt;So ES6 released in 2015 giving us some amazing features, such as arrow functions, class syntax and let/const. The many useful features in ES6 caused the development community to rapidly adopt ES6 into their toolkit for writing javascript. &lt;/p&gt;

&lt;p&gt;What do you all think? Is knowing the ends and outs of ES6 required to claim to "know javascript" in 2021? What about ES7...8? Curious to hear everyone's thoughts on when/how a language advancement becomes a benchmark for proficiency. &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>discuss</category>
    </item>
    <item>
      <title>What is an Example of a Quality React App?</title>
      <dc:creator>buphmin</dc:creator>
      <pubDate>Sat, 09 Oct 2021 21:34:22 +0000</pubDate>
      <link>https://dev.to/buphmin/what-is-an-example-of-a-quality-react-app-ib4</link>
      <guid>https://dev.to/buphmin/what-is-an-example-of-a-quality-react-app-ib4</guid>
      <description>&lt;p&gt;Hey all! Hope you all are having a good day and week!&lt;/p&gt;

&lt;p&gt;I am curious if the experienced React developers out there have some open source examples of what they would consider a "quality" React application. More specifically I am looking for examples that are non-trivial (To-Do lists are trivial), and data/business logic driven. &lt;/p&gt;

&lt;p&gt;The reason I ask is that I have had a limited exposure to a variety of React applications and React is the most free form of the big three frameworks (Angular, Vue, React). I am optimistic that with your help that some of my existing opinions of React are invalidated by seeing more examples!&lt;/p&gt;

&lt;p&gt;When I say quality there are a few things I am looking for. The first is well structured code, something that is coherent and easy to reason about. The second point I am looking for is that the app utilizes reusable components, ones that improve both developer experience and time to develop features. And lastly I am looking for effective use of a state management which clearly connects the data to the view.&lt;/p&gt;

</description>
      <category>help</category>
      <category>discuss</category>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>What Would Your Perfect Programming Language Look Like?</title>
      <dc:creator>buphmin</dc:creator>
      <pubDate>Thu, 14 Nov 2019 05:33:14 +0000</pubDate>
      <link>https://dev.to/buphmin/what-would-your-perfect-programming-language-look-like-1om2</link>
      <guid>https://dev.to/buphmin/what-would-your-perfect-programming-language-look-like-1om2</guid>
      <description>&lt;p&gt;So throughout my career I have learned a number of languages and all have their pros and cons. PHP has some weird choices, Python's OOP seems meh, Go is verbose, and JS can be confusing. This has got me thinking: what features and syntax could I combine to create the "perfect" language for me.&lt;/p&gt;

&lt;p&gt;I'll share my thoughts first and I hope to hear from you all on what would be perfect for you!&lt;/p&gt;

&lt;p&gt;Starting off I like OOP, so my fictional language would have OOP components. I also like having the flexibility to just write functions. So a mix like Python and PHP. I like static typing and performance, so pre-compiled and optimized it is. I don't write drivers, games, or OSes so I will forgo explicit memory management for convenience at the cost of performance. I like Go's and typescripts type inference so lets keep that, but with the option of explicit declaration. Go's multiple return types is kind of magical, so lets keep that. But let us keep exceptions and try/catch because that cuts down verbosity. Let's also take another page from Go and keep the language fairly simple. It is 2019 so  multithreading/coroutines must be easy to use. Oh and JS has these effortless awesome maps called objects, lets keep as much of that as we can with static typing. &lt;/p&gt;

&lt;p&gt;So what could my smashed together language look like? Well lets take a peak...&lt;/p&gt;

&lt;p&gt;Classes&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
//hmm interfaces can define properties too like typescript...
//also imports are simple directories relative to the src folder or vendor folder.
//with the exception of the standard library
import AnimalInterface from App/Animals

class Dog implements AnimalInterface
{
  protected sound = "woof!"; //infers string
  public hasFur: boolean;

  //I'm torn as to whether I want the word function, func, fn or nothing...
  public func makeNoise(): void {
    print(this.sound);
  }

  public func getDetails(): (boolean, string) {
    return this.hasFur, this.sound;
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Looping&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;numbers = [1, 2, 3, 4];
map = {
 "dog": "bark",
 "cat": "meow"
}; //string =&amp;gt; string map

//hmm do i like the map type syntax from go?
anotherMap: map[string]string = {}

for number in numbers {
  print(number);
}

for i = 0; i &amp;lt; 3; i++ {
 number = numbers[i];
 print(number);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is hardly everything in a language, but hey it is a start! Now it is your turn.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>programming</category>
    </item>
    <item>
      <title>Vue Form Builder</title>
      <dc:creator>buphmin</dc:creator>
      <pubDate>Sun, 20 Oct 2019 22:04:51 +0000</pubDate>
      <link>https://dev.to/buphmin/vue-form-builder-me0</link>
      <guid>https://dev.to/buphmin/vue-form-builder-me0</guid>
      <description>&lt;p&gt;So I have been looking around for a good vue form builder and I have never really found one that does what I want it to do. Ultimately as a primarily full stack dev I end up having to make both the server side validation and the client side validation. The majority of the time I use client side validation for simple html5 validity checks. Anything more complex then HTML5 checks belong exclusively on the server side, especially since you will need that logic again anyways. What I want in a vue form builder is essentially is to have vue call a formatted API which then vue uses to create the form. &lt;/p&gt;

&lt;p&gt;With that being said this is what I am thinking of creating: a set of vue components that each handle rendering a piece of the form, vuex to store the form state in the form of a module, and some helpers to make it easier to work with.&lt;/p&gt;

&lt;p&gt;Here is a stubbed outline, excuse the naming and such as this is in pre-prototype phase.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Vue&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;vue&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Vuex&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;vuex&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;VueFormBuilderModule&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;vue-builder/Module&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;//whatever this is named&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;FormBuilder&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;vue-builder/FormBuilder&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;Vue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;vuex&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;store&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Vuex&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Store&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;modules&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;VueFormBuilderModule&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Vue&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="nx"&gt;store&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;el&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#app&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nx"&gt;created&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;formData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;http://apiwebsite/form&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;commit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;addForm&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="na"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;formData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;formName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;myform&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;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;//catch errors, you know what to do ;)&lt;/span&gt;
    &lt;span class="p"&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;Then in our template:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight vue"&gt;&lt;code&gt;  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"app"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;form-builder&lt;/span&gt; &lt;span class="na"&gt;form-name=&lt;/span&gt;&lt;span class="s"&gt;"myform"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/form-builder&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Form builder then takes the the following example API response:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"first_name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"field_type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"input"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"data"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"John"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"attributes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"maxlength"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And turns into rendered HTML:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;  &lt;span class="nt"&gt;&amp;lt;form&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"myform"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"first_name"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt; &lt;span class="na"&gt;maxlength=&lt;/span&gt;&lt;span class="s"&gt;"50"&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"John"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Of course the input being bound 2 ways with the vuex data. You need more fields then the api would just contain more. If you need to customize rendering then you would use the provided slots. &lt;/p&gt;

&lt;p&gt;This way you can keep all the logic of building and validating your forms in one spot. &lt;/p&gt;

&lt;p&gt;Let me know what you all think of this idea! Would it be something you would use presuming it was flexible enough? Of course this is intended to be a public repo and FOSS. &lt;/p&gt;

</description>
      <category>discuss</category>
      <category>vue</category>
      <category>forms</category>
      <category>server</category>
    </item>
    <item>
      <title>Exploring Google Cloud Platform</title>
      <dc:creator>buphmin</dc:creator>
      <pubDate>Wed, 14 Aug 2019 04:12:49 +0000</pubDate>
      <link>https://dev.to/buphmin/exploring-google-cloud-platform-1e6i</link>
      <guid>https://dev.to/buphmin/exploring-google-cloud-platform-1e6i</guid>
      <description>&lt;p&gt;Disclaimer: This really isn't a tutorial, more of just some things I did and my thoughts.&lt;/p&gt;

&lt;p&gt;So here I am going to go through my learning and usage of the Google Cloud Platform, or GCP for short. This article roughly summarizes what I did to create a docker based web server with a database on GCP.&lt;/p&gt;

&lt;h1&gt;
  
  
  Background
&lt;/h1&gt;

&lt;p&gt;So awhile back I built a fantasy football draft board website for fun. I built it with PHP using the Symfony framework and Aurelia. Hosting was done on 1&amp;amp;1 and over all I was not satisfied. Performance was meh, php and websockets are not great and I had very little control over the server. The next year I went ahead and rewrote the whole thing. This time I used node and Adonis and Vue on the front with hosting on AWS. Performance skyrocketed with almost all API calls returning under 100ms the sweet spot and I had web sockets for live notifications. AWS worked well but ended up being quite expensive (relative) after the trial for a website sitting there with no traffic. So now I am trying out GCP to see how I like it.&lt;/p&gt;

&lt;h1&gt;
  
  
  Getting Started
&lt;/h1&gt;

&lt;p&gt;The first step was of course setting up an account with GCP. This was as easy as can be since it just links to your Google account. &lt;/p&gt;

&lt;p&gt;Next was launching a VM. For my use I will just be using docker to run the website since docker makes it easy to manage dev/test/prod server configuration and local dev. Looking through the product list it was obvious to me that compute engine is what I needed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jUoYzvxG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/zxkn8m49asqubhnka90e.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jUoYzvxG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/zxkn8m49asqubhnka90e.JPG" alt="Alt Text" width="880" height="364"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Making a VM
&lt;/h1&gt;

&lt;p&gt;Once you get your account you can go into the GCP console and from there getting to the compute engine is easy. Creating a vm is simple, you pick where you want it and how beefy to make it. For me I am just playing around, so a micro instance was sufficient. Now since I plan to only run things on the server from docker I went ahead and chose the "container optimized OS" more on that later. &lt;/p&gt;

&lt;h1&gt;
  
  
  Container Registry
&lt;/h1&gt;

&lt;p&gt;Since I am using docker and containers I wanted a private secure place to store my images. Fortunately GCP makes it easy to create your own registry and push/pull from it. Simply follow the &lt;a href="https://cloud.google.com/container-registry/docs/quickstart"&gt;docs&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Networking
&lt;/h1&gt;

&lt;p&gt;Getting to the correct networking product took a little more effort but I eventually found that the VPC was what I needed. Using the VPC in hind sight is quite easy, but I had a lot of issues due to the VM image I selected. What I wanted was to block all connections that were not from me. Creating a firewall rule with my ip as a filter works great.&lt;/p&gt;

&lt;h3&gt;
  
  
  Trouble in Paradise
&lt;/h3&gt;

&lt;p&gt;I still do not know exactly what was wrong but selecting that container optimized os (chromium os) caused me all sorts of issues. Basically I ssh-ed into the server, ran docker pull on my image, and then docker run --network host and no matter what I could not get access to the website. I thought maybe something was up with docker so I even loaded a Go binary bare bones "hello world" website. Running the binary resulted in "permission denied". I then gave said executable 777 permissions as a sanity check (intending to revert), but still "permission denied." Sudo run, but still permission denied. At that point I abandoned the VM and created a new one with a minimal ubuntu and installed docker. Everything worked fine from there. ¯_(ツ)_/¯&lt;/p&gt;

&lt;h1&gt;
  
  
  Creating a MySQL Instance
&lt;/h1&gt;

&lt;p&gt;GCP has several varieties of databases and database services. After some research  their cloud SQL product is what I needed. It allows you to make a MySQL or Postgres database. The process to create it was simple and similar to creating a compute engine VM. One thing I liked was that it can load and run a SQL file stored on the platform. Following the docs/tooltips/help links I uploaded a small script to create my tables and foo data. Worked like a charm.&lt;/p&gt;

&lt;p&gt;Linking the web VM to the MySQL instance was quite easy with a quick edit I was able to limit access to who could get to the server.&lt;/p&gt;

&lt;h1&gt;
  
  
  Comparison to AWS
&lt;/h1&gt;

&lt;p&gt;So lets see how GCP compares to AWS.&lt;/p&gt;

&lt;p&gt;Pros&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clearer docs&lt;/li&gt;
&lt;li&gt;Easier setup overall&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cons&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AWS was a little easier to debug problems&lt;/li&gt;
&lt;li&gt;AWS performance seems a little higher in response time (tentative)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ultimately the setup between both of them is pretty similar and due to that GCP could seem easier because I already have used a similar product.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;I like GCP so far. Everything was pretty easy to use and setup, with the exception of that strange VM image which still confuses me. The docs were informative and were genuinely helpful. I will have to use it more in order to give a better assessment over all but so far it has my thumbs up.&lt;/p&gt;

</description>
      <category>gcloud</category>
      <category>webdev</category>
      <category>aws</category>
      <category>cloud</category>
    </item>
    <item>
      <title>Are There Good Recruiters?</title>
      <dc:creator>buphmin</dc:creator>
      <pubDate>Tue, 30 Jul 2019 03:54:34 +0000</pubDate>
      <link>https://dev.to/buphmin/are-there-good-recruiters-2fk0</link>
      <guid>https://dev.to/buphmin/are-there-good-recruiters-2fk0</guid>
      <description>&lt;p&gt;So I always hear people make fun of recruiters (myself included), or talk about awful experiences with them but I never really hear anyone say anything good. &lt;/p&gt;

&lt;p&gt;I'm interested to hear if anyone has ever had a good experience with recruiters and would care to share. Maybe some tips on how to spot good recruiters. I think that could help many people in the future.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>recruiters</category>
      <category>recruiting</category>
    </item>
    <item>
      <title>Framework Impressions: A Brief Look Into Lumen</title>
      <dc:creator>buphmin</dc:creator>
      <pubDate>Sun, 12 May 2019 01:28:16 +0000</pubDate>
      <link>https://dev.to/buphmin/framework-impressions-a-brief-look-into-lumen-1l3j</link>
      <guid>https://dev.to/buphmin/framework-impressions-a-brief-look-into-lumen-1l3j</guid>
      <description>&lt;p&gt;So it has taken me some time to think about the next part of this series and how deep I really want to dive into each framework. For this article and the rest I end up making in the series I will do more of a first impression, rather than a deep dive. This should mimic more of a prototyping session than full feature review. Ultimately using a framework (or not) is matter of preference and my role with these articles should be to note the following points:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Are the docs clear and easy to follow&lt;/li&gt;
&lt;li&gt;How versatile is the framework&lt;/li&gt;
&lt;li&gt;A quick glance at performance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With that out of the way lets take a look at &lt;a href="https://lumen.laravel.com/"&gt;Lumen&lt;/a&gt;. Lumen is a micro-framework based off &lt;a href="https://laravel.com/"&gt;Laravel&lt;/a&gt; which by extension is partially based on &lt;a href="https://symfony.com/"&gt;Symfony&lt;/a&gt; components. In my quick impression of Lumen I would say usage is relatively straight forward, especially after using &lt;a href="https://adonisjs.com/"&gt;AdonisJS&lt;/a&gt;, which is modeled after Laravel.&lt;/p&gt;

&lt;h2&gt;
  
  
  Documentation
&lt;/h2&gt;

&lt;p&gt;The docs is the first part that struck me as a bit odd and hard to follow regarding Lumen. The docs have a bad habit of basically saying "it's not documented here, go look at the Laravel docs." This could be fine, but some of the context and usage is different in Lumen than in Laravel so sometimes you have to piece it together yourself. This was immediately apparent when I simply just wanted to do a raw sql query. The docs say&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;app&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'db'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"SELECT * FROM users"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;but it was unclear to me that 'app' is a global function.&lt;/p&gt;

&lt;h2&gt;
  
  
  Versatility
&lt;/h2&gt;

&lt;p&gt;Due to the way Lumen is structured you have mostly free reign over what you want to do. Besides a few things you can mostly use raw PHP based off everything I have seen. Creating services is fairly straightforward and you can rely on the dependency injection engine to managed dependencies for you. I did not toy around with ORMs since this is a micro-framework, but there is the option to use them if you want. It looks like Eloquent, the Laravel ORM, is readily available if you want. Overall I don't think there is much you couldn't due with Lumen as long as it is supported by the PHP platform. &lt;/p&gt;

&lt;p&gt;Setting up a route was fairly trivial. You can define the route in web.php with a callback or a string reference to a class function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;
&lt;span class="nv"&gt;$router&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'league_players/raw/{id}'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$sql&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"
            select * from 
            league_player lp
            join league l on lp.league_id = l.id
            join player p on lp.player_id = p.id
            where lp.id = :id
        "&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;app&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'db'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$sql&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'id'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$id&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nv"&gt;$router&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'league_players/service/{id}'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'LeaguePlayerController@getLeaguePlayer'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Dependency Injection
&lt;/h3&gt;

&lt;p&gt;Lumen does have dependency injection available and I was able to create a route using a class controller and injecting a service to the class route. I did not notice a significant overhead using the class method and DI. &lt;/p&gt;

&lt;h2&gt;
  
  
  Performance
&lt;/h2&gt;

&lt;p&gt;So I am going to change up my performance testing from now on. Since I do not have a separate machine to run testing on I will just give my two cents and a repo you can use to do your own testing.&lt;/p&gt;

&lt;p&gt;Running through a few scenarios I found Lumen to be close to but faster then Symfony 4. Under single requests there was no difference. At a 100+ concurrent requests you do notice Lumen pulling ahead.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Overall I am not super impressed with Lumen. In today's world where expressjs is commonplace I feel like the need for Lumen is not really there. The docs are adequate but not superb and performance (stock at least) is not good enough vs Symfony to really consider using it over Symfony. &lt;/p&gt;

&lt;p&gt;I would say you are better off using a full featured PHP framework, or picking up express (and learning node.js) if you want a straightforward microframework with high performance. Another option would be to create your own with some simple setup if you really want to stick to php. &lt;/p&gt;

&lt;p&gt;Well that about wraps up my impressions of Lumen. Let me know your thoughts in the comments. &lt;/p&gt;

&lt;p&gt;What framework/microframework should I look at next? I'm thinking something in js/go, let me know!&lt;/p&gt;

&lt;p&gt;EDIT:&lt;/p&gt;

&lt;p&gt;I forgot to link the repo so you can play around with what I did! &lt;a href="https://github.com/buphmin/LumenComparison"&gt;https://github.com/buphmin/LumenComparison&lt;/a&gt;&lt;/p&gt;

</description>
      <category>php</category>
      <category>lumen</category>
      <category>framework</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Some Observations While Learning Golang</title>
      <dc:creator>buphmin</dc:creator>
      <pubDate>Sun, 03 Feb 2019 18:42:05 +0000</pubDate>
      <link>https://dev.to/buphmin/some-observations-while-learning-golang-fnp</link>
      <guid>https://dev.to/buphmin/some-observations-while-learning-golang-fnp</guid>
      <description>&lt;p&gt;So I have been doing a bit of coding in golang recently and I figured I would share some of my observations.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Standard Library is Very Robust
&lt;/h2&gt;

&lt;p&gt;I have found so far that everything I have needed to do so far can be done at least pretty well with the standard library. That is not to say it is perfect, but there has been nothing that I could not do. Need to call an API? Just import net/http. Want to convert something to json? Just import encoding/json. Go's standard library has you covered for all of your basic needs including: IO, file system, encryption, etc. So far the only thing I haven't really been a fan of is the standard logger. For that I replaced it with &lt;a href="https://github.com/uber-go/zap"&gt;zap logger&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Go's Dependency Management Could Be Better
&lt;/h2&gt;

&lt;p&gt;So far I have exclusively made use of go modules as a feature in Go 1.11 which released in August of 2018. This allows each project to live in a separate directory anywhere in the file system and have version controlled dependencies. From my understanding this is the first official way of having project specific dependencies. So far though I have found some things just do not work using go modules. For instance I was unable to use &lt;a href="https://revel.github.io/"&gt;Revel&lt;/a&gt; using go modules, which I had planned to explore as the 2nd entry in my framework impressions series. Compared to npm and composer, the two package managers I am familiar with, Go needs some time to get everything standardized and to get all of the libraries on board.&lt;/p&gt;

&lt;h2&gt;
  
  
  Go Is Versatile
&lt;/h2&gt;

&lt;p&gt;Specifically there are three unique features of go which offer the developer a ton of flexibility: methods on any data type, multiple return values for functions, and interfaces. &lt;/p&gt;

&lt;h3&gt;
  
  
  Methods on Any Data Type
&lt;/h3&gt;

&lt;p&gt;So in go any data type can have methods. For instance lets say I want a int that can double itself.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;Doubler&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;Doubler&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;Double&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="n"&gt;Doubler&lt;/span&gt;
    &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;
    &lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Double&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c"&gt;//prints 6!&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This can be pretty handy, though be careful not to abuse it. I can easily see this feature abused into some strange spaghetti.&lt;/p&gt;

&lt;h3&gt;
  
  
  Multiple Return Values
&lt;/h3&gt;

&lt;p&gt;So in go functions can return multiple values of any variance of data type. This allows for some very nice possibilities that require workarounds to achieve in other languages. For instance say you want to compare two people to check if they are the same:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;Person&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Name&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;Age&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;//isSamePerson takes two Person structs and returns whether they are equal&lt;/span&gt;
&lt;span class="c"&gt;//It also returns a list of differences&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;isSamePerson&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;firstPerson&lt;/span&gt; &lt;span class="n"&gt;Person&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;secondPerson&lt;/span&gt; &lt;span class="n"&gt;Person&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;bool&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;differences&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;{}&lt;/span&gt;
    &lt;span class="n"&gt;isSame&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;firstPerson&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Name&lt;/span&gt;&lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;secondPerson&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;differences&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;differences&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Names do not match"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;isSame&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;false&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;firstPerson&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Age&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;secondPerson&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Age&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;differences&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;differences&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Ages do not match"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;isSame&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;false&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;isSame&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;differences&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we have a function that checks if two people are the same, and we can get the boolean value that we need, but we also can see what is different.&lt;/p&gt;

&lt;h3&gt;
  
  
  Interfaces
&lt;/h3&gt;

&lt;p&gt;Interfaces in Go work quite a bit different than other languages. Interfaces represent a sort of contract between two parts of your code defining the behavior of functions. In most object oriented languages an interface is an explicit declaration on a class stating that it must have said functions with the defined requirements in an interface. Go takes a different approach with its interfaces by making them implicitly defined. Any data type that has methods matching the signature of the interface is acceptable to use. This is good and bad in my opinion. Combined with Golang's capability of having methods on any data type this allows for very flexible usage. This means any data type can satisfy the interface if the methods match. Additionally a data type can potentially satisfy multiple interfaces without conflict. I have found while coding is that it is harder to make sure you are implementing an interface. This is largely due to the implicit nature of Go's interfaces. Example time!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;Doubleable&lt;/span&gt; &lt;span class="k"&gt;interface&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;Double&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;DoubleInt&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; 

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;DoubleInt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;Double&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;DoublePeople&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;NumPeople&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;DoublePeople&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;Double&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;NumPeople&lt;/span&gt; &lt;span class="o"&gt;*=&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;numInt&lt;/span&gt; &lt;span class="n"&gt;DoubleInt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;
    &lt;span class="n"&gt;people&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;DoublePeople&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;NumPeople&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="n"&gt;doDouble&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;numInt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;doDouble&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;people&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;numInt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="c"&gt;//prints 2&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;people&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;NumPeople&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="c"&gt;//prints 8&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


&lt;span class="c"&gt;//doDouble takes a doubler and doubles it&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;doDouble&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;doubler&lt;/span&gt; &lt;span class="n"&gt;Doubleable&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;doubler&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Double&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;Both an int type and a struct type can both be doubled and can both be passed to the doDouble function since they both implicitly satisfy the Doubleable interface.&lt;/p&gt;

&lt;h2&gt;
  
  
  Go Has Some Nice Tooling
&lt;/h2&gt;

&lt;p&gt;Unlike other languages I have worked with Go has some nice built in tools. Unit testing, benchmarking, and profiling are all included without needing to install any 3rd party utilities. Additionally debugging also works from the start. This means getting started to writing go code is quite straight forward, at least when using go modules. Go vet can check your code for common problems and go fmt formats your code to the Go standard. Overall compared to PHP and JS at least I &lt;em&gt;needed&lt;/em&gt; to install far less things just to get started with writing and testing code. This doesn't mean all of the tools are perfect for everyone, for instance you may want to extend the testing suite with an assertion library or a BDD framework. Regardless Go gives you the tools you need to write good well tested code. &lt;/p&gt;

&lt;p&gt;Go is a neat language and so far I have found it to be a pretty simple language to use. There is very little syntax, and a fairly small amount of concepts you need to know to be effective.&lt;/p&gt;

</description>
      <category>go</category>
    </item>
    <item>
      <title>What I learned In 2018!</title>
      <dc:creator>buphmin</dc:creator>
      <pubDate>Sun, 06 Jan 2019 18:34:58 +0000</pubDate>
      <link>https://dev.to/buphmin/what-i-learned-in-2018-5m</link>
      <guid>https://dev.to/buphmin/what-i-learned-in-2018-5m</guid>
      <description>&lt;p&gt;We developers have a tendency of telling ourselves that we aren't good enough and have been too lazy because we didn't learn everything. For me I certainly felt like I learned almost nothing this year until I broke it down and analyzed my year logically. I took a look at all the things I learned in between my normal work, and life schedule and compiled a list.&lt;/p&gt;

&lt;p&gt;Without further ado here are the things I learned:&lt;/p&gt;

&lt;h2&gt;
  
  
  Webpack
&lt;/h2&gt;

&lt;p&gt;I may have caught on late but I dedicated some time to learn webpack and got it implemented at my work and personal projects. I love the bundling and the ability to write js code as modules. Additionally being able to use typescript and vue together has been a great boon.&lt;/p&gt;

&lt;h3&gt;
  
  
  What I Can Improve
&lt;/h3&gt;

&lt;p&gt;One thing I have not been able to find is why webpack adds so much extra code as part of the bundling process. It is not terribly significant in most of the work I do because we have an internal app at LAN speed, but for a live website that can be significant.&lt;/p&gt;

&lt;h2&gt;
  
  
  Typescript
&lt;/h2&gt;

&lt;p&gt;Typescript is great. Slowly we have been transitioning older code to use typescript and it has been a boon. Refactoring code becomes much easier, and understanding the flow of larger programs becomes easier.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Can Get Better
&lt;/h3&gt;

&lt;p&gt;Generics can be tricky sometimes and there are a few things that can take me some time to figure out (I'm looking at you bluebird promises + async/await).&lt;/p&gt;

&lt;h2&gt;
  
  
  Golang
&lt;/h2&gt;

&lt;p&gt;I took the opportunity at work to learn golang for a project that could be sped up considerably with threading. I found Go to be very intuitive and easy to learn. I can certainly see why some choose to move to Go for high performance needs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Things To Improve
&lt;/h3&gt;

&lt;p&gt;I'm still not quite fluent so I need some more practice before I feel like I can tackle anything. The other thing is I really focused on go modules in 1.11 so my understanding of the classic Go dev methodology could use some work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Some Other Things That I Will List
&lt;/h2&gt;

&lt;p&gt;Lets see what else I  can remember...&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node.js for webdev (used before in a kafka event system)&lt;/li&gt;
&lt;li&gt;Adonis framework&lt;/li&gt;
&lt;li&gt;Improved JS/PHP fundamentals&lt;/li&gt;
&lt;li&gt;Some basics of C++&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What To Do In 2019?
&lt;/h2&gt;

&lt;p&gt;I am not much of a new year's resolution person, but I do have a few ideas on what I want to learn in 2019.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Golang api webdev&lt;/li&gt;
&lt;li&gt;Vue server side rendering&lt;/li&gt;
&lt;li&gt;Progressive Web Apps&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All right folks, that's it for this post. Hopefully I have inspired you to take a look at your own work over the year and give yourself a pat on the back for all that you accomplished!&lt;/p&gt;

</description>
      <category>career</category>
      <category>learning</category>
      <category>programming</category>
      <category>review</category>
    </item>
    <item>
      <title>Are Side Projects THAT Important?</title>
      <dc:creator>buphmin</dc:creator>
      <pubDate>Wed, 12 Dec 2018 04:12:34 +0000</pubDate>
      <link>https://dev.to/buphmin/are-side-projects-that-important-pk6</link>
      <guid>https://dev.to/buphmin/are-side-projects-that-important-pk6</guid>
      <description>&lt;p&gt;So I have been trying to force myself to start a new side project recently and it has got me thinking how important it really is to have side projects. I believe learning is important and to keep on top of technology but do you really need a bunch of side projects to do that?&lt;/p&gt;

&lt;p&gt;I have had exactly &lt;em&gt;one&lt;/em&gt; major side project to build a fantasy football draft board. I first built it in Symfony and Aurelia, but I was not pleased with the result so I rebuilt it with Adonis and Vue for backend and frontend respectively. I learned a lot in the process about building API driven single page apps.&lt;/p&gt;

&lt;p&gt;On the other hand I also learn a ton by fiddling with things at work in between projects and by reading articles such as on DEV. &lt;/p&gt;

&lt;p&gt;So I wanted to see what the good people of DEV think about side projects and how necessary they are. I for one think that they are nice to have, but not at the expense of your happiness and well being. &lt;/p&gt;

</description>
      <category>discuss</category>
      <category>career</category>
    </item>
    <item>
      <title>Framework Impressions: A Brief Look Into Symfony 4</title>
      <dc:creator>buphmin</dc:creator>
      <pubDate>Sun, 18 Nov 2018 21:23:02 +0000</pubDate>
      <link>https://dev.to/buphmin/framework-impressions-a-brief-look-into-symfony-4-4l70</link>
      <guid>https://dev.to/buphmin/framework-impressions-a-brief-look-into-symfony-4-4l70</guid>
      <description>&lt;p&gt;Edit:&lt;/p&gt;

&lt;p&gt;I went ahead and ran some performance tests again with optimizations with better results.&lt;/p&gt;

&lt;h1&gt;
  
  
  Preface
&lt;/h1&gt;

&lt;p&gt;This is the first post in a series of articles I plan to write where I will be looking at a variety of server side web frameworks or using no framework in several languages. &lt;/p&gt;

&lt;h2&gt;
  
  
  Goals
&lt;/h2&gt;

&lt;p&gt;My primary goal is to highlight a few server side frameworks and to give enough information so that you, the reader, can make a judgement as to whether or not you should do more investigation for your use case.&lt;/p&gt;

&lt;p&gt;Here are some goals:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Test flexibility

&lt;ul&gt;
&lt;li&gt;Does it impede dev?&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;SQL compatibility 

&lt;ul&gt;
&lt;li&gt;Can you use raw sql&lt;/li&gt;
&lt;li&gt;Is the ORM, if present, good for almost any type of query?&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Quick response time performance for a multi join api endpoint

&lt;ul&gt;
&lt;li&gt;How many concurrent users can the framework support before response time is too high for good UX.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;p&gt;I have done everything in docker to make it easy to keep things separated. For load testing I will be using &lt;a href="https://k6.io/" rel="noopener noreferrer"&gt;k6&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/buphmin/symfony4-impressions" rel="noopener noreferrer"&gt;https://github.com/buphmin/symfony4-impressions&lt;/a&gt;&lt;br&gt;
Load tester:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker pull loadimpact/k6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As a reference for the performance portion here is how I am testing&lt;/p&gt;

&lt;h3&gt;
  
  
  Hardware/Hardware Config
&lt;/h3&gt;

&lt;p&gt;My hardware is faster than the majority of people so your mileage may vary on the benchmarks. I am also running everything within a linux mint 19 VM. Specs are as reserved by the VM.&lt;/p&gt;

&lt;p&gt;i7 8700k running at 4.9ghz 6 cores&lt;br&gt;
8GB ram running at 3600mhz&lt;/p&gt;

&lt;p&gt;Cores 0-1 reserved for the web server&lt;br&gt;
Cores 2-3 reserved for the database&lt;br&gt;
Cores 4-5 reserved for k6&lt;/p&gt;
&lt;h1&gt;
  
  
  Impressions
&lt;/h1&gt;

&lt;p&gt;So as a disclaimer I have worked with Symfony for many years, so this is hardly a first impression for me. I do feel, however, that I can objectively qualify Symfony's strengths and weaknesses in a way that you can determine whether or not it warrants your attention. You should always judge a technology for yourself and not blindly think it is good just because (insert famous person here) said so.&lt;/p&gt;
&lt;h2&gt;
  
  
  What is Symfony
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://symfony.com/" rel="noopener noreferrer"&gt;Symfony&lt;/a&gt; is a full featured full stack framework designed to give you an all in one solution for web development. Symfony attempts to be a one size fits all type of framework with built in authentication, server side rendering/templating, api support, etc.&lt;/p&gt;
&lt;h2&gt;
  
  
  Flexibility
&lt;/h2&gt;

&lt;p&gt;In terms of flexibility Symfony is quite flexible, especially for a fully featured framework. That does not mean Symfony is perfect though. You have to live with the config files that Symfony requires and set them up in the Symfony way. Additionally by default Symfony expects you to put your files in specific locations forcing you to &lt;/p&gt;

&lt;p&gt;Symfony allows you to override many of it's conventions but you will likely find troublesome. For instance you can &lt;a href="https://symfony.com/doc/current/configuration/override_dir_structure.html" rel="noopener noreferrer"&gt;override&lt;/a&gt; the directory structure, but then likely be confused when the docs assume you are using the defaults. &lt;/p&gt;

&lt;p&gt;For SQL Symfony ships with &lt;a href="https://www.doctrine-project.org/index.html" rel="noopener noreferrer"&gt;Doctrine&lt;/a&gt; for use of both the ORM and DBAL (DataBase Abstraction Layer). Both can be used exclusively or simultaneously. The doctrine ORM is pretty good and will allow you to use &lt;em&gt;most&lt;/em&gt; database structures. A notable weakness is composite foreign key relations as primary keys which either cannot be done or will take some creativity to work around. The doctrine mapping can take some time to setup but Symfony comes with some &lt;a href="https://symfony.com/doc/current/doctrine/reverse_engineering.html" rel="noopener noreferrer"&gt;tools&lt;/a&gt; to make the process simpler if you have already structured your database. On the flip side you can use the Doctrine DBAL for raw SQL. The DBAL is just a light wrapper around PDO, PHP's native database connection library that provides some convenience methods. Symfony also has the ability to use other connection interfaces, such as to connect to MongoDB, but the Symfony docs shy away from that and I will not cover it here. Between the the ORM and DBAL you have ways to work with a SQL database however you need.&lt;/p&gt;

&lt;p&gt;Here are some examples of raw SQL vs ORM endpoints with multi join:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;    &lt;span class="cd"&gt;/**
     * @param integer $id
     * @param Connection $conn
     * @return JsonResponse
     * @Route(path="/league_players/raw/{id}", name="league_player_raw")
     */&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;getLeaguePlayerRawAction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;Connection&lt;/span&gt; &lt;span class="nv"&gt;$conn&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$sql&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"
            select * from 
            league_player lp
            join league l on lp.league_id = l.id
            join player p on lp.player_id = p.id
            where lp.id = :id
        "&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="nv"&gt;$leaguePlayers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$conn&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;fetchAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$sql&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="s1"&gt;'id'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$id&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="nb"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$leaguePlayers&lt;/span&gt;&lt;span class="p"&gt;)&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="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;NotFoundHttpException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Player not found'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;JsonResponse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$leaguePlayers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="cd"&gt;/**
     * @param LeaguePlayer $leaguePlayer
     * @param SerializerInterface $serializer
     * @return Response
     * @Route(path="/league_players/{leaguePlayer}", name="league_player")
     */&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;getLeaguePlayerAction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;LeaguePlayer&lt;/span&gt; &lt;span class="nv"&gt;$leaguePlayer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;SerializerInterface&lt;/span&gt; &lt;span class="nv"&gt;$serializer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$serializer&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;serialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$leaguePlayer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'json'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$data&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;To end the flexibility section it is interesting to note that the Symfony framework is build from a motley of independent &lt;a href="https://symfony.com/components" rel="noopener noreferrer"&gt;reusable components&lt;/a&gt;. Each of these can be used outside of the Symfony framework as a whole. For instance if you just need a router utility then you can use the Symfony routing component and manage the rest of the stack yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Performance
&lt;/h2&gt;

&lt;p&gt;I will be judging the two endpoints above to judge the raw SQL implementation and the ORM implementation. The ORM implementation is slightly different, but is a realistic implementation of what you might do with an ORM endpoint.&lt;/p&gt;

&lt;h3&gt;
  
  
  1 Concurrent User
&lt;/h3&gt;

&lt;p&gt;Raw:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;--network&lt;/span&gt; host &lt;span class="nt"&gt;--cpuset-cpus&lt;/span&gt; &lt;span class="s2"&gt;"4-5"&lt;/span&gt; &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="nv"&gt;$PWD&lt;/span&gt;/loadTests:/src &lt;span class="nt"&gt;-i&lt;/span&gt; loadimpact/k6 run &lt;span class="nt"&gt;--vus&lt;/span&gt; 1 &lt;span class="nt"&gt;--duration&lt;/span&gt; 10s /src/getLeaguePlayerRaw.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;http_req_duration..........: &lt;span class="nv"&gt;avg&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;4.51ms  &lt;span class="nv"&gt;min&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;3.51ms  &lt;span class="nv"&gt;med&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;4.46ms  &lt;span class="nv"&gt;max&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;5.76ms   p&lt;span class="o"&gt;(&lt;/span&gt;90&lt;span class="o"&gt;)=&lt;/span&gt;5.09ms  p&lt;span class="o"&gt;(&lt;/span&gt;95&lt;span class="o"&gt;)=&lt;/span&gt;5.42ms

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pretty good performance, 11.73ms duration. Obviously since this is local to local this is not exactly "real" world performance but it gives us a rough idea.&lt;/p&gt;

&lt;p&gt;ORM:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;--network&lt;/span&gt; host &lt;span class="nt"&gt;--cpuset-cpus&lt;/span&gt; &lt;span class="s2"&gt;"4-5"&lt;/span&gt; &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="nv"&gt;$PWD&lt;/span&gt;/loadTests:/src &lt;span class="nt"&gt;-i&lt;/span&gt; loadimpact/k6 run &lt;span class="nt"&gt;--vus&lt;/span&gt; 1 &lt;span class="nt"&gt;--duration&lt;/span&gt; 10s /src/getLeaguePlayer.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;http_req_duration..........: &lt;span class="nv"&gt;avg&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;16.74ms &lt;span class="nv"&gt;min&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;15.06ms &lt;span class="nv"&gt;med&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;15.98ms &lt;span class="nv"&gt;max&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;21.15ms  p&lt;span class="o"&gt;(&lt;/span&gt;90&lt;span class="o"&gt;)=&lt;/span&gt;19.43ms p&lt;span class="o"&gt;(&lt;/span&gt;95&lt;span class="o"&gt;)=&lt;/span&gt;20.29ms
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The ORM implementation is close to double the request time in this scenario. &lt;/p&gt;

&lt;h3&gt;
  
  
  10 Concurrent Users
&lt;/h3&gt;

&lt;p&gt;Change --vus to 10&lt;/p&gt;

&lt;p&gt;Raw:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; http_req_duration..........: &lt;span class="nv"&gt;avg&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;8.81ms  &lt;span class="nv"&gt;min&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;3.24ms &lt;span class="nv"&gt;med&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;8.35ms &lt;span class="nv"&gt;max&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;19.11ms  p&lt;span class="o"&gt;(&lt;/span&gt;90&lt;span class="o"&gt;)=&lt;/span&gt;12.5ms  p&lt;span class="o"&gt;(&lt;/span&gt;95&lt;span class="o"&gt;)=&lt;/span&gt;17.18ms
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;ORM:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;http_req_duration..........: &lt;span class="nv"&gt;avg&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;51.44ms &lt;span class="nv"&gt;min&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;14.81ms &lt;span class="nv"&gt;med&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;51.05ms &lt;span class="nv"&gt;max&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;82.89ms  p&lt;span class="o"&gt;(&lt;/span&gt;90&lt;span class="o"&gt;)=&lt;/span&gt;76.4ms  p&lt;span class="o"&gt;(&lt;/span&gt;95&lt;span class="o"&gt;)=&lt;/span&gt;80.5ms
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The extra load of the ORM method is becoming evident.&lt;/p&gt;

&lt;h3&gt;
  
  
  50 Concurrent Users
&lt;/h3&gt;

&lt;p&gt;Change --vus to 50&lt;/p&gt;

&lt;p&gt;Raw:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;http_req_duration..........: &lt;span class="nv"&gt;avg&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;34.75ms  &lt;span class="nv"&gt;min&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;4.57ms &lt;span class="nv"&gt;med&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;31.57ms &lt;span class="nv"&gt;max&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;90.81ms  p&lt;span class="o"&gt;(&lt;/span&gt;90&lt;span class="o"&gt;)=&lt;/span&gt;58.4ms  p&lt;span class="o"&gt;(&lt;/span&gt;95&lt;span class="o"&gt;)=&lt;/span&gt;76.5ms
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;ORM:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;http_req_duration..........: &lt;span class="nv"&gt;avg&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;201.94ms &lt;span class="nv"&gt;min&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;15ms    &lt;span class="nv"&gt;med&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;216.65ms &lt;span class="nv"&gt;max&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1.69s    p&lt;span class="o"&gt;(&lt;/span&gt;90&lt;span class="o"&gt;)=&lt;/span&gt;334.99ms p&lt;span class="o"&gt;(&lt;/span&gt;95&lt;span class="o"&gt;)=&lt;/span&gt;369.24ms

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Edit:&lt;/p&gt;

&lt;p&gt;Performance is pretty good with raw SQL in my tests at 50 concurrent users. I will note that I saw a very wide variation between runs. Most runs were between 28-45ms but some shot to 400ms, which could just be the limitations of my testing environment. With the implemented optimizations performance I was able to get around 130ms response time at 200 concurrent users. This is good but still trails behind anything in node.js as we will see in future articles ;) &lt;/p&gt;

&lt;p&gt;&lt;del&gt;Here we are at the limit of what 2 cores can achieve. 500ms is too much for good UX in most circumstances. We find that the ORM adds extra overhead over the raw SQL implementation which is to be expected.&lt;/del&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;My impression of Symfony is that it quite flexible and gives you a lot of ways to go about your business. &lt;/p&gt;

&lt;p&gt;Pros&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;flexibility&lt;/li&gt;
&lt;li&gt;good docs&lt;/li&gt;
&lt;li&gt;mostly stays out of your way&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cons&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;some limitations with the ORM&lt;/li&gt;
&lt;li&gt;high concurrent user performance is not great&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Recommendation:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fs3.amazonaws.com%2Fpix.iemoji.com%2Fimages%2Femoji%2Fapple%2Fios-11%2F256%2Fthumbs-up.png" 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%2Fs3.amazonaws.com%2Fpix.iemoji.com%2Fimages%2Femoji%2Fapple%2Fios-11%2F256%2Fthumbs-up.png" alt="thumbs"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I would say Symfony is worth taking a look at for most people who are interested in a framework. It offers good flexibility and pretty good low load performance which makes it ideal for an internal company app. &lt;/p&gt;

&lt;p&gt;Let me know if you have any insights or questions as this will be my first fairly in depth article.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>php</category>
    </item>
    <item>
      <title>How to Stay Productive at Work During Slow Periods</title>
      <dc:creator>buphmin</dc:creator>
      <pubDate>Thu, 04 Oct 2018 03:43:33 +0000</pubDate>
      <link>https://dev.to/buphmin/how-to-stay-productive-at-work-during-slow-periods-1g5m</link>
      <guid>https://dev.to/buphmin/how-to-stay-productive-at-work-during-slow-periods-1g5m</guid>
      <description>&lt;p&gt;Here I will be covering some ideas on how to be productive at work when you have no assigned tasks, or when you are waiting to be able to work on something.&lt;/p&gt;

&lt;p&gt;I currently work for a marketing intelligence company, where we take tons of data, analyze it, and use it to find the best audience to market to. The nature of our company means that we get very busy for the holiday marketing push and then slow down after the holidays are over. Due to this our main development pushes are early in the year with a slowdown towards the end of the year. This leaves plenty of time to work on something like learning or refactoring some old code.&lt;/p&gt;

&lt;p&gt;I will split this into three categories of work to be done: new code, refactoring, learning.&lt;/p&gt;

&lt;p&gt;For new code I am primary talking about new libraries to help clean up development or make the development process easier down the road. Anyone who has worked in dev for awhile can testify that sometimes we are moving to quickly to write a reusable library for something, or perhaps we &lt;em&gt;think&lt;/em&gt; we will only use a piece of code in this one spot. Look at and pick some repetitive code that would be useful to have in a centralized utility and have at it. Another option for new code is to look at new technology and see if it is useful for your situation. For me typescript was a perfect contender for our complex javascript.&lt;/p&gt;

&lt;p&gt;The second option is refactoring existing code. Maybe you wrote the code years ago or someone else did, but either way every time you have to interact with it you groan (to yourself or out loud). This is a perfect contender of something that can be refactored. Use some prudence when choosing what to refactor based of your time and the impact it will have. &lt;/p&gt;

&lt;p&gt;Lastly you can use your free time to learn something new. Maybe it's a new language, some new techniques, or the latest features in your language(s) of choice. As a developer we always need to be expanding our knowledge and capabilities and taking some time to learn will be a benefit to you and your company.&lt;/p&gt;

&lt;p&gt;So the next time you feel like you do not have anything to work on and are tempted to go to facebook, reddit, or similar (dev.to is ok ;P) consider one of the options above.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
