<?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: Ayush Likhar</title>
    <description>The latest articles on DEV Community by Ayush Likhar (@mechtech5).</description>
    <link>https://dev.to/mechtech5</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F236820%2Fed5db9de-1f8d-45fd-a8de-b17a73a442cb.jpeg</url>
      <title>DEV Community: Ayush Likhar</title>
      <link>https://dev.to/mechtech5</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mechtech5"/>
    <language>en</language>
    <item>
      <title>A Responsible Programmer</title>
      <dc:creator>Ayush Likhar</dc:creator>
      <pubDate>Sun, 26 Jan 2020 08:47:12 +0000</pubDate>
      <link>https://dev.to/mechtech5/a-responsible-programmer-1m22</link>
      <guid>https://dev.to/mechtech5/a-responsible-programmer-1m22</guid>
      <description>&lt;p&gt;It's Sunday... so in an attempt to bring something meaningful out of it. I decided to watch something about &lt;code&gt;Design Principles&lt;/code&gt; as it's a current hot topic on my team and I came across this video of 'Uncle Bob' (Robert Cecil Martin) speaking at Laracon 2018.&lt;/p&gt;

&lt;p&gt;It's a hour long talk but what grabbed my attention is at the near end of the video, he talks about being a responsible programmer.&lt;/p&gt;

&lt;p&gt;So, a financial agency had an algorithm they used to break down a large trade into smaller chunks of trades and it was working quite well and later they wrote a new one and pushed it while keeping the old one there and just disabled it with a "flag" while that flag comes in via incoming transactions!!&lt;/p&gt;

&lt;p&gt;Some of you might have got some tingling sensation down your spine after reading this.&lt;/p&gt;

&lt;p&gt;Later a new tax law comes in and they modified the code to compensate for it pushed to servers but left out 1 server by "mistake" and 10 minutes later got a call from SEC. The coders panic and replace it will old code... TOTAL CHAOS! 450 million dollars down the drain in just 45 mins.&lt;/p&gt;

&lt;p&gt;The point he was trying to make it, that the functioning of society depends upon us in many different ways and It's very predictable that one fine day some poor software guy or girl might do something stupid and kill 10000 people..&lt;/p&gt;

&lt;p&gt;The next thing will be the government pointing fingers at us and that time you can't make excuses like our boss told us that it's very "urgent" and we had to deliver this by today evening since that would be ridiculous.&lt;/p&gt;

&lt;p&gt;Some strict regulations might get imposed upon us in future in form of lists showing what programming languages, frameworks or even IDEs to use and what's prohibited and nobody is gonna like that. &lt;/p&gt;

&lt;p&gt;Now I might be come off as paranoid but sooner or later this is gonna happen if we don't understand the seriousness of it.&lt;/p&gt;

&lt;p&gt;So before the government imposes it, we should go ahead and apply some regulations by ourselves just like the doctor's community did.&lt;/p&gt;

&lt;p&gt;The best candidate is TDD (Test Driven Development) that makes sure you and your code is reliable. I just want you folks to give it some thought. That's it. Till then adios! I will be back. Bye for now :)&lt;/p&gt;

&lt;p&gt;Here's the link BTW: &lt;a href="https://www.youtube.com/watch?v=NeXQEJNWO5w"&gt;https://www.youtube.com/watch?v=NeXQEJNWO5w&lt;/a&gt;&lt;/p&gt;

</description>
      <category>codequality</category>
      <category>career</category>
    </item>
    <item>
      <title>Recent Interview Experience</title>
      <dc:creator>Ayush Likhar</dc:creator>
      <pubDate>Thu, 23 Jan 2020 06:02:55 +0000</pubDate>
      <link>https://dev.to/mechtech5/recent-interview-experience-39hc</link>
      <guid>https://dev.to/mechtech5/recent-interview-experience-39hc</guid>
      <description>&lt;p&gt;I'm sharing my recent interview experience for the job description:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Strong understanding of Object Oriented Programming&lt;/li&gt;
&lt;li&gt;Solid development experience in PHP, Laravel, Rest API, GIT&lt;/li&gt;
&lt;li&gt;Strong troubleshooting skills and Good experience of using source control systems.: TFS, GIT&lt;/li&gt;
&lt;li&gt;A natural communicator who can explain technical concepts in clear, plain English (both written and verbal)&lt;/li&gt;
&lt;li&gt;Should be able to explain at least one of his/her development assignments with reasoning; as to how it was designed, what approach were used and why?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So, here is how it went&lt;/p&gt;

&lt;p&gt;explain me in brief about this xyz project you did&lt;br&gt;
what's a persist cookie&lt;br&gt;
how a php session works and why we use it?&lt;br&gt;
suppose if we disable cookies in our browser, are we able to login?&lt;br&gt;
explain the entire process of session implementation in your php project&lt;br&gt;
Did you implement caching in your laravel project, how it works&lt;br&gt;
What are facades&lt;br&gt;
what's an abstract class&lt;br&gt;
Difference between abstract class and interface&lt;br&gt;
why do we use interface&lt;br&gt;
Can you explain me the request lifecycle in laravel&lt;br&gt;
what's polymorphism&lt;br&gt;
explain method overloading and overriding with an example and their differences&lt;br&gt;
what's ajax and explain synchronous and asynchronous requests&lt;br&gt;
can we send a synchronous request in ajax&lt;br&gt;
what's indexing in SQL&lt;br&gt;
how indexing affects the select, insert and update queries&lt;br&gt;
what's git stashing and how it works?&lt;br&gt;
can we use multiple env files in a laravel project?&lt;br&gt;
how does queue works in laravel and how do we implement it on server&lt;/p&gt;

&lt;p&gt;To conclude, when you work full time on frameworks like Laravel. Your base skills kind of fades off like manually managing a session since laravel does a lot of scaffolding for you, so you almost forget about these things as they are not automatically being taken care of. However, we have to keep in mind about internal workings to such concepts.&lt;/p&gt;

&lt;p&gt;For the cure, I might create one project using vanilla PHP. As it will brush up those concepts.&lt;/p&gt;

&lt;p&gt;Hope, these short snippets would be helpful to you folks. Bye for now :)&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>git</category>
      <category>php</category>
      <category>oop</category>
    </item>
    <item>
      <title>Git: Fixing Common mistakes</title>
      <dc:creator>Ayush Likhar</dc:creator>
      <pubDate>Tue, 21 Jan 2020 09:40:55 +0000</pubDate>
      <link>https://dev.to/mechtech5/git-fixing-common-mistakes-48i9</link>
      <guid>https://dev.to/mechtech5/git-fixing-common-mistakes-48i9</guid>
      <description>&lt;p&gt;Today, I will share some common mistakes we face while using git and how to tackle them with ease. So let's get started.&lt;/p&gt;

&lt;p&gt;Q. Revert changes that are not staged yet.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;you can simply use &lt;code&gt;git checkout&lt;/code&gt; to revert these changes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Q. correct the commit message&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;use &lt;code&gt;git commit --amend -m "new commit message"&lt;/code&gt;
Note: this will change the commit hash, as commit message is the part of hash. So only use this if you're working alone or your commits are not pulled by other devs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Q. forgot to add a file in your commit&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;add the file to staging and run &lt;code&gt;git commit --amend&lt;/code&gt;, save and exit the commit message file that opens after this command.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now let's move to something more serious.&lt;/p&gt;

&lt;p&gt;Q. If you made commit to master branch by mistake which were meant to be committed on a feature branch.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To the rescue comes, "git cherry-pick"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;steps:&lt;br&gt;
1) Run &lt;code&gt;git log&lt;/code&gt; and copy the hash which you want to move in feature branch.&lt;br&gt;
2) &lt;code&gt;git checkout &amp;lt;branch-name&amp;gt;&lt;/code&gt;&lt;br&gt;
3) &lt;code&gt;git cherry-pick &amp;lt;hash&amp;gt;&lt;/code&gt;&lt;br&gt;
4) &lt;code&gt;git log&lt;/code&gt;, you will see the new commit&lt;/p&gt;

&lt;p&gt;Now to remove that commit from master, use &lt;code&gt;git reset&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Q. Now say you ran &lt;code&gt;git reset --hard&lt;/code&gt; and you realize... that code was precious to your heart. The life saver is &lt;code&gt;git reflog&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;steps:&lt;br&gt;
1) run &lt;code&gt;git reflog&lt;/code&gt;, it will show you the history of activities&lt;br&gt;
2) copy a hash before reset was done&lt;br&gt;
3) run &lt;code&gt;git checkout &amp;lt;hash&amp;gt;&lt;/code&gt;&lt;br&gt;
4) you will be in detached head state, now make a backup branch&lt;br&gt;
5) &lt;code&gt;git checkout master&lt;/code&gt;, your master branch is safe, precious code is safe in backup branch :D&lt;/p&gt;

&lt;p&gt;Final one,&lt;br&gt;
Let's say, you're in a situation where you want to revert the changes but other devs already pulled you work.&lt;/p&gt;

&lt;p&gt;For that you have, "git revert"&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git revert &amp;lt;hash&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It does not change the commit history, but makes new commits to reverse the changes. You can check using &lt;code&gt;git diff &amp;lt;previous commit hash&amp;gt; &amp;lt;new commit hash&amp;gt;&lt;/code&gt;, it does the exact opposite in those commits to bring back the code in it's previous state. Then you can push these changes to remote.&lt;/p&gt;

&lt;p&gt;I will be back with more. Till then adios!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;mechtech5&lt;/li&gt;
&lt;/ul&gt;

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