Put Your Money Where Your Mouth Is – 7 Habits of Highly Effective Aspiring Programmers (Part 2)

If being an aspiring programmer was something akin to a fundraiser, this is what you’d call a stretch goal. In other words, this isn’t going to be absolutely essential advice that will invalidate all your efforts should you choose to ignore it.

But it will make a HUGE difference.

The primary reason people are able to take-up a new hobby, profession or career in a given era which was not possible in the prior is because the barrier to entry has been lowered. How does this happen? Well pretty much by making the job to easier do. This is achieved through better resources, such as technology and education infrastructure. This more or less translates to better tools and better education about these tools. The reason every 7 year old can learn to code these days is because it’s so ridiculously easy: you can drag a puzzle piece onto another and boom, you have a walking talking cat. Such a feat would be unfathomable in my father’s generation. Go back further, and you have a team of 20 scientists feeding paper into a monster praying to dear God that today’s work wouldn’t be tomorrow’s. Think about it, this is what it took just to compile back then. Now my sister can conflate compiling with running a program.

Fortran Coding Form

If you say you’d still code if you had to punch a stack of these, you’re full of shit

So how do you make learning to program easier? You make the actual physical experience of programming as easy as caressing a kitten. No one can deny it when I say it’s just such a pleasure to code on a newer, faster machine. If your computer is slow in any way, run the standard optimization procedures and if that doesn’t cut it, just face the truth, you need a new machine. If you have a laptop, spend the money for a good mouse (get Microsoft’s Bluetooth arc mouse, if it doesn’t boost your productivity by 200%, I’ll offer you my hand in marriage). Don’t scrounge on internet. Get a bloody second monitor and any necessary cables.

Now, not having the right resources fosters ingenuity and a handful of other skills that are hard to get elsewhere. I’ll admit that more than anyone; the reason I learned to code in the first place was to create games that could run on the crappy outdated machines my papa would buy me so that I wouldn’t be able to play games (not to mention he wouldn’t buy me games either). Another great example of this is my friend Christian, who began his computing journey by trying to configure an Italian copy of Windows out of pure necessity. But that’s the catch. Pure necessity. Are you coding with a piece of junk because there’s something you really want and you have no other option? Or is it because you’re ordering too much takeout?

My heart just goes out to all those individuals that come to me with programming questions whilst lugging the conceptual equivalent of CRT monitor stapled to a keyboard, which has to be tethered to a socket just as much as the real thing. You have to wonder why so many developers pay premium for a MacBook Pro. After all, it’s just a pretty preassembled shell on standard internals (both software and hardware wise). Why do that when they can build a machine and stick Mint (Linux) on it for pennies? Because the ROI on getting actual work done is orders higher than on trying to save $100 bucks.

If you think this stops at buying toys for yourself, you might want to reconsider. You’re going to have to consider opportunity costs every day. The hardware and software is only the initial cost. Day to day, you’re going to have to wonder: do I skip school today and spend $200 to go to New York for Y Combinator’s startup school? Do I turn down a $1000 WordPress plugin install gig to focus on your side project? Do you bomb a midterm to attend a hackathon? The answer has always been yes for me. This has been incredibly taxing on me academically, physically and financially, but I truly believe this has put me ahead of my peers. It’s my passion for developing and creating technology that allows me to come up with the time and money for whatever endeavour. Ultimately, this is why I can build a website from scratch or hack a drone and why they can’t.

The suckiest situation programmers get into as they get older is that they end up working on things they hate, when they’d actually like to work on something else. You hear about this all the time, especially because of all the popularity startups and tech companies have been garnering recently (which face it, is the equivalent of people heading West for the gold rush, too late and too useless to earn anything big). People always say they’re going to take a job here or there to get experience and get established financially, y’know just for a “while”, but then they get comfortable, fall in patterns and never move out considerably until the day they die.

If you want to become that great programmer who creates something great, you’re going to have to consider probably the largest opportunity cost of them all. Do you leave your well-paying but intellectually devoid job? If the answer is no, congratulations, you’re no longer an aspiring programmer… and that’s completely fine. Some people are just content with good money, which they can then use to focus on things like family or travel or volunteering, which are all equally desirable endeavours. Don’t feel like you have to be the greatest programmer ever to get places. But if you want to be at the helm of your discipline and create, then expect to pay the price.

The prior article in this series: Procure More Mentors

Setup Azure Websites & Add Domains – Node.js Express Sign-Up Site Tutorial on Azure Websites (Part 1)

As I mentioned in part 0 of the tutorial, It’s ridiculously easy to spin up a website on Azure. There are other tutorials on how to set up the site, but I’ll include a brief tutorial here for the sake of completeness. Setting up a custom domain for the site (i.e. www.ramenscafe.com instead of www.ramenscafe.azurewebsites.com) is also for some reason quite a hassle and the official tutorials did not work for me and many others, so I’ll explain how I managed to do it.

First things first, navigate to your Azure portal. Screenshot (105) - redacted

Press on the NEW button on the bottom left. Choose COMPUTE -> WEBSITE -> QUICK CREATE

Screenshot (106) - redacted

Choose a name for your site. You can later use this URL to access the site, in addition to any domains you add. For the Web Hosting Plan, choose the option to create one if there is none existing currently. Select the CREATE WEBSITE checkmark on the bottom right. Your site should be up before you can say half a mil for real.

Half a mil fo-

Half a mil fo-

Click BROWSE on the bottom to be redirected to your new website.

Screenshot (114)

As you can, there’s not much going on for now, just like when you first visit a site you launch on a traditional webhost. We’ll add content in the upcoming tutorials.

Add Domain to Azure Website

First, I’m assuming you purchased a domain already. If you haven’t, you can grab one at Namecheap for… cheap (yep, that is an affiliate link). If you’re looking for an exotic domain such as a .com.bd in my case or a .quebec domain, you might be better off contacting your national authority on web domains directly; Wikipedia will mention the regulating body for each domain (this might also be cheaper and less shady, as in my case). Go to your domain registrar’s settings page and go to DNS settings. If your registrar won’t handle DNS, you can use Namecheap’s freeDNS feature to use as a nameserver (I won’t go into detail here, but let me know if you need help with that).

Screenshot (112) - redacted

Ignore autodiscover, lyncdiscover and everything beneath it. These are records to configure Office365 domains.

Note, the exact instructions will depend on your registrar/DNS host. You should strive to make the records as much like this as possible. You’re going to have to add the domain records to the domain settings page. The first thing we add is our website’s IP on the @ record. Choose A (Address) for that, if it’s not set already. The TTL (Time-To-Live) will bet set automatically, but choosing 1800 otherwise is fine. for the www record put yourdomain.azurewebsites.net. . That double period was intentional. You will likely have to put a period after the .net for it to work properly, but this might depend on the DNS service.

These records alone will likely not be enough for your domain to function properly (depends on how finicky Azure is being). So we’re going to add two additional CNAME (Alias) records. Add an awverify record with URL awverify.yourdomain.azurewebsites.net. . Then add an awverify.www record with URL awverify.yourdomain.azurewebsites.net. . This is necessary for the www to work if entered in an address bar (without it yourdomain.com would work but not www.yourdomain.com). To add subdomains, do the same thing again, but this time add the name of the subdomain anywhere you see an awverify (check the ukil records in the picture to see what I mean).

Finally, go back to the Azure Portal and click on WEBSITES. Select the name of your website, (but don’t click on anywhere near the arrow on the website title, or it will take you to the website management page). The option to MANAGE DOMAINS should show up on the bottom. Click that. Check the picture before the last two to see what I mean.

Screenshot (110) - redacted

Now all you have to do is add www.yourdomain.com and yourdomain.com. A waiting animation should be played in the text box and if it’s successful, you’ll see a green checkmark. If you get a red x, then try exiting the page and coming back. I once had to refresh after several minutes for it to work.

Green checkmark indicates you have yet to fail in life.

Green checkmark indicates you have yet to fail in life.

And with that, you now your website up along with it’s own domain name!

Node.js Express Sign-Up Site Tutorial on Azure Websites (Part 0)

Recently, I’ve started focusing more on node.js development. While being harder (imo) than developing Windows or Android Apps and not as exciting as working with hardware, there are a range of advantages that compelled me to start developing for web. The primary reason is the ease of disseminating content through the web. Although the initial cost for me to fire-up and distribute a Windows Phone app is probably lower, in the long run, it’s a lot harder to get people to try it out. People are lazy and generally won’t bother downloading your stuff unless they really like you or have a good deal to gain by downloading your app. With a website on the other hand, people are usually a mouse breadth away from clicking on your link in a Facebook chat window. Better yet, if they’re not on a PC, they can still access the same content as everyone else, using that same link, on any device.

Why this is extremely useful is because it helps you win with things like hackathons or anywhere where you might be obliged to sell a concept. For the price of a domain, you can get a room full of people to visit your site during a demo. The investor you’re pitching will actually bother looking at your site, as opposed to using some demeaning tactic like saying she doesn’t have time to download your app.

Some of the other benefits include being able to use SEO or social marketing. It’s a lot harder to influence where your app shows up in an app store, when every app is given the same amount of screen space between a million others. On the internet, how popular your site is depends on how well you can game Google, Bing, Facebook and Twitter (apps themselves have to compete with sites in this domain, but honestly how often do you come across an app as opposed to a hyperlink?) No doubt there are millions of more potential competitors on the internet, but it’s a lot easier to SEO your up to a search engine’s front page than an app store’s.

To document my own learning, I will be writing up tutorials to show how you can create and launch your own website on Azure Websites. There are a lot of good tutorials on making a simple sample site with Express and Node.js and some other ones on Azure, but there isn’t any comprehensive tutorial to show you how to combine them and make an actual, useable website. Some things I’ll cover are domains, databases and styling your website.

Why Node.js?

There are several web stacks I could’ve picked from, such as the ever present LAMP stack (PHP w/ SQL), the startup perennial Ruby on Rails, Django or flask for Python, or even C#/ASP.NET (C# is my favourite language, if you didn’t know already). Asking which is better is evidently a shark vs. gorilla question. Node.js currently fits my needs better than other frameworks and is more convenient for me to use.

I first considered using LAMP, but I wanted to take advantage of the perks of the newer stacks, such as easy prototyping and package managers. PHP itself is now getting many of these upgrades via frameworks such as Symfony and Laravel. I came close to using Laravel, but couldn’t get it configured due to some server issues and eventually stuck to what I had working already (which was node.js). As of now, PHP (especially with Laravel) is probably the easiest to pickup. Examples of large sites using LAMP are Facebook (largely because it was made in the early 2000s when PHP was all there was and a revamp would be a very costly procedure to pursue). It does get the job done. Also begging a mention is the fact that most development tasks can be fulfilled by writing a WordPress plugin rather than making an entire site, drastically reducing the time required to deploy a product

Ruby on Rails was my other option. The main reason I decided not to follow through was because of its steep learning curve. Ruby on its face is easy to learn, but RoR takes work. RoR probably has the largest community right now and this shows with the wealth of plugins they have, aptly titled gems. Ruby also has some other perks such as scaffolding and out of the box CSRF protection. I didn’t end up using RoR because I wanted to put less effort in learning the basics.

I don’t use the python stacks mainly because I’m not a python fan, though my friends have had good results with Django on Google App Engine. C# I stayed away from because I wanted to get experience with other languages and to make it easier for me to find younger developers/get hired in non-enterprise. ASP.NET development is somewhat stigmatized, but it’s actually pretty neat. I won’t go in to detail in this post.

After eliminating all the other options, I was left with node.js. My two main reasons for using node.js was the excellent support now available on Azure and Visual Studio (check out Node Tools for Visual Studio) for node and the fact that node.js uses javascript, permitting me to use one language for all my web development. It’s pretty easy to pick up coming from C# or Java (as opposed to PHP or Ruby). Node.js also has a glorious package manager, npm, which is akin to sudo apt-get on Ubuntu. Where node.js really shines is multiple concurrent connections to the server/high IO traffic, such as in a chat application or maybe even a 2D browser MMORPG. This isn’t currently too important for me, but I wanted to learn how to develop with it for when it will be important. For a quick tutorial on Javascript and node.js, check out learnyounode.

Why Azure Websites?

Azure Websites (and Azure in general) is great. After doing some mucking around, I found out that Azure supposedly initially had a very ugly GUI, but the Azure team (cloud was under Nadella at the time) fixed it and now, boy is it sexy! I never fathomed spinning up a server in mere seconds and this was probably the catalyst for me taking the leap to Web. The price is pretty competitive with Amazon Web Services (they’re both constantly dropping their rates, they’ll send you e-mails every week about it, literally) and although it’s not as cheap as hosting a dozen low traffic sites on a shared host (like I do with this blog), if you scale to a commercial load, the prices even out. Microsoft is also currently working to give students and startups a good deal of free hosting credits (Y Combinator companies for example, get 500k in Azure costs defrayed) so try to contact your local campus or startup Microsoft rep to hook you up.

The Goal: Proshno.com.bd

I wanted to start a site to offer a certain service in Bangladesh. Seeing as it’s going to take a while to launch the site, I wanted to put up a beta sign-up page on the domain so I could drum up some interest for the brand. The site is currently pretty basic, but it encompasses a host of technologies to carry out its objective. A user can sign-up with their e-mail and pick an option from a form. If they sign-up with a proper e-mail, their details are entered on a database and an e-mail is sent to my inbox. As opposed to redirecting, the page uses AJAX to confirm or deny the sign-up on the same page. The routing and closer to metal stuff is taken care by node.js and the Express(.js) web framework. Sendgrid deals with e-mails and Azure tables stores our database results. The site is responsive thanks to bootstrap, but currently has some graphical bugs on certain devices.

Initial pre-functional mockup of the Proshno Sign-Up Page.

Initial pre-functional mockup of the Proshno Sign-Up Page.

I’ll put the first tutorial up shortly. For now, it would be wise to download node.js and familiarize yourself with Jade (a cool way to write HTML) and Stylus (a cool way to write CSS) if you haven’t already.

EDIT: The next tutorial in the series can be found here.