<?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: CarlosC</title>
    <description>The latest articles on DEV Community by CarlosC (@carlosch).</description>
    <link>https://dev.to/carlosch</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%2F418413%2F6b8910bc-18e0-4bde-ba7e-2b674ae605b2.jpg</url>
      <title>DEV Community: CarlosC</title>
      <link>https://dev.to/carlosch</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/carlosch"/>
    <language>en</language>
    <item>
      <title>New stuff on C# I learned today</title>
      <dc:creator>CarlosC</dc:creator>
      <pubDate>Tue, 30 Mar 2021 19:26:31 +0000</pubDate>
      <link>https://dev.to/carlosch/new-stuff-on-c-i-learned-today-3l7</link>
      <guid>https://dev.to/carlosch/new-stuff-on-c-i-learned-today-3l7</guid>
      <description>&lt;h4&gt;
  
  
  Data types
&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Presentation vs Calculation and Evaluation&lt;/em&gt;. I love that C# is a typed language. It's great to have to declare if our variable is a &lt;code&gt;string&lt;/code&gt; or an &lt;code&gt;int&lt;/code&gt; or even a &lt;code&gt;decimal&lt;/code&gt;. It's best to use the &lt;code&gt;string&lt;/code&gt; or &lt;code&gt;char&lt;/code&gt; data type when handling numbers that aren't used in mathematical calculations. Phone numbers, postal codes, etc. Same goes for &lt;code&gt;bool&lt;/code&gt;, which should be used only if working with evaluation of true or false.&lt;/p&gt;

&lt;h4&gt;
  
  
  Variable
&lt;/h4&gt;

&lt;p&gt;Variables are temporary storage containers for data.&lt;br&gt;
Assigning a variable is best at the moment of declaration.&lt;br&gt;
&lt;code&gt;string name = "value"&lt;/code&gt;.&lt;br&gt;
The &lt;code&gt;var&lt;/code&gt; keyword is used differently than in other languages. Using &lt;code&gt;var&lt;/code&gt; will implicitly give the variable a type at the moment of declaration, which has to be done simultaneously with initialization.&lt;/p&gt;
&lt;h4&gt;
  
  
  Verbatim string literals and string interpolation
&lt;/h4&gt;

&lt;p&gt;In the C# world by adding &lt;code&gt;@&lt;/code&gt; at the beginning of the string.&lt;br&gt;
&lt;code&gt;Console.WriteLine(@"Say "hello". Don't escape the /")&lt;/code&gt;&lt;br&gt;
&lt;em&gt;&lt;em&gt;String interpolation&lt;/em&gt;&lt;/em&gt;, similarly to JS, uses the &lt;code&gt;$&lt;/code&gt; symbol. HOWEVER, it's placed differently. It also uses double quotes instead of backticks.&lt;/p&gt;

&lt;p&gt;C#&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;Console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;WriteLine&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;$"&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;greeting&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s"&gt;!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;JavaScript&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;greeting&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;!`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Combining verbatim and string interpolation can be very useful if you need to escape some characters in your string. In this case, &lt;code&gt;$@&lt;/code&gt; should be pre-fixed to the string.&lt;/p&gt;

</description>
      <category>csharp</category>
    </item>
    <item>
      <title>My first basic API with ASP.NET</title>
      <dc:creator>CarlosC</dc:creator>
      <pubDate>Fri, 26 Mar 2021 20:21:38 +0000</pubDate>
      <link>https://dev.to/carlosch/my-first-basic-api-with-asp-net-49bi</link>
      <guid>https://dev.to/carlosch/my-first-basic-api-with-asp-net-49bi</guid>
      <description>&lt;p&gt;So yesterday was my first day building a web app with ASP.NET. I'm following the course for building an e-commerce app by &lt;a href="https://github.com/neilcummings"&gt;Neil Cummings&lt;/a&gt; and jumping straight into an intermediate level. I figured it wouldn't be so hard to follow along since I already have some programming experience. But then again, this is about coming from JavaScript to C#.&lt;/p&gt;

&lt;h3&gt;
  
  
  Basic API
&lt;/h3&gt;

&lt;p&gt;The day included only two factors:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; Make an endpoint that returns a list of products or a specific product by id.&lt;/li&gt;
&lt;li&gt;Setting up a database using SQLite.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Not much, right? However, I  encountered many new concepts and elements that I had to understand before going forward. Some of them were ultimately the same concepts I was familiar with already, just with a different name.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Kestrel web server&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.tutorialsteacher.com/linq/linq-lambda-expression"&gt;Lambda expressions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/questions/2785589/what-is-an-entity-why-is-it-called-entity"&gt;Entities&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en-us/aspnet/core/data/ef-mvc/migrations?view=aspnetcore-5.0"&gt;Migrations&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Objective
&lt;/h3&gt;

&lt;p&gt;The intention behind doing this web app is to get familiar with the  ASP.NET framework and learn all of these new concepts on a practical level. I plan to spend extra time in the first stages and make sure that I understand these basic concepts well enough to get the most out of the course. For that, I have to use documentation and google whenever possible (typical developer).&lt;/p&gt;

&lt;h4&gt;
  
  
  The tools
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://www.nuget.org/"&gt;NuGet package manager&lt;/a&gt; and the different libraries.&lt;br&gt;
&lt;a href="https://docs.microsoft.com/en-us/ef/"&gt;Entity Framework Core&lt;/a&gt;, which appears to be an important part of developing in ASP.NET.&lt;/p&gt;

&lt;h4&gt;
  
  
  Conclusion
&lt;/h4&gt;

&lt;p&gt;I got to do my first API endpoint. I started touching lightly on the database and migration, but I'm leaving that for tomorrow.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1g2jzpdb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://media3.giphy.com/media/THrVdFFbwhwxNPxfGi/giphy.gif%3Fcid%3Decf05e47zr5rfyj4kh4k79c2qi6h3kax4abx0f0esp32x9ro%26rid%3Dgiphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1g2jzpdb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://media3.giphy.com/media/THrVdFFbwhwxNPxfGi/giphy.gif%3Fcid%3Decf05e47zr5rfyj4kh4k79c2qi6h3kax4abx0f0esp32x9ro%26rid%3Dgiphy.gif" alt="too much"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's been overwhelming. It's a lot of new concepts for someone coming from a different language like JavaScript. Everything just feels so different. However, I'm very motivated to continue learning all these awesome tools. So, overwhelming but in a positive way.&lt;/p&gt;

</description>
      <category>csharp</category>
    </item>
    <item>
      <title>My journey with .NET starts today</title>
      <dc:creator>CarlosC</dc:creator>
      <pubDate>Thu, 25 Mar 2021 21:18:37 +0000</pubDate>
      <link>https://dev.to/carlosch/my-journey-with-net-starts-today-7oe</link>
      <guid>https://dev.to/carlosch/my-journey-with-net-starts-today-7oe</guid>
      <description>&lt;p&gt;Today starts a new chapter in my journey as a developer.&lt;br&gt;
I haven't been coding for that long, barely a year, and most of the coding I've done has been with Javascript and the Node environment.&lt;br&gt;
However, I've been feeling recently that I'm lacking this layer of knowledge about OOP and class languages, something that can be readily neglected when using only JS. That's why I had planned to learn Java after feeling some sort of fluency with JS - also to increase job opportunities.&lt;/p&gt;

&lt;h3&gt;
  
  
  Let's learn C sharp
&lt;/h3&gt;

&lt;p&gt;Then I discovered &lt;a href="https://www.pluralsight.com/blog/software-development/everything-you-need-to-know-about-c-"&gt;how cool C# and .NET are&lt;/a&gt;. I mean, being able to build whatever you want and being able to develop a program for the platform you want using the same ecosystem. It's just so cool! The .NET ecosystem is also becoming quite popular and there is a big community out there where I can find support.&lt;br&gt;
It's worth mentioning that I also had to change OS last month and go from iOS to Windows. So much frustration! I haven't really used Windows for almost 10 years and going back to it felt like having to learn to use a computer again: I missed so many functions from my old MacBook and it somehow felt like I had to do a lot of things myself.&lt;/p&gt;

&lt;p&gt;This made me feel really uncomfortable, the fact that I felt an important gap in knowledge and seeing how jumping into a new platform was not as smooth as I expected.&lt;/p&gt;

&lt;p&gt;As a developer, I believe it's necessary to feel comfortable with different platforms and be able to learn them quickly. This has motivated me to go Microsoft all the way and start developing with .NET on Windows. &lt;br&gt;
This is crazy.&lt;/p&gt;

&lt;h4&gt;
  
  
  The reason for this post
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TBzU3bGR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://media4.giphy.com/media/1YdkVtbE0izxU0s8GJ/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TBzU3bGR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://media4.giphy.com/media/1YdkVtbE0izxU0s8GJ/giphy.gif" alt="dear diary"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So I thought, why not start making notes about my progress? And why not make these notes public? After all, I'm about to start exploring a completely unknown world and bound to have many exciting days and just as many frustrating ones.&lt;/p&gt;

&lt;p&gt;The reasons why I want to track and share my progress with the .NET ecosystem:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Cringe intensely about my writing when I read this again in the future.&lt;/li&gt;
&lt;li&gt;Have a more structured way of learning.&lt;/li&gt;
&lt;li&gt;Help others in the same situation and motivate them.&lt;/li&gt;
&lt;li&gt;Make it easier to track progress and gain motivation from doing so.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  First day coding with C
&lt;/h4&gt;

&lt;p&gt;One word. &lt;em&gt;Chaos&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Coming from the world of JavaScript and VS Code, there were so many concepts that were new to me. The C# syntax is so different. And then Visual Studio, oh man! Where are all those files coming from? and why do I have to go through all these steps only to create a file (class file?). &lt;br&gt;
Yes, there are quite a lot of tools and concepts that are pretty much the same between programming languages and code editors, but it was still overwhelming. &lt;/p&gt;

&lt;p&gt;Fortunately, I'm one of those people who can find excitement in chaos. It was fun to learn the basics. Or half of the basics, to be more accurate.&lt;br&gt;
The best part is that I have already done all the necessary setup, I think. So from now on it'll be mostly code, only fun stuff.&lt;br&gt;
I'm looking forward to tomorrow's workload.&lt;/p&gt;

</description>
      <category>csharp</category>
    </item>
    <item>
      <title>Building a Gatsby-Strapi portfolio from scratch</title>
      <dc:creator>CarlosC</dc:creator>
      <pubDate>Wed, 10 Feb 2021 10:10:00 +0000</pubDate>
      <link>https://dev.to/carlosch/building-a-gatsby-strapi-portfolio-from-scratch-4d60</link>
      <guid>https://dev.to/carlosch/building-a-gatsby-strapi-portfolio-from-scratch-4d60</guid>
      <description>&lt;p&gt;Two weeks ago I decided the time building a portfolio was due. It has become more than a tradition, a must for developers to have their custom-built portfolio.&lt;/p&gt;

&lt;p&gt;Making a portfolio didn't feel like a big task, and I can imagine it goes quite fast when you have made a couple of them. But building one for the first time can be other than straightforward. First, there's the issue of which tools to choose. Here's where having a clear goal for your project helps immensely. It saves you time down the road by not having to waste time switching stack tools because they weren't fit for your type of project.&lt;/p&gt;

&lt;p&gt;I had very little idea about how I wanted the portfolio to look like. But here are some clear goals I had from the start:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I wanted a single-page application (SPA) to display all info about me, my projects, and contact details. So only one page (except for a blog page, which is on the way).&lt;/li&gt;
&lt;li&gt;Building it in a way I can manage content easily in the future. &lt;/li&gt;
&lt;li&gt;Keep it simple. With only the necessary features in the beginning, and rather build it in a way I can easily add/edit new features later.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Why Gatsby?
&lt;/h3&gt;

&lt;p&gt;When choosing between Next.js or Gatsby &lt;a href="https://dev.to/jameesy/gatsby-vs-next-js-what-why-and-when-4al5#:~:text=The%20fundamental%20difference%20is%20Next,HTML%20page%20from%20the%20server."&gt;this post by Jamees&lt;/a&gt; gave me an insight into the right direction.&lt;br&gt;
For a page as light as mine, it's not necessary all the customizability Next.js provides. Gatsby, on the other hand, offers many plugins so you don't have to reinvent the wheel. I have to say, I was rather modest in this respect so to avoid a bloated app.&lt;br&gt;
Gatsby is quite comprehensible and it's not hard getting familiar with it.&lt;/p&gt;

&lt;p&gt;Ok, so with Gatsby we keep it simple. How do we make it easy to manage? That's where Strapi comes in.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Strapi?
&lt;/h3&gt;

&lt;p&gt;Strapi is an open-source CMS and a framework that helps us build our API. Strapi is going to be taking care of handling requests for the data we're feeding into our project. Strapi offers a friendly-looking admin page where you can do admin tasks like create content types or update new entries or even extend these permissions.&lt;/p&gt;

&lt;p&gt;The best thing with Strapi is all the good documentation they have on their website. They also have helpful videos on their youtube channel. There's nothing worse than struggling to find good documentation about something.&lt;/p&gt;

&lt;h3&gt;
  
  
  Deployment
&lt;/h3&gt;

&lt;p&gt;I decided to build a workflow with continuous integration (CI) together with GitHub. This comes back to making it easier for me to manage later changes. This would make it so that every time I push my code to GitHub, it would go on to build and deploy automatically on my hosting platform.&lt;/p&gt;

&lt;p&gt;Deployment was done on two different platforms. For the gatsby project, I went for Netlify. The reason I chose it is because there's plentiful of documentation on pairing the two. Gatsby and Netlify work remarkably well together, making the development of a static site, as mine, feel like a breeze. Besides, on Netlify it's possible to buy your domain, which was nice.&lt;/p&gt;

&lt;p&gt;Deploying my Strapi API had to be done with Heroku. Heroku is a great hosting service for backend applications. It offers add-ons to work together with your app, something that came in handy when trying to choose a database for my API. &lt;/p&gt;

&lt;h2&gt;
  
  
  In retrospective
&lt;/h2&gt;

&lt;p&gt;Thinking back to when I wrote the first line of code for this project, I feel like the only thing I was focusing on was that I wanted a REALLY COOL portfolio. But I was also aware of my weakness for going into rabbit holes. I had to remind myself quite often: keep it simple (stupid). I followed a Trello board where I could keep track of the big tasks and then smaller tasks. This is a step that's so useful and yet easy to skip. I recommend it to everyone working on their projects, whatever it is.&lt;/p&gt;

&lt;p&gt;At the moment of deploying and finishing the last parts of the portfolio, I started to document and started writing the README. That's when I learned that READMEs are the first thing to be done in a project:P. There's some good &lt;a href="https://github.com/matiassingers/awesome-readme"&gt;resources on readmes&lt;/a&gt;, the importance, and ways of writing one.&lt;/p&gt;

&lt;p&gt;I guess one of the things I should improve for my coming projects is more planning. Even though for the most part I had a clear idea of what I wanted, some days I felt like I jumped into the code only out of habit, without a plan of attack for the task. But, to be fair, I was also very excited to get to work:P.&lt;/p&gt;

&lt;p&gt;Something new that I implemented in my routine was the &lt;a href="https://en.wikipedia.org/wiki/Pomodoro_Technique#:~:text=The%20Pomodoro%20Technique%20is%20a,length%2C%20separated%20by%20short%20breaks."&gt;Pomodoro technique&lt;/a&gt;. I used a timer to work 25min on / 5min off, that way I didn't have to actively remember to take breaks. Turns out it increased productivity and my back is eternally thankful.&lt;/p&gt;

&lt;h3&gt;
  
  
  Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Quick start Strapi (&lt;a href="https://strapi.io/documentation/developer-docs/latest/getting-started/quick-start.html#_1-install-strapi-and-create-a-new-project"&gt;https://strapi.io/documentation/developer-docs/latest/getting-started/quick-start.html#_1-install-strapi-and-create-a-new-project&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Integrate Strapi and Gatsby (&lt;a href="https://strapi.io/blog/building-a-static-website-using-gatsby-and-strapi"&gt;https://strapi.io/blog/building-a-static-website-using-gatsby-and-strapi&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Deploy Strapi to Heroku (&lt;a href="https://strapi.io/blog/deploying-a-strapi-api-on-heroku"&gt;https://strapi.io/blog/deploying-a-strapi-api-on-heroku&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Photo by Format from Pexels&lt;/em&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>gatsby</category>
      <category>strapi</category>
    </item>
    <item>
      <title>Longest day coding</title>
      <dc:creator>CarlosC</dc:creator>
      <pubDate>Sat, 27 Jun 2020 22:00:07 +0000</pubDate>
      <link>https://dev.to/carlosch/longest-day-coding-4lf2</link>
      <guid>https://dev.to/carlosch/longest-day-coding-4lf2</guid>
      <description>&lt;p&gt;For quite a while I have thought about starting a blog. The idea was fascinating but, at the same time, thinking about it for too long got me discouraged; just thinking of all the work, and my limited knowledge, and the fear of being judged, trolled, etc...&lt;br&gt;
Before getting into code I could imagine myself writing about all sorts of things that interest me, often being afraid of getting too personal with my posts.&lt;br&gt;
It's much more comfortable to not do it. So I never did it.&lt;br&gt;
Until today.&lt;/p&gt;

&lt;p&gt;I'm currently studying Full stack JavaScript with the Treehouse platform and, while I feel I've got the hang of the JS course till now, and I'm able to go through the lessons rather quickly and understand it all, I got stuck today with one of the challenges. I don't think I have ever used the whole day coding as I did today. But I was stuck, so I basically didn't write much code. I was just trying to solve the challenge, stressing about it. It was about traversing and manipulating the DOM using the Node properties.&lt;/p&gt;

&lt;p&gt;In the end I manage only with the help of comments. So it's kind of annoying. The solution I resolved to use was actually quite simple, as opposed to the complicated function I was trying to pull off.&lt;/p&gt;

&lt;p&gt;It's hard to say how often I'm going to be posting here, or what I'll be writing. But it feels as if I had discovered that doing something doesn't need to take all our efforts and it doesn't need to be complex for it to be worthy. I had imagined that writing a first-time-ever post was going to be magical and surrounded by wonderful, inspirational circumstances. Actually, all it took was a the slightest of action.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>dom</category>
      <category>100daysofcode</category>
    </item>
  </channel>
</rss>
