Day 2 - 100daysofcode Webserver basics
Tags: 100daysofcode, javascript, beginners, webdev
Published: 2021-04-17 09:49:28

I have covid and Day 2 was the day when my body begged me to get some rest and I had to give into it. Reminded me of a quote.

![A healthy man wants a thousand things, a sick man only wants one.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c1yqdjp4k629xnxwwhzs.jpg)

Since it's been ~12 days since my first symptom and I am on a road to recovery, I think besides the coronavirus it might have to do something with the new syrup I had yesterday :sweat_smile:

But, any way I am glad that I did at least a part of what I promised, I read a few articles from [MDN frontend guide](https://developer.mozilla.org/en-US/docs/Learn/Front-end_web_developer) and did 4-5 questions from [FCC JS DS Algo course](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures)
I couldn't however post an article, unlike reading tech and coding for years now, writing is something that I am relatively new with. I still occasionally have to run a compiler inside my brain converting Hindi (my first language) to English. :smile: And who knows what all I'd have ended up publishing in my sleepy state.
I'd say it was a good decision because now as I am writing this article I have the opportunity to recall all that I had read in my sleepy state plus some extra time to reflect on what happened and how it could be avoided in future.

Also, I thought maybe I could start my articles in a 3-2-1 format that James Clear's newsletters come in. His are 3 ideas, 2 quotes, and 1 question. I was thinking of 3 discoveries that day, 2 realizations/quotes, and 1 question. 

## Articles Covered
- [What is a web server?](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_is_a_web_server)
- [What is the difference between webpage, website, web server, and search engine?](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Pages_sites_servers_and_search_engines)
- [CSS Basics](https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/CSS_basics)

### [What is a web server?](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_is_a_web_server)
I really like how they explicitly mentioned and differentiated between the *hardware web server* and the *software web server*. And the roles each play while serving a request.
*A good point* - The web server must answer every HTTP request, at least with an error message. (This very line sets up the foundation for HTTP response codes and why)
![Web Server](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ihol5eh3isi8wd5jo2lq.PNG)

### [What is the difference between webpage, website, web server, and search engine?](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Pages_sites_servers_and_search_engines)
This article certainly clears out the confusion I once had in my early days of the internet, I thought the browser and search engines were one and the same, and that when we type something into the browser it would be the browser that would scout the net and provide me with the results, I was so wrong :sweat_smile: With these articles, I certainly am getting nostalgic. :smile:
This also addresses some of the terminologies that is often use by clients or non-technical people. e.g. I have often heard some of my clients addressing the pdf they received via mail as web docs, Web Documents or Web pages. But the above article clarifies it well. 

> Browsers can also display other documents such as PDF files or images, but the term web page specifically refers to HTML documents. Otherwise, we only use the term document.

Another such confusion that's addressed is between a website and web server.

> Don't confuse websites and web servers. For example, if you hear someone say, "My website is not responding", it actually means that the web server is not responding and therefore the website is not available. More importantly, since a web server can host multiple websites, the term web server is never used to designate a website, as it could cause great confusion. In our previous example, if we said, "My web server is not responding", it means that multiple websites on that web server are not available.

Stumbled upon a gold mine of internet terms. See them here 
[MDN Web Docs Glossary: Definitions of Web-related terms](https://developer.mozilla.org/en-US/docs/Glossary)

### [CSS Basics](https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/CSS_basics)

This article covered the very basics of CSS and I was glad they were able to showcase CSS with such simplicity.
- CSS is a stylesheet language
- Anatomy of CSS Ruleset
![Anatomy of CSS Ruleset](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o0bdgozx0d9b84ieifad.png)
- Box model
![Box model](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u03wa8boql2g8we2g1t9.png)

All in all, it was not much but fits very well in the Two-Minute Rule which states 
> *“When you start a new habit, it should take less than two minutes to do.”*

From the [FCC JS DS Algo course](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures) I attempted just 5 questions there wasn't much new to learn except one.
- Most modern programming languages, like JavaScript, don't start counting at 1 like humans do. They start at 0. This is referred to as *Zero-based indexing*.
![Day-2 FCC progress 32%](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lgf95z72hvzxl64ivo0r.PNG)

## Comments and Conclusion
Well, day-2 was pretty close to being a failure, but the least we can do right now is to make sure it is not repeated again. And that the 2-minute rule is just a worst case scenario and should not become an everyday reality.

On [Day-1](https://dev.to/pracoon/day-1-100daysofcode-32hn) I wrote "I will continue with the 100daysofcode challenge, at 2:00pm in the morning right after my lunch every day without fail"
I think I didn't give enough thought to the 2pm I thought I'd be simply able to stack it to after my lunch, while totally forgetting about the [After Lunch Fatigue](https://www.huffingtonpost.com.au/2016/08/31/sleepy-after-lunch-we-found-out-exactly-why-it-happens_a_21463330/) which was only enhanced by my medicines.

Hence I think a better time would be 7pm, I am done with all my fatigues and would be able to close the deal before dinner.

Hence the new statement is 
"I will continue ith the 100daysofcode challenge, at 7 pm every day in the evening after gym, every day"

I'll leave you with a song I find motivational and energizing at times, and pretty sure would be an all-time favourite for many [Imagine Dragons - Radioactive](https://www.youtube.com/watch?v=ktvTqknDobU) 🥂:smile:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y9x056sk7koxgqtfv92v.jpg)