<?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: shreegowtham27</title>
    <description>The latest articles on DEV Community by shreegowtham27 (@shreegowtham27).</description>
    <link>https://dev.to/shreegowtham27</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%2F335559%2Ff6c056a6-6552-49c2-a404-615352e75bbc.png</url>
      <title>DEV Community: shreegowtham27</title>
      <link>https://dev.to/shreegowtham27</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shreegowtham27"/>
    <language>en</language>
    <item>
      <title>What is a VPN? How does a VPN work? Is it safe to use a VPN?</title>
      <dc:creator>shreegowtham27</dc:creator>
      <pubDate>Wed, 10 Aug 2022 12:28:55 +0000</pubDate>
      <link>https://dev.to/shreegowtham27/what-is-a-vpn-how-does-a-vpn-work-is-it-safe-to-use-a-vpn-49pp</link>
      <guid>https://dev.to/shreegowtham27/what-is-a-vpn-how-does-a-vpn-work-is-it-safe-to-use-a-vpn-49pp</guid>
      <description>&lt;h2&gt;
  
  
  What is a VPN?
&lt;/h2&gt;

&lt;p&gt;A VPN is software, which is basically used to bypass your Internet Service Provider by using some other server from a different country or state. Meaning, from a different region.&lt;br&gt;
How does VPN work?&lt;/p&gt;

&lt;p&gt;Before that, You need to know how actually your connection works.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;You request a Website, let's say example.com,&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Your request will be sent to the ISP or Network Provider.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Then DNS lookup will happen.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You get the response from the example.com server.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;DNS lookup is nothing, just checking if the given domain is a Valid domain you're requesting and if it is valid, what is the IP Address of that server.&lt;/p&gt;

&lt;p&gt;So now you know, how this basic stuff works. Now let's see how VPN works.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Whenever you start a VPN application, it creates a port in your device, Let's say, port Number 45450.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;All the Web Traffic which are happening at port 80 (HTTP) and 443 (HTTPS) will be routed from their respective port to the 45450 port, where the VPN client is listening.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now, the VPN client will send those traffics to the VPN server.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;VPN server will make a DNS Lookup.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once the VPN server receives the data from example.com, The VPN server sends the response to the VPN client, and then we can get the data.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Simple As That, Cool.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why does it take a lot of time to receive data from VPN?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;If you use free services, your VPN provider will use them on budget servers only. So when the bandwidth of the VPN server is low, obviously your surfing speed will be poor.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When the server is on heavy load, you will be ending up with a poor surfing speed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Latency - This also plays a major role. However, if you're in India, you will be using a VPN from Europe, the US, or Singapore. We also do have something called a CDN - Content Delivery Network. The only work of CDN is to send data to the client from the nearest region. Let's say, you're from Gujarat and looking for a site hosted in AWS, obviously, they should be served from Mumbai region, so that the content will load faster reducing your latency. But in this case, even though you're in Mumbai, you're asking for content from a VPN server, which is located in Singapore.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So, the request will be something like this.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Your request from the browser.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Routed to VPN Client port.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Your request reaching the VPN server&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;VPN Server does the DNS lookup things.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;VPN server gets the website IP address.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;VPN server sends requests to the website IP address.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Nearest CDN sends the response to the VPN server (Singapore CDN).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;VPN server provides the response to the VPN client.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;VPN client, shows the Data to us.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;PS: Since you're requesting the website from a Singapore IP Address, The website will think that you're really from Singapore and serve you from Singapore CDN.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the purpose of a VPN?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Censorship.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Some countries ban some websites, for various reasons. To access those banned resources, VPN is used widely.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Anonymity.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Anonymity is just to hide who you really are and where you're from. To have your privacy with yourself and not leave any digital footprints, VPN is used.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Is it safe to use a VPN?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We can't actually say that the data are not logged in to the VPN server. If the VPN company sells out our data, IP Address, and search history, it is more than enough. this is one of the major reasons to use a VPN. We can't actually say that we are safe when we use a VPN. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So the next time, when you turn ON your VPN, know how VPN is able to open this example.com and without a VPN, the same example.com is not accessible.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Best Practices in Coding for Beginners</title>
      <dc:creator>shreegowtham27</dc:creator>
      <pubDate>Fri, 07 Jan 2022 19:03:30 +0000</pubDate>
      <link>https://dev.to/shreegowtham27/best-practices-in-coding-for-beginners-19f</link>
      <guid>https://dev.to/shreegowtham27/best-practices-in-coding-for-beginners-19f</guid>
      <description>&lt;p&gt;There are a few things that you need to take care of while you're coding.&lt;/p&gt;

&lt;p&gt;These things will improve the readability of your code and also increase your confidence level of you in coding.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Indentation.&lt;/li&gt;
&lt;li&gt;Case Convention.&lt;/li&gt;
&lt;li&gt;Commenting on the code.&lt;/li&gt;
&lt;li&gt;Using Reusable Code.&lt;/li&gt;
&lt;li&gt;Using env Variables instead of Hardcoding secret Keys.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  1. Indentation
&lt;/h2&gt;

&lt;p&gt;A proper Indentation will make your code look more beautiful.&lt;/p&gt;

&lt;p&gt;Not only that, more of readability. when you can read your code easily, you can debug more faster.&lt;/p&gt;

&lt;p&gt;Have a Tab Indentation, instead of space indentation. (4 space indentation is Tab indentation).&lt;/p&gt;

&lt;p&gt;You can use the Rainbow Indent extension so that the code will be more pleasing for you in your code editor.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Case Convention
&lt;/h2&gt;

&lt;p&gt;Typing a variable is also a major factor when it comes to programming.&lt;/p&gt;

&lt;p&gt;using random variables like var d = dog; is completely ugly when comes to the professional level.&lt;/p&gt;

&lt;p&gt;Use a Variable name based on what it is giving you or what is going to be stored in the variable name.&lt;/p&gt;

&lt;p&gt;If you want to store a pet name, use a variable, var PetName and not as random as var d, var k. Stop those things. But using i,j,K is the most common starting from the very first code till the end in loops, especially for loops.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Case Types.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;camelCase&lt;/li&gt;
&lt;li&gt;PascalCase&lt;/li&gt;
&lt;li&gt;kebab-case&lt;/li&gt;
&lt;li&gt;snake_case&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are some more cases as well. But try to be fixed in these cases.&lt;/p&gt;

&lt;p&gt;Based on the language that you use also plays a major role in choosing your typing case convention.&lt;/p&gt;

&lt;p&gt;Eg: &lt;strong&gt;camelCase and PascalCase&lt;/strong&gt; are the most commonly used patterns in &lt;strong&gt;JavaScript&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;snake_case&lt;/strong&gt; is most preferred in languages like &lt;strong&gt;Python and PHP&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;GoLang again goes with Camel and PascalCase.&lt;/p&gt;

&lt;p&gt;Even the Database you use, haves some conventions like this.&lt;/p&gt;

&lt;p&gt;When you're in MongoDB, you can see camelCase and PascalCase mostly. similarly, when you're in MySQL, it is more common to see snake_case.&lt;/p&gt;

&lt;p&gt;kebab case is something getting a high level in using URL path.&lt;/p&gt;

&lt;p&gt;eg: website,com/this-is-a-path.&lt;/p&gt;

&lt;p&gt;you can also see the website path with snake_case as well. like, website,com/this_is_a_path.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Commenting the code
&lt;/h2&gt;

&lt;p&gt;You write a certain block of code, later on, you go to build another set of code, when you come back to the first set of code you have written, you don't even know whether you have written the code or someone else.&lt;/p&gt;

&lt;p&gt;It is always a best practice to comment on your code / What is your code trying to do there. so that you will understand in a better way.&lt;/p&gt;

&lt;p&gt;It is better to comment/ take notes while coding, then convert those notes to comments,&lt;/p&gt;

&lt;p&gt;Eg: You need to get a user name from the user, but you should allow it only if it is more than 5 characters long.&lt;/p&gt;

&lt;p&gt;// Name is empty&lt;/p&gt;

&lt;p&gt;if(!Name)&lt;/p&gt;

&lt;p&gt;// Name is less than 4 chars.&lt;/p&gt;

&lt;p&gt;if(Name.length&amp;lt;4)&lt;/p&gt;

&lt;p&gt;// if Name is present and more than 4 chars.&lt;/p&gt;

&lt;p&gt;if(Name &amp;amp;&amp;amp; Name.length&amp;gt;4)&lt;/p&gt;

&lt;p&gt;In this way, you don't have to worry about commenting on your code.&lt;/p&gt;

&lt;p&gt;This also helps to focus more on coding, since you have already written what to do next.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Using Reusable Code
&lt;/h2&gt;

&lt;p&gt;There is something called a "&lt;strong&gt;DRY principle&lt;/strong&gt;", Which is an acronym for - Do not Repeat Yourself. You will have to write a code once and have to use those classes/methods/functions wherever it is necessary.&lt;/p&gt;

&lt;p&gt;There should not be the same block of code that is repeating over not only in the folder but also in the whole application.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Using env Variables instead of Hardcoding secret Keys
&lt;/h2&gt;

&lt;p&gt;There is something called environment variables, this has become a kind of compulsion for every programmer to be known.&lt;/p&gt;

&lt;p&gt;An env variable or environment variable is simply another variable, which will be set outside the program or functionality, still, it runs on the process of the program or functionality. (Tried my level best in simplifying)&lt;/p&gt;

&lt;p&gt;These are also key-value pairs, just like the usual variables.&lt;/p&gt;

&lt;p&gt;Eg :&lt;/p&gt;

&lt;p&gt;DATABASE_NAME = "name"&lt;/p&gt;

&lt;p&gt;DATABASE_PASSWORD = "password"&lt;/p&gt;

&lt;p&gt;(Here again, you can see I have used a different case, this is the most common case in the env variable and is called MACRO_CASE or UPPER_CASE_SNAKE_CASE)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Most of the constants in any language can be seen using UPPER_CASE_SNAKE_CASE.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;with this env variable, there won't be any need to hardcode secrets like your passwords, Just use these variables to make your code to the next level secure. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;unless you add the .env file in your .gitignore file, it won't be a secret anyway &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Happy Coding!&lt;/p&gt;

&lt;p&gt;Happy Weekend&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
