{"id":217,"date":"2020-01-30T00:38:46","date_gmt":"2020-01-30T00:38:46","guid":{"rendered":"https:\/\/light-and-code.com\/?p=217"},"modified":"2020-01-30T00:38:47","modified_gmt":"2020-01-30T00:38:47","slug":"a-structured-introduction-to-modern-webdesign","status":"publish","type":"post","link":"https:\/\/light-and-code.com\/?p=217","title":{"rendered":"A structured introduction to modern Webdesign"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Scope<\/h2>\n\n\n\n<p>What I want to talk about today covers\nshort glimpses into many fields. There are many questions I had myself when I\nstarted working and exploring in this field. You find yourself confronted with\nso many decisions at the get-go that it can seem impossible even to start.<\/p>\n\n\n\n<p>I want to take you by the hand as a complete beginner, someone who only knows the term Webdesign, and guide you to those first lessons to learn, videos to watch, documentation pages to read and give you an overview of what you are dealing with.<\/p>\n\n\n\n<p>In the following paragraphs, I want to\ncover the following areas:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Basic technology<\/strong>: How does it all work? What is a website, and how does it work? What are the technological building blocks that go into it?<\/li><li><strong>Software<\/strong>: What kind of software is out there to help me? What is a &#8220;framework&#8221;? What is the difference between a tool and a framework?<\/li><li><strong>Starting point<\/strong>: What is a &#8220;good&#8221; first project? Where do I begin?<\/li><li><strong>Help<\/strong>: Where do I get it? When do I need it?<\/li><\/ul>\n\n\n\n<p>Surely you feel overwhelmed right now by\nwhat you are about to undertake, but rest assured: Even if there is sometimes\nsome difficulty and if there are setbacks, the effort you put in will be worth\nit. It&#8217;s an amazing feeling to see a finished project, to see a tool you came\nup with in use, to profit from automation of a process you used to do manually.<\/p>\n\n\n\n<p>Let&#8217;s dive right in!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Basic technology<\/h2>\n\n\n\n<p>For the sake of readability, I will spare you the same story over again how some smart people in the military invented the Internet formerly named the <a href=\"https:\/\/en.wikipedia.org\/wiki\/ARPANET\">ARPANET<\/a>. You can find that in a history book \u2013 or on the Internet. All you need to know is the fact that the Internet enables computers to send text back and forth. Now you might think that you can also send images but that&#8217;s not exactly right. The images you send via the Internet get translated into a machine language that explains how they look. There are many such languages. JPEG, PNG, and SVG might be some you have seen before. <\/p>\n\n\n\n<p>Why do I tell you this? Because it is also\na good introduction to Webdesign and why it strikes people as difficult: Let&#8217;s\nsay you have a computer and want it to show everyone on the Internet a nice\nrepresentation of your local business. If you are only able to send them pure\ntext files, that&#8217;s going to be a pretty boring introduction. With pictures,\nyou&#8217;re already one step further, but now you&#8217;re still stuck with a long text\nand some pictures. What about the positioning of text, interactivity, colors,\nlayout, all that stuff?<\/p>\n\n\n\n<p>HTML exists to solve this problem. It is a\nlanguage to give the text meaning. We call programs that understand this\nlanguage browsers. They receive a document written in HTML and show you a nice\ngraphical representation of what that HTML contains. HTML has commands to turn\ntext into a link or a heading, and just like that, we can create basic\nwebsites.<\/p>\n\n\n\n<p>To extend the functionality of pure\nfunctionality, people introduced further languages to cover additional ground:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>CSS gives you the ability to\ndefine how text and other objects should look, and in modern versions, it can\nalso define animations.<\/li><li>JavaScript is an actual\nprogramming language that enables you to change the content of a website\ndynamically or to do work in the background (Is the value in that input field\nan email address? If the user clicks there I want to show them a picture of a\ncat etc.)<\/li><li>SVG makes it possible to draw\nbasic graphics in the browser.<\/li><li>PHP enables you to generate an\nHTML document dynamically the moment someone asks for it.<\/li><\/ul>\n\n\n\n<p>These technologies introduce multiple ways of how to do Webdesign. Let&#8217;s assume you insert a URL into your browser&#8217;s address bar. What happens? What are the possible ways? Your browser will send a request to the address you gave it. If the destination is a computer awaiting your request, we expect it to send us a valid HTML document. It could either<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>already have that document\nready for us. In this case, we speak of a static website or<\/li><li>have to do some work to figure\nout what to send back. The website might, for example, contain a spot where the\ndate should be displayed. The server would then have to look up the date and\ninsert that value before sending us the HTML document we expect. In this case,\nwe speak of dynamic websites.<\/li><\/ul>\n\n\n\n<p>In the first case, we will always receive\nthe same website no matter how many times we call it and at which time. The\nspace for the date will always contain the same value. The second time, we will\nreceive an individual return value every time because the server has to look up\nthe date every time.<\/p>\n\n\n\n<p>In the second case above, the server has to\ndo all the heavy lifting, while your browser, the client, only displays\nwhatever the server sends it. Imagine, however, that you want to write an\nonline game, say, Sudoku. If it goes well, you might have millions of people playing\nyour game. Do you want all those people using your computer for their games?\nThat would be a lot of work. <\/p>\n\n\n\n<p>It would be best if you could send them the\nrules of Sudoku and what the board is supposed to look like and let the browser\ndo the rest. Your computer should be smart enough to do the rest. That&#8217;s where\nJavaScript comes in. It is a programming language your browser understands and\nwhich can access the website the browser displays. So the server sends you some\nJavaScript code that describes how the game works, your browser executes that\ncode, and you have a game. Now the server doesn&#8217;t care anymore if you play one\nor ten games, and if you win or lose, it sends the rules and layout once. Cool,\nright?<\/p>\n\n\n\n<p>We call code that running on the server &#8220;<em>server-side<\/em>.&#8221; The most widely used language here is PHP. This way, you can access data from a database without opening the database up to browsers. If, for example, a username shows on a website, PHP gets that name from the database, inserts it into the HTML as pure text, and sends it to the browser. That way, only the server needs to access the database &#8211; not the browser.<\/p>\n\n\n\n<p>The code that runs in the browser is called &#8220;<em>client-side<\/em>,&#8221; and we write it in JavaScript.<\/p>\n\n\n\n<p>Most websites today feature some\ninteraction. That could be a login to access some personal dashboard,\nmessaging, leaving comments, or shopping. That functionality requires code to\nrun that reacts to your requests either on the server or in the browser.\nTypically you will use a combination of both. The modern trend, however, is to\nput more and more functionality into the browser, which means to write more\ncode in JavaScript. There is also a system to write server-side code in\nJavaScript, so JavaScript that gets executed on the server, called NodeJs. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Software<\/h2>\n\n\n\n<p>One of the core lessons in programming is that someone already did what you want to do, and you don&#8217;t need to re-invent the wheel. There are already websites out there that have a login-functionality that is secure and makes sense \u2013 why would you do it differently? The core differentiation you can make here is the one between a <em>tool <\/em>and a <em>framework<\/em>. Both help you find a solution to your problem. However, the framework will be part of that solution \u2013 the tool will not. Angular, for example, is a web framework to build modern websites. Every website you build with angular contains the angular code + your code, so you use the framework and add your details to it. Dreamweaver, on the other hand, used to be a tool to design websites, but it generates a website for you, that doesn&#8217;t require Dreamweaver to run. Once you hit export, Dreamweaver&#8217;s work is done.<\/p>\n\n\n\n<p>To keep everything nice and compact, people\nmodularize frameworks so people can use only the building blocks they need\nrather than bringing a lot of code they don&#8217;t require. Sometimes there are also\nmultiple ways to solve a problem. These two facts have introduced the\nterminology of a software stack. That term describes the list of tools and\nframeworks you use for your project. Some work well together; some are written\nby the same people and make sense together. There are, therefore, some famous\nsoftware stacks out there which we will talk about later. <\/p>\n\n\n\n<p>You will also read the term library. Function-wise it is interchangeable with a framework. It is code you bundle with yours to build a website. However, the<a href=\"https:\/\/en.wikipedia.org\/wiki\/Inversion_of_control\"> &#8220;Inversion of Control&#8221;-principle<\/a> states that a library is a piece of code you call to do a task while a framework is code that calls you to do something where it needs you. You could use a math-library to compute the square root of a number when you need it. WordPress is a framework, and it will ask you for the name of your website and what you want it to look like. <\/p>\n\n\n\n<p>In the last paragraph, I mentioned WordPress and called it a framework. That is not the whole truth. <a href=\"https:\/\/wordpress.com\/\">WordPress <\/a>doesn&#8217;t require you to do any more programming. All you do is manage your content. That includes actions like creating pages, uploading images, writing text in an online editor to be displayed on the website. This nature of the system is why we call this sort of framework a Content-Management-System or CMS. <a href=\"https:\/\/joomla.com\">Joomla <\/a>and Wikipedia are further examples.<\/p>\n\n\n\n<p>While WordPress uses PHP (and is, therefore, a server-side technology), Angular, for example, is a framework written in JavaScript and is therefore client-sided. The only real restriction here is that user data and other confidential data will always be stored on your server and not entirely in the client. It will, therefore, make some functionality on the server necessary for the client to retrieve the data it needs. So if you have a website with user data, you will need some code on the server-side.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Starting Point<\/h2>\n\n\n\n<p>At this point, you are aware of most of the\nimportant lingo that you need. This should help you decide what you want to do\nand how. For example: If you are more interested in the design aspects,\nstructure, color, fonts, etc. CSS would be a good starting point for you. If\nyou don&#8217;t want to do any coding but need a website, a CMS like WordPress is\nyour goto solution, and if coding aka the art of building functionality is what\nyou are after, you only have to choose server or client-side, and you&#8217;re off to\na good start. I now want to teach you a little bit about how to get going.<\/p>\n\n\n\n<p>First off, I want to list some good sources\nof information:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Documentation<\/strong>: For most modern projects, you will find great online tutorials and &#8220;Getting Started&#8221; guides. I cannot emphasize enough how valuable these are. They are usually free and provided by the people who built the system you will be working with, so they know what they are talking about and have heard the questions you have a hundred times.<\/li><li><strong><a href=\"https:\/\/stackoverflow.com\/\">StackOverflow<\/a><\/strong>: If there are any questions, and you google for an answer, you will find responses on many websites. Don&#8217;t use any of them except StackOverflow (and maybe Git-type products like Jira, Github, Gitlab etc.). SO is where you find good people giving good answers. Forget about Quora, random internet forums, and blogs.<\/li><li>Online Courses: You will find many of these on youtube and educational platforms like <a href=\"https:\/\/www.udacity.com\/\">Udacity <\/a>or <a href=\"https:\/\/www.udemy.com\/\">Udemy<\/a>. Many of the latter educational platforms offer free courses. These are worth checking out.<\/li><li><strong>Pinpoint examples<\/strong>: Once you have evolved a bit and know what you are doing, you will start working on more specialized projects. At this point, the requirements of your project will pose restrictions on what software you use and which languages you code in. That can cause compatibility issues and you might face difficulties getting tools and frameworks to work together (like connecting a database to a node.js server or parsing the return values from an API you built in the client-side code). I have made the experience over the last decade or so that you will quite frequently find a guide on exactly the stack you use on websites like medium.com, where someone will be doing exactly the stuff you do even though it&#8217;s highly specific, and explain the step with which you were having issues. You should, however, not start with these. Figure out your software stack based on the project and the properties of the building blocks of your system and then go searching for help rather than first looking for some random guides and then copying their work. It would greatly impede your understanding and progress.<\/li><\/ul>\n\n\n\n<p>I want to end\nthis article with some important remarks I want you to keep with you and to\nremember whenever you do any programming:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><em>Programming is no science<\/em>. Every library and framework has flaws and clear indications of personal preference by the people who built it. Don&#8217;t expect yourself to understand it all in one sitting. Look for help if you need it and accept your mistakes as possibilities to learn.<\/li><li><em>Motivation is key<\/em>. If you are working on spare-time projects, don&#8217;t bum yourself out by focusing on details and small, possibly irrelevant bugs. If you feel frustrated or stuck, do something else. That could be sports or another hobby or just work on another part of the project that offers more satisfaction. If you force yourself too much to work on one part that doesn&#8217;t make progress, you will lose interest.<\/li><li><em>Search for explanations and help, not copy-paste solutions<\/em>. Try to learn every time you put something in a search engine, so you never have to google it again. Otherwise, you run the risk of becoming a script kiddie, which you will only notice months and years in when you realize that you haven&#8217;t understood anything. A deep understanding of this kind of topic comes from exposure and concentration.<\/li><li><em>Share your progress, talk about your projects<\/em>. Join groups and talk to others about what you do and let them be a part of it \u2013 either as a programmer or user. It will give you a lot of joy to see others use what you built. <\/li><li><em>Follow the big guys<\/em>. Support matters, and no matter how good the marketing pitch for some framework sounds, if it has only three developers and they haven&#8217;t been active in the last three months, your most likely better off using the framework facebook develops and maintains with 100 commits every day.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">My personal favorites<\/h2>\n\n\n\n<p>I don&#8217;t want you to go off and do what I\ndo. I do those things because I like them \u2013 you might not. None the less I want\nto introduce you to some of the technologies I find interesting:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/nodejs.org\/en\/\">Node.js<\/a> is a dialect of JavaScript for server-side programming. The amazing thing is, that you can now write both server- and client-side code in JavaScript.<\/li><li><a href=\"https:\/\/angular.io\/\">Angular <\/a>is developed by Google and offers a compelling way of structuring client-side code for modern progressive web apps.<\/li><li>The MEAN stack is named after the initials of four projects that work well together. Angular is the A, N for Node.js. I like those two so much that I mentioned them separately. The other two are M for <a href=\"https:\/\/www.mongodb.com\/\">MongoDB <\/a>which is a database that works well with node.js, and that can store JSON objects, saving you the effort to work with old-school MySQL-type databases. Express is a nice way of rendering dynamic pages in a node.js-server.<\/li><li><a href=\"https:\/\/aws.amazon.com\/\">AWS: Amazon Web Services<\/a> is a giant company offering tons of products for all needs of a programmer. I have made the experience that they offer a great toolkit for programmers at every level and any project. It&#8217;s worth noting though that using their ecosystem is not always free and requires a lot of reading.<\/li><li><a href=\"https:\/\/code.visualstudio.com\/\">Visual Studio Code<\/a>: If you are having a hard time deciding which IDE to use or which editor \u2013 this is the one. Every language, every ecosystem. Just use VSCode and get the right plugins. You can thank me later.<\/li><li><a href=\"https:\/\/mlab.com\/\">Mlab.com<\/a>: This is a MongoDB hosting provider that offers a free tier. For small projects this is optimal and as soon as your project grows, you can either level up to a pro tier or run your own server somewhere.<\/li><li><a href=\"https:\/\/github.com\/\">Github<\/a>, <a href=\"https:\/\/circleci.com\/\">CircleCI, <\/a>and <a href=\"https:\/\/codecov.io\/\">Codecov<\/a>: These three offer the following for an open source project: <ul wfd-id=\"4910\"><li>Hosting for the code provided by Github. This also enables collaboration, version and release management and offers you a publicly available issue-tracker.<\/li><\/ul><ul wfd-id=\"4963\"><li>A continuous integration pipeline provided by CircleCi. Continuous integration is a powerful tool \u2013 especially once you have gotten used to writing unit-tests.<\/li><\/ul><ul wfd-id=\"4961\"><li>Coverage reporting provided by Codecov. For those unit-tests mentioned above, you can then export coverage reports and visualize the results in the Github Readme.<\/li><\/ul><\/li><\/ul>\n\n\n\n<p>For an example of this, you can check out my <a href=\"https:\/\/github.com\/SilverLinings89\/EvolutionaryOptimization\">Evolutionary Optimization Example on Github<\/a> for reference. I hope you liked this article and I&#8217;m looking forward to your questions and comments below.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"tmnf_excerpt\"><p>I want to take you by the hand as a complete beginner, someone who only knows the term Webdesign, and guide you to those first lessons to learn, videos to watch, documentation pages to read and give you an overview of what you are dealing with.<\/p>\n<\/div>","protected":false},"author":1,"featured_media":218,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[34,25,4],"tags":[14,6,19,42],"class_list":["post-217","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-highlights","category-programming","category-tutorials","tag-code","tag-introduction","tag-programming","tag-webdesign"],"jetpack_featured_media_url":"https:\/\/light-and-code.com\/wp-content\/uploads\/2020\/01\/world-wide-web-analogic-1241408-1600x1200-1.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/light-and-code.com\/index.php?rest_route=\/wp\/v2\/posts\/217","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/light-and-code.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/light-and-code.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/light-and-code.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/light-and-code.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=217"}],"version-history":[{"count":2,"href":"https:\/\/light-and-code.com\/index.php?rest_route=\/wp\/v2\/posts\/217\/revisions"}],"predecessor-version":[{"id":221,"href":"https:\/\/light-and-code.com\/index.php?rest_route=\/wp\/v2\/posts\/217\/revisions\/221"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/light-and-code.com\/index.php?rest_route=\/wp\/v2\/media\/218"}],"wp:attachment":[{"href":"https:\/\/light-and-code.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=217"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/light-and-code.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=217"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/light-and-code.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=217"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}