Monday, August 15, 2016

Computers Are Actually Pretty Dumb

Many people like to think of computers as these beastly technological behemoths that do magical things and are super-smart, much more smart than humans will ever be. That's probably why there are people that are afraid that eventually humans will be overrun one day by a race of superior robots, right? Maybe these two wise historians were right.



Well, in the last couple weeks I spent learning the basic building blocks of websites, HTML and CSS, I can tell you one thing for sure: it's the human behind the computer that is the smart one; computers are actually really dumb- just super fast. What do I mean? Am I first to die due to my insolence against the robot master race?

Take a calculator, for instance, which is a very basic computer. It can solve pretty much any major arithmetic problem you have faster than you can do it in your head or on paper (unless, of course, you're a savant of some sort). However, try and input a basic word problem in it and it will give you an error. It can't interpret or even read words! It relies on the human to input something into it, and it does the very basic calculation SUPER quickly. All computers are essentially the same way - humans have just built so much functionality off the basic building blocks that computers understand that their science is almost indistinguishable from magic.

So the last couple weeks I have indeed been learning about the basics of web design, HTML and CSS, which, for the boringly curious, stand for HyperText Markup Language and Cascading Style Sheets, respectively. What they mean and what they stand for isn't really relevant- their function is the important thing. If you pretend you're the Dr. Frankenstein of the computer world, and picture a complete website like a body you're building from scratch, HTML is essentially the skeleton- the bare bones layout of what the page contains in what order. You've actually probably seen it before when a page you're trying to load on bad internet loads all weird and stacked on top of one another- Here's Facebook when only the HTML loads-




Weird, yeah? That's essentially what HTML is- it builds the website just like you see above- and that's where CSS comes in to make it look pretty. CSS is like the skin and hair and everything else that alters physical appearance- which is exactly what it does to a webpage. It can rearrange things, change the appearance of other things, add more things, and much more, a lot easier than HTML can. There are other things that are the equivalent of muscles and organs and everything but that's later- I haven't even come close to studying those yet.

Also, remember how I said computers are dumb, just fast? You literally have to spell out every little detail for them- they cannot assume anything unless you've already told them to do so. I learned that they don't spot patterns, they don't fill in the blanks, and if you miss ONE TINY LITTLE SEMICOLON they're not going to know it was an accident and it will MESS UP YOUR WHOLE PAGE. Not that I'm bitter or spent 25 minutes trying to figure out why my page wasn't like the one in the tutorial or anything...

Anyway, here's an example of what I was working on to show. Here's a very basic website, the first one I built, after reading a while about HTML and practicing with things and following along a tutorial.



It's very bare bones -almost looks like something out of Microsoft Word and certainly nothing impressive, right? Then again, neither was the Facebook one. But this is what the code looks like in HTML:


WHOA. A lot of typing. When I said that you had to spell everything out of the computer, I meant it. When each new paragraph starts and ends, what size you want everything to be, when a link starts and ends, when a new list starts and ends, where the line breaks are, what the images are and how big you want them to be on the page... zzzzzzzzzzzzzzzzzzzzzzzz.

At least it was easy. Even if it was massively ugly on the page, looking like something straight out of Angelfire. (Please tell me at least some of you remember what that is.) Then I hopped in to learn a bit about CSS, to make things a little prettier, you know, like I wasn't a 12 year old kid with a Geocities account.

This is what that same page looked like with a little CSS-


OK, so maybe it still looks a little overzealously 90's-12-year-old, but hey, we all gotta learn somehow.

For the curious, this is what the CSS file looked like- a page where basically you tell all the paragraphs to be red, or all the links to be green before they're clicked, or, really, anything you want to any category of tags that you want.
























It's a LOT of typing for seemingly very little payoff, but if I'm to get anywhere in the programming world, I have to accept that and roll with it.

There's nothing like the feeling of creating something - a website, or an app, or whatever- on your own, with absolutely nothing but a blank word processor. It took me a few days to read about how to create a basic webpage with HTML and CSS, but creating that website on my own (though I was following a tutorial), editing it how I pleased, and seeing the changes happen in real time, gave me a pretty cool feeling. Baby steps are important, because from what I hear, the journey doesn't get any easier from here, and I'll spend a lot more time frustrated trying to find out why code is or isn't working the way I want it to.

Next up is probably building more pet projects with HTML/CSS and getting more comfortable with them. There's also Ruby which I'm guessing will be after that- I'm still following The Odin Project, which for those of you just joining us is a website that has a very detailed curriculum that puts you well on your way to acquiring skills needed to becoming a web developer.

No rest for the weary, of course- which means I'm back at it for some more. And by some more, I mean approximately an hour or so more before I go back into debating whether or not to buy No Man's Sky.

Thanks for reading!

Wednesday, August 3, 2016

The First Few Days, or, What in HELL is a "Ubuntu"?!

So. Welcome back to those of you who made it. Doing what, I don't know, but I figured I'd be writing a little bit to take my mind off the ridiculous world I've been jumping into the past few days.

What have I been doing, and what the hell does it mean? Let's explore.

So remember The Odin Project from the last post? Essentially it's a website that says "hey, do these little courses we have here that are designed to prepare you to get a job as a web developer!" I've been gradually worming my way through the first few lessons, which are (rightfully so) introductory and basically teaching me baby-babble before I start to form words.

Except this baby-babble looks something like this:

..........................


Just so that we're all together in this, for my face at all of this so far, see Conan.

In fact, the "what the hell is that" mentality is pretty normal for starting something new like this, because there are some things you have to get in order to start programming stuff, and you're just going to have to do what teacher says to get them and not wonder why until you understand more stuff much, much later. In order to begin web development, anyway, I needed to install a bunch of things in order to even be able to speak the languages that I was going to be learning. It's like building the tongues and teeth and stuff before learning how to shape them to form letters and words.

So let's see. According to Odin, the first thing I have to do is to install Linux, because all the new stuff I'm going to be using works best on Linux. Sure thing, right? The programming files that I needed to use happened to work perfectly with something called Linux. So just visit a website, click 'download', then click 'install', right? What a beautiful time we live in where things are so eas-

I'm sorry what?

So fun fact! Everyone knows Windows and Mac (or OS X or something like that), right? Linux is one such operating system - that's right, a completely different OS on your computer. So it's not really so much a program as it is a brand new operating system on your computer. Not only that, I wasn't really looking for something called Linux, I was looking to install something called Ubuntu. What? I'm already speaking different languages. What in HELL is a Ubuntu and why isn't it Linux and why do I need it and what's the difference between the two and how do I even install a new operating system and and



Anyway. Even though I was a little lost and confused at that point, I knew that following the directions word by word would (hopefully) get me where I needed to be. Luckily, the instructions were pretty simple- load the Ubuntu installation onto a USB, then restart the computer and hit a certain button when it first loads to install Ubuntu from a USB. I didn't want to get rid of Windows because all my old stuff was on there and essentially nothing that I use runs on Linux, so I had the option of doing something called 'dual-booting' Linux to my computer.

"but wait yinan i thought u said u need linux & why u talkin bout ubuntu, wat"

Just like Windows has Windows 7/Windows 10 and Mac has Leopard, Linux has Ubuntu. There are many different kinds of Windows OS's, right? Windows 7, 8, 95, 10. It's the same for Linux. Ubuntu is one such type and the one that lots of people recommend. Other Linux distributions include RedHat and Knoppix, but I didn't feel like an aneurysm so I didn't read further than that.

Anyway, back to Ubuntu. I succesfully managed not to fry my entire computer (literally, that is a risk that could have happened) and installed it properly. Now, every time I turned on my computer, I could choose either to boot to Ubuntu or to Windows. Ubuntu for all my programming needs (since apparently sometimes that stuff doesn't work too well on Windows) and Windows for, well, everything else.


There it is! Isn't it pretty? It actually kind of looks like a Mac. I've always been a PC fanboy, but hey, you gotta make sacrifices somewhere if you want to get better sometimes.

OK. Now according to the 'Installfest', which The Odin Project told me to visit and download literally everything that's there on, I needed more stuff like Ruby, Rails, Git, Github, Heroku, a Ruby editor, and gems. The funny thing about installing stuff on Ubuntu is you don't go to a website and hit 'download', you do pretty much everything in something called a "command prompt", which is literally a text box that you give orders to your computer on. I took a small course on Odin Project that told me how to navigate through my computer by literally just giving it commands- where you'd click on My Computer and click through the files and stuff to navigate, I would enter "cd ~/insert-directory-here" to get there and I'd be able to use other commands to see what was in the folder, rename stuff, open stuff, etc. I had to take a little while to learn these commands and figure out how to do very basic stuff to get around.

That's where the baby-babble image came from- all of that was a chunk of text that flew by when I entered a certain command into the prompt to install something. I literally had no idea what I was entering, either, and they said that was ok. I figured I'd know what the heck was going on later when I understood more. See, I wanted to just tell my computer "Hey, install all the software and shit I need OK?" Except in computer speak it literally looks something like this:

sudo apt-get install autoconf automake bison build-essential curl git-core libapr1 libaprutil1 libc6-dev libltdl-dev libreadline6 libreadline6-dev libsqlite3-0 libsqlite3-dev libssl-dev libtool libxml2-dev libxslt-dev libxslt1-dev libyaml-dev ncurses-dev nodejs openssl sqlite3 zlib1g zlib1g-dev

I still cannot make heads or tails out of whatever the hell that technobabble is, but hey, if they told me to jump at this point, I'd ask how high.

Dozens of copied-and-pasted commands into my command prompt later, I had pretty much everything that I needed to start, as well as a fundamental look into what each of them was used to do:

  • Ruby, which, according to Google, is a dynamic, reflective, object-oriented, general purpose programming language, to which I say, "Gesundheit."
  • Ruby on Rails, which apparently is not what you shouldn't do with precious stones and train tracks, but something that makes web applications with Ruby
  • Git, which would probably be offensive if I were British, but actually is a complete history of any programming changes you make to things, so you can look back to see where you colossally screwed up something and attempt to fix it. Do they make one of these for real life?
  • Github, which is not a bar for idiots in the UK, but a website where people publish their open source Git repositories
  • Sublime Text 2, which is a text editor that makes your programming pretty colors so you know what does what
That's a lot of stuff that I didn't know what the heck just happened for. All I knew is, I followed the directions, and now I have all this crap- in the next few days, I'll be learning about the very basics of websites and how they work, and what languages they speak and whatnot. 

But for now, I'm giving this a rest and going to Overwatch. Peace.


Monday, August 1, 2016

Yinan Learns To Program Episode I: Like I Need More Excuse For People to Call Me Nerd

Hi all!

I've started this blog to attempt to keep myself honest and accountable on a new venture I'm taking, as well as giving people a step by step insight on the journey of learning how to take on a new and terrifying skill from day 1. What is this new journey, you may ask?

Programming.

Hey, wake up. Stop it, I was just getting started. Bear with me here.

Anyway, it's always been something I've been interested in learning and dabbled in only very occasionally; I've always been fascinated with the process of creating something from nothing, simply in by typing in a few (hundred) lines of things to tell a computer to do something. Take a look around the internet- websites, mobile apps, games, EVERYTHING is made by programming. It's a big scary word to some people, myself included, because it seems so complex and foreign, much like how math is to people who hate math.

So why did I do it? Am I a glutton for punishment? Are you, dear reader, for reading this far? I was looking around the internet recently on easy ways to make some money part time by, in the true American spirit, doing as little work as possible. I came up on sites like mTurk, where they pay you pennies and dimes to do simple tasks like click things, and Swagbucks, where they give you points for searching the web, doing surveys, and watching videos. These things were great and all, but they were paying pocket change for a lot of time (relatively) spent on them. If my time as a private tutor tought me, monetizing a specialty skill you have is definitely more lucrative than doing easy tasks that hundreds of thousands of other people are also doing and they can choose to pay pennies for. What kind of skill did I have that I could offer to people- and maybe even make a buck or two doing it?

And then, in a sadistic twisted train of thought, I said to myself, why not look into programming? Yeah, you know, that thing that people spend years and thousands of dollars learning how to do, I could just easily pick that up and start monetizing it no problem right? Well, wrong. (Duh.) Because it was something I always wanted to pick up for fun, and something that I dabbled in when I was younger (thanks for all those lessons in how to write basic programs for the TI-83 in high school, Luke Bradford), I figured learning how to program stuff would be fun. I'd get to do something I enjoyed- creating something from the ground up, and see how it worked- and spend more time on a computer, like I didn't do that enough already. As everyone knows, having a passion or interest in something is a very good way to give you the drive to keep going, so why not pick it up as a fun hobby (different people have very different definitions of fun) and then see where I am a few months or years from now?

So here comes the point of the blog. I started the blog to inspire myself to keep going with it, to chronicle my journeys, thought processes, successes, and frustrations in learning how to actually program things. I also like to write, so that helps. It takes a LOT of motivation to keep going with learning a skill like programming just because it's literally learning different languages- albeit, ones that computers speak, not humans- so I figured writing things down would help, so that I could have a journal of my experience slogging through the world that is learning to speak computer, and maybe even provide a guide (or humorous diary) for those who are looking to do the same for themselves, or looking for a bit of entertainment.

How am I starting this long trip down speaking the geek speak?  I'm a big fan of Reddit so I have definitely perused /r/learnprogramming. (Sidenote, if you ever need to look up something or ask a bunch of enthusiastic people on the internet about something, find the relevant community group on Reddit.) Through there, I've found a website called The Odin Project that people have recommended as a good starting point for learning web development, or basically making websites. I learned one thing first and foremost- have specific goals on what you want to do with the code, and learn stuff to help you do that, otherwise you'll be floundering around like a fish out of water trying to learn things here or there and not really going anywhere.

Why should you bother reading? Well, one, you read this far. Two, I promise to dumb all the code-speak down to human terms; this way, I get to explain what I've learned and retain it better (since you learn far better by teaching material than simply by memorizing it), and hopefully it garners a few readers here or there as they read my struggle with something that will most likely confuse the living daylights out of me for the next coming months.

Like Little Red Riding Hood, I'm excited and scared, but slow and steady does the trick (thanks, Mr. Cedric). Little by little, day by day, I'm going to learn how to do it, and y'all get to read through every painstaking step of the way here!

Thanks for stickin' it out this far. More to come.