Make Your Own Website - IntroductionsteemCreated with Sketch.

in #programming7 years ago (edited)

header-introduction.png

In this course, I plan to teach you how to start making your own websites from scratch. We won't use any templates like the ones you can find on services such as Wix, SquareSpace and more. Websites made with these services are more often than not restricted by the technical limitations of programmed coding. Making websites with those services also makes it difficult to understand what's happening behind the scenes, which is something that I value a lot in everything I do. You will never achieve what you want if you don't understand how it works, that's my belief at least. We will start by learning HTML5 and CSS3 to create our first webpage but it won't be enough. Once most of these languages is learned, we will get into more interesting websites by learning PHP and JavaScript which are harder but far from being impossible despite what people may think when seeing a piece of programming. I like to compare learning programming to learning a new language. It's hard if you jump in it without any structure but if you learn step by step always increasing the level by a little bit, you can do it.

That's cool but what are these four languages used for ?

I'm glad you asked because this is exactly what we will learn today ! Those four languages all have a specific task in our making of a website. I will introduce each one by explaining it and then showing what it does exactly with an example. Let's get started !
  • HTML
    (HyperText Markup Language)

html_layout.png

    • Hypertext

      Text that gets outputted on the screen and that can be interacted with. The best example is a text link that once clicked redirects you to another page.
    • Markup

      Not to be mistaken with Markdown which is a markup library. A library usually is meant to make things easier for the user to use. The posts you write on Steemit are in markup, more precisely they are written with the Markdown language, they then get converted to HTML so that the browser can use them. A markup language is a language used to format a file, to structure the data while not confusing the markup part with the data part.
    • Front-end language

      It operates on the client side which means it has no interaction with the server.
    • Not a programming language

      Despite what many believe, HTML is not a programming language. All the programming related articles using a picture of HTML code to illustrate what they say are therefore misrepresenting their work.

Now it's time to see what HTML can do for our website. I chose not to code the full page but just a post. This post is meant to look like a mix of the ones you can find on Twitter and Facebook. A post contains in its header (the upper part) the author's name, his profile picture and the time passed since he posted. In the middle you can see the part of the post written by the author. Finally, at the end are a bunch of interactive functionalities (liking, sharing and commenting) as well as counters of how many users used them.

HTML

As you can see, it doesn't really look pleasing, does it ? We can barely understand what's going on there without having an explanation of what it's supposed to be first. Nobody in their right mind would ever want to use such a website. Thankfully, the next language is meant to make everything look good for the user !
  • CSS
    (Cascading Style Sheets)

css_layout.png

    • Cascading

      References the way stuff is styled depending on how you wrote your CSS. Without any importance taken into account, a tag will be styled by the last part styling it in case of conflicts. However, such things as ids and classes will give tags more importance, which will interfere with this rule. We will look into that in depth later as it is a big part to understand.
    • Style

      This language is used only to style the HTML so that it looks good for the user.
    • Sheets

      CSS files are called sheets, you can link as many sheets to your page as you want but the standard is to have one big sheet taking care of everything.
    • Styling inside HTML

      You can add style to elements directly inside the HTML even though it is not recommended in most cases. It is common to separate styling from markup in order to have a clear view on each element. It also can get messy really quickly if you have many properties to apply to your element as can be seen in the comparison below.

      comparison.png

    • Front-end language

      It operates on the client side. Styling can change depending on the user's actions and on the display seize.
    • Not a programming language

      Just like HTML, CSS is not a programming language. There is less confusion about it though as it really doesn't look like programming at all.

It's time for the magic to happen ! Everything will look good, are you ready ? There we go (queue in the jingle of Pimp My Ride) !

CSS

What exactly happened there ? A lot... and yet not really much ! By that I mean that no data changed, we just changed the styling of the page, but remember that it's exactly what CSS is meant for ! The first things you should notice are the colors, three colors are used : orange for the functionalities, a very pale yellow for the background and a dark blue for the text. Another big change is the "submit" button being inside the comment box, you can check the first screenshot, it wasn't in ! The other changes are minor : adding a shadow for the post, justifying the text (which by the way is possible on Steemit but nobody wants to do it apparently), adjusting the comment box to the good width and more.
  • PHP
    (PHP : Hypertext Preprocessor)

php_layout.png

    • PHP

      It is a recursive acronym for PHP : Hypertext Preprocessor.
    • Hypertext Preprocessor

      PHP takes data as input, performs actions with/on it and outputs the result so that it can be used as input data by HTML. This opens the way for dynamic websites.
    • MySQL
      (My Structured Query Language)

      PHP is the most useful combined with MySQL.
      • Structured Query
        Each step is contained inside a query, everything is clearly separated.
      • Connection to a database
        This language sends and receives data from a database located on the server.
    • Back-end language

      It operates on the server side which is why it can make connections to a database.
    • Programming language

      It indeed is a programming language, a scripting one, and is made specifically to be used with HTML. We will learn how to use it with the MVC (Model-View-Controller) architectural pattern that will be explained when needed.

The styling is done but you may have noticed that all the data was default data (0, lorem ipsum, username, profile picture). This is what me and many others do when we are just testing the layout of our website.

PHP

Now that we can connect to the database, posts feel more like actual posts. User's informations are shown as well as time passed and number of comments. We can also submit a comment now that a connection to the database can be made. However, clicking the submit button will make the page refresh as it's the only way the comment could go through. We could have done the same for likes and shares but, contrary to comments, I don't see that ever happening on a website.
  • JS
    (JavaScript)

js_layout.png

    • Java

      JavaScript is inspired by multiple programming languages including Java, it is however not to be mistaken with as the two languages have pretty big differences in their writing as well as their use.
    • Script

      Just like PHP, JavaScript is a scripting language.
    • Badly-written

      This language has a big reputation of being badly-written. This is mostly due to the ability of using multiple different ways to achieve the same thing, which would mean things can get messy when you work with someone who doesn't program the same way as you.
    • jQuery

      jQuery is a JavaScript library created to make it easier to write code on the client side.
      • SPA
        (Single Page Application)
        jQuery is mostly used to create Single Page Applications. Such applications are websites that do everything on one page, not requiring any page refresh. This is linked to the next point.
      • AJAX
        (Asynchronous Javascript And XML)
        • Asynchronous
          In this context, it means that a request can be sent to the server without having to disturb the user's experience by freezing the page or reloading it.
        • XML
          (eXtensible Markup Language)
          It's a flexible markup language mostly used to transfer data on the Web.
    • Front-end language

      JavaScript operates on the client side but using jQuery will make it possible to call PHP scripts that will interact with the server. In truth, it's possible to call PHP scripts without jQuery but it makes it really harder, which is why we will take the easy path.
    • Programming language

      It is another programming language, which means we have one programming language on the front-end and one on the back-end.

It's time for the final part ! The post will be complete now. JavaScript is useful to run PHP files but also to make the user experience better. Everything becomes more dynamic, to illustrate it a simple picture wouldn't have worked so I made you a gif.

ENFIN.gif

As you can see, likes, shares and comments are now instantly sent and added to their respective counters by calling PHP scripts with jQuery. The like and share functionalities changing color when hovered are not made with JavaScript but with CSS, as well as the submit button changing seize. However, the like and share functionalities keeping their orange color once clicked is thanks to JavaScript.


Want to learn more ?

Subject
Title
Author
Type
HTMLHistory of HTMLDevTipsVideo
HTMLPhilosophy of HTML5DevTipsVideo
HypertextHypertextThe Computer ChroniclesVideo
Markup languagesSGML, HTML, XML: What's the Difference?ComputerphileVideo
Markup languagesHTML: Poison or Panacea?ComputerphileVideo
Front end and back endFront End vs Back End Development: Where to Start?Lauren StewartText
Front end and back endFront end vs Back end│Blonde Dictionary explanationCoding BlondeVideo
Programming languageWhat is Programming LanguageVangie BealText
CSSWhat is CSS?DevTipsVideo
CSSCascadesDevTipsVideo
DatabaseIntroduction to DatabasesGCFLearnFree.orgVideo
DatabaseWhat is a database?VertabeloVideo
JavaScriptWhy Does JavaScript Suck?│A Terrible Language with a Bright FutureR.B.Text
jQueryWhat is jQuery?Khan AcademyVideo
jQueryWhat is jQuery?Brad HusseyVideo
AJAXAJAX tutorial for beginnersmmtutsVideo
AJAXWhat is Ajax?WebConceptsVideo

If you think I made any mistake, be sure to tell me so I can edit my post in time.


footer.png

If you liked this post and you want to see more, don't forget to upvote, follow and resteem !

Sort:  

Hey @ragepeanut, I saw this featured as the Make-a-Whale resteem of the day and came to have a look. This is a great source of information on creating a website. Since one of my tasks is to maintain our company website, I plan to try to implement some of the features you have detailed here. Thanks for putting together this great source of reference material.

Thanks ! I'm glad it will be useful :D
Be careful though and take everything with a grain of salt since websites can be built with totally different languages depending on the company. For example, I have some friends who never had to learn PHP but Python instead.
Good luck with your task and thanks for reading and commenting !

Nice post @ragepeanut! I've been developing on the web since the mid 90's. When I first started we were using Notepad writing Perl for the cgi bin. I don't really do much of that any more but instead jumped into Firemonkey (Embarcadero Rad Studio).

Thanks a lot ! It's reassuring seeing that someone like you who has been developing for that long liked my post. I have watched a few videos talking about Perl in the past but that's about it. I could not stand using a simple Notepad to write code, but I guess you didn't really have that many choices right ? Firemonkey is a total mystery to me, I will do some digging to learn a bit about it later this week as I like to watch videos explaining the purpose of each language (or in this case framework).

Shortly after there was a program called HotDog that I used for a few years (from Australia), then I switched to DreamWeaver. Firemonkey is a cross platform environment. I haven't updated Dreamweaver in years because they went to a subscription model and quite frankly the earlier versions were better. Been thinking about Embarcadero's HTML5, but never got into it enough to need it. Firemonkey's strength is in being able to write code once and compile for several different platforms (Windows, MacOS, Android, iOS). Superior graphics too compared to the Windows GDI.

Thank you for your post @ragepeanut. I will take my time to read it again and make notes. I am following you, because I am interested to know more about this topic.

Thank you for your interest in the topic and for the follow ! Be sure to ask me if you have any question, I might take long to answer as I'm going to sleep soon but I will answer, don't worry !

Thanks, I will ask you. No problem if you take your time to answer.

Of course learning to use html and other coding languages is very useful to more advanced users, but I think most people on this website are not quite to that level. Teaching them how to use things such as Word Press, Wix, Squarespace, Weebly, and other hosting companies would be a lot more useful. People can start with those simpler methods and work their way up to full-on coding.

Not saying it was a bad post by any means, it was a great read. Thank you for the info!

That's a different point of view to mine. I have been introduced to HTML and CSS without having any programming knowledge (even though those two languages are not programming) and understood pretty well from the very beginning. It's just a matter of explaining with really understandable and relatable examples and being there to answer every question in my opinion. This post goes a bit far in some points to make people understand that while it's definitely possible to make a website, it doesn't mean it will be easy all the way. There are many ways to teach HTML and what you suggest is definitely interesting but I think I'm going to stick to my plan for now. I really don't believe it's necessary to start using such services to understand HTML, even for real beginners, only future will tell I guess ! Thanks for your comment !

Thanks @ragepeanut, nice review/overview. I have some programming experience but real rusty and looking to upgrade my .html skills and maybe get back into sonething practical and programmable to make my websites better. fFollowing and looking forward to similar future posts!

Thanks, took me long to make but I didn't want to miss anything important. I will take a while teaching the basics because it is first aimed towards total beginners, but you should find what you are looking for further in the course. Thanks for the follow by the way !

Thanks, @ragepeanut, this is a very interesting post and well explained. I believe you must continue to help the community in this field and maybe make a few tutorials to help us to get into it. Thank You ^ and follow

Thank you for your support ! Easily understandable tutorials are exactly what I plan to do !

I would love to see more post like this one! But I feel it contains too much information for beginner to consume. May I suggest to rather go slowly, start with just client side. Simple HTML/CSS with some JS on top to make it more fun, using mock data. And then introduce server side so reader can understand why. Anyway I'm looking forward to next sequel! x)

Thanks for the feedback ! That's exactly what I plan to do actually but I guess I failed to explain my plan. In fact following posts will only focus on HTML and CSS, it would indeed be way too much to digest if I talked about JS and PHP that soon. I just wanted to introduce all the languages that will be used in this introduction, in reality months will probably pass before I talk about a programming language !

Many few weeks ago to I really think which programming languages to learn.
And you make it quite easy@ragepeanut.

Thanks ! I hope you will stick with me through this course ! :D

I love programming.. I call it the world that speaks codes

That's a nice way of calling it :D
Thanks for reading !

I'm totally out of programming, but rather an artist, but I have learned a lot about programming through your blog, greetings from Belgium

Well, we are both from Belgium then ! Nice to see my explanations didn't confuse someone like you (out of programming I mean). You got me intrigued, I will check your art tomorrow. I guess you put some on Steemit right ? For now I have to leave though as I'm getting really tired, I hope we will get to talk more in other posts !

you can find some of my creations on steemit, sleep well

Coin Marketplace

STEEM 0.27
TRX 0.11
JST 0.030
BTC 67688.54
ETH 3821.02
USDT 1.00
SBD 3.55