All articles written by: megawatt

Swift – Variables and Constants

Most programming languages let you create variables. A variable is a callable piece of code that stores data. For example, instead of having to type out “The United States of America” every time you want to use that sentence, you can store that sentence in a variable called “US”. Now every time you want to say “The United States of America” you can instead just type in US, and it would be the equivalent of typing in that entire sentence.

The difference between swift and most programming languages is that swift allows you to create constants as well as variables. What are constants? What are variables? We will get to that, but first let’s go over variables.

To create variables in swift, you use the following syntax:

var nameOfVariable: String = “Piece of Data”

Let’s break this down starting from the left. Var is our keyword here that lets swift know we want to create a variable. The nameOfVariable can be anything we want, we simply have to assign it a name based on what kind of data it is going to store. If it’s an address for example, we can name the variable address. It wouldn’t make sense to name it address if it were storing your age for example.

The “: String” is completely optional. It’s only there so we can explicitly tell swift that we want to create a variable of data type String. String being replaceable with any of the other data types. We aren’t going to go over the different data types here, if you want to learn more visit our Swift Tutorial Data Types. Because this part is optional, you can actually still write the above code as:

var nameOfVariable = “Piece of Data”

And still have it working perfectly.

After the equal sign we finally have our data. Because the data is enclosed inside of strings, it shows that this data is of string type.

We can access this variable by simply calling in the name of the variable, in this case “nameOfVariable”

Now we’ll move on to a unique feature of swift, or at least I haven’t encountered this in other program languages. We’re going to go over constants and how they differ from variables. Constants and variables are similar in that they both store data, but they store data differently.

To quickly summarize the difference between the two, constants are known as immutable, or cannot be changed. Variables are mutable, which means they can be changed. How you set a constant is by using “Let” instead of Var, otherwise they work exactly the same.

To create a constant of the above variable, all we have to do is change the keyword from var to let:

let nameOfVariable: String = “Piece of Data”
let nameOfVariable = “Piece of Data”

Again data typing is optional.

When do you use constants instead of var? You use constants for when a value will never change. For example you can create a constant for the speed of light, the value of pi, the date of your birth, and so on. For variables, you want to create variables when the value can change. For example you’d want to use a variable for your age, your weight, your velocity, and so on.

That’s the main difference between constants and variables. I hope you learned how to create constants and how to create variables. If you have any questions, leave them down in the comments.


An Analysis of YouTube Stages of Growth

I’ve been a member of YouTube now for over ten years, having created my first account on March 20th, 2006. I’ve lived through the age when YouTube was not yet owned by Google, I’ve seen and experienced the many redesigns of the YouTube website, the policy changes, the new rules set in place, the new features added. I’ve met thousands of people on the website, I’ve spent countless thousands of hours watching its videos, I’ve read tens of thousands of comments, shared hundreds of videos, and laughed, cried, got angry together with the content creators.

Throughout the years there have been a few core things that have never changed: The logo, the ability for anyone to upload any video, the ability to watch any public video, and the abilities to post comments and rate said video. Those are the core features that collectively make YouTube the site that it is. There are other sites that boast the same features, but they just can’t compare. YouTube has the perfect name people trust which roughly translates to: “television you create.” Former major competitors and alternatives to YouTube like “Daily Motion” and “Meta Cafe” have too many syllables and their names aren’t as catchy.

As long as Alphabet (parent company of Google) is able to provide the server space for the exponentially increasing number YouTube uploads, then YouTube will remain the main video sharing website on the Internet for years to come.

Let’s get to what I want to analyze in this article. YouTube Fame. Throughout the years I’ve seen YouTubers go from no subscribers to millions of subscribers. It happened right before my eyes as I watched their measly first attempts at making a YouTube video, getting hundreds of thousands of views, keeping up the momentum of growth, and then finally reaching equilibrium where they no longer have to try as much to gain subscribers and viewers.

I reached YouTube fame at least temporarily back in 2006. Now 20,000 views isn’t a lot compared to many viral videos of today, but it was a lot back in 2006. One of the first videos I ever uploaded became viral through no planning of my own, and catapulted me to hundreds of thousands of views on YouTube. After reaching over a million cumulative views across my videos and over a thousand subscribers (back then people weren’t so hasty to click subscribe nor were there many YouTube accounts people could subscribe with), I stopped making YouTube videos and faded into obscurity. Well I’m back.

The basic premise of these stages is that it takes a lot of effort in the beginning, but later on it becomes easier.

YouTube Stages of Growth:

  1. Initial Videos
    The initial videos of a channel dictate what the rest of the content will be like. There are very few, if any, instances when a YouTuber’s early content varies vastly from their latest uploads. Again, this is just from observation and the few selected samples that I’ve looked at, I haven’t scoured every single YouTuber to see if this was the case, but most overwhelmingly it is. In every case I’ve looked at, it is the case.The initial videos usually are done in a timid fashion. This is when the YouTuber takes their first steps at making videos, they’re not quite sure how to do it yet, they’re still just testing the waters. In majority of the cases, the YouTuber looks terrible in their first few appearances compared to later appearances.Keep in mind these early videos are the foundation to what later videos will look like. The YouTube audience may approve or disapprove of them early on, if they like this content, more of it will be produced. If they don’t, the YouTuber vanishes into oblivion.
  2. Decision to create more content
    After the first few initial uploads, the YouTuber will have a breakthrough of either continuing to create more similar YouTube videos, or giving up and abandoning the entire project. Most people abandon their project after experiencing little success from their initial uploads.Some experience a small amount of initial success with their uploads, some experience a lot of success with their initial uploads. Nevertheless, most people give up after a few videos.
  3. First Viral Video
    There is a stage in every famous YouTuber’s life where one of their videos went viral causing an influx of new viewers who have never seen their content before. Every stage of content creation before their first viral moment still counts as stage 2, no matter how many hundreds of videos they’ve made before they had a viral video.Once their first viral video has been created and viewed by many, all of the YouTuber’s newer and older content will started to gain exponentially more views. At this stage, it is up to the YouTuber to continue creating content similar to their viral video so as to continue to the gravy train of YouTube viewership and subscription gains.The YouTuber will continue growing exponentially for a short period of time before the growth stabilizes again. Don’t get too excited YouTuber, the effects of this viral moment will wear off before you know it. Many viral sensations last a few days and then quickly fade away back to obscurity.
  4. Creation of more videos
    At this inflection point the YouTuber can again choose to stop creating content or choose to keep on producing content. It would be a terrible decision to give up at this point because it’s hard to get back in once you leave.Because of the growth experienced from the first viral wave, the YouTuber will receive more comments, video ratings, and views compared to prior the viral video was created, as long as the following content is similar, better yet if it’s related, to the viral video created. This is usually when the YouTuber will start replying to fans in the comments and will start to involve them more.
  5.  Continuous Growth
    Because you never lose any subscribers as a YouTuber, from this point on it’s just continuous never-ending growth, as long as the YouTuber chooses to create content. There will be stagnant periods, viral periods, and repeats of the cycle, but overall the number of viewership and subscriptions will not decrease. Most YouTubers do not make it to this stage.

The YouTube stages of growth that every YouTuber has to go through. There are no shortcuts though much like in life, some people are luckier in than others in YouTube.

What do you think about the Youtube Stages of Growth? Do you agree or disagree with the stages? Which stage are you on in your YouTube journey?


Codecademy’s Javascript Course Review

It’s been a few years since I had written any negative reviews.  I am about 87% of the way through Codecademy’sJavascript course and have learned a majority of the Javascript syntax just by taking their course alone. However, I didn’t learn a single thing about how to apply these Javascript codes to any real websites, nor did I learn anything about how to write any actual useful Javascript programs. What do I mean by that?

Let me give you an example of one of the programs they ask you to write while taking the course.


This program is supposedly the best they could come up with for a program that looks through a text and tells you if it found your name or not. If you don’t know anything about coding, and even if you do it will still probably take a while to analyze what’s going on in this code because it’s so bad, here’s what it does:

  1. It takes two inputs: any body of text and your name
  2. It keeps track of the first letter of your name and the length of your name
  3. Anytime it finds the first letter of your name, it saves that letter plus X characters after to a list. X being the total length of your name minus 1
  4. It will then return that list to you if your name was found, or return “your name wasn’t found” if it wasn’t found.

Here’s the problem with this. If you gave it these two inputs:
body of text: “Hello. My, my what a day”
Name: “Megg”

It will return [“M”, “y”, “, ” “];

and say that your name was found. The thing is, it didn’t find my name at all. It only looked for the first letter of my name, matching the capitalization, and took X characters afterwards. Lame.

Here’s my recreation of their lame program inside their own tutorial:victory-wrote-worst-code-ever

And this was the output result: my-name-perfectly-found

Wow, awesome. It was able to perfectly find my name! /sarcasm

Okay, this is me recreating a much much better program inside of a text document. Just because I was so curious at other ways this problem could be solved. better-code

There was no unnecessary nested for loops that had to be written for this, just simple one function, and it works perfectly. That’s the way you write a proper “find name within a given text” program, not in the way they gave.

Don’t get me wrong, I’m grateful that they provide this awesome service to millions who don’t know a thing about programming. But really, when you want to excite people who have never programmed before, asking them to create a broken program won’t make them excited to learn anything more.

Overall it was a great crash course for quickly learning the syntax and operations of the Javascript language, but completely terrible for learning how to code properly. This isn’t the only example of a really bad program they ask you to write, their course is riddled with them, but this one was one of the better examples of bad code they had you do, and I could not just pass up this opportunity to write about it.

Written on: 10/2/2016


Retina display hurts my eyes

This is the sole reason I haven’t touched my new Macbook Pro in over 3 months even though I spent a fortune on it and loved using it. In the beginning the Macbook Pro and I were inseparable. I loved playing around with it and experimenting on it, I bought a lot of new apps and other software for it, it was super light, had a great battery life, I loved bringing it with me everywhere and using it everywhere.

But there was a concerning issue that kept popping up the more I used it. I noticed that my vision started to decline in real time. The day before the Macbook Pro arrived, my vision was completely fine, I didn’t notice any issues, my vision was pretty much perfect with my contact lenses on and I didn’t have any complaints. I used a Dell PC laptop prior to the Macbook Pro and used it everyday without any issues. When the Macbook Pro arrived however, I started noticing my vision getting blurry each time I used it.

In fact, about a month or two after the Macbook Pro arrived, I went to get my vision checked. At the time I blamed it on a natural vision decline, but I basically had to get a new prescription for my contact lenses because yes, my vision did in fact decline, something that hasn’t happened in 3+ years.

I’m not alone in this, in fact a lot of people are experiencing similar problems:





I can really relate to Melissa’s and MacUserRA’s posts the most because we’re on similar boats. We bought a new recent Macbook Pro and were terribly disappointed because we can’t even use the damn devices without damaging our vision. I’m pretty frustrated, I already can’t see much without contacts as is, but now my vision has been further damaged due to this computer and now there’s this very expensive laptop just sitting in my room unused. What a waste.

It doesn’t matter if I plug in that same computer into an old monitor, because my eyes still feel sore afterwards. I actually used to have two expensive 27″ 1440p monitors sitting in the closet because they hurt my eyes too, I sold one of them and there’s only one left now.

This is a problem for developers because I would definitely like to develop more iOS apps, but at the cost of losing vision? Not worth it.


Your Cyprus Holiday

Today we’re going to review a Cyprus guide android app called Your Cyprus Holiday. This is an android app for those who want to vacation to Cyprus or are already vacationing at Cyprus but are not sure where to go or what to do there.


Your Cyprus Holiday splash screen

One of the first things to notice about the installation of the app is how many permissions that it required:


Whenever installing an app you have to make sure that the permissions it asks for make sense for that application. For example, the “Directly call phone numbers” permission, even though it’s a relatively strong permission, is required for their hotel and vacation booking feature, so it makes sense to be there. Looking through all these permissions, they all make sense for the application. Sometimes though apps will ask for permissions that don’t make sense to be there, so you have to be careful about those.


When you start up the app, it will ask you for the language you want to use. It comes with English, German, Cypriot, or Russian. After that it asks for when you will arrive in Cyprus. If you choose a date, it will bring you over to their booking app so you can book a reservation using their app. Hitting the “I am not sure” button skips this process which leads you to the main menu.

From here you can either view the map, book a hotel, or visit the local attractions.


Click on the image to view them in full size

Map Feature – Clicking on the map feature simply shows a bunch of colored dots on the map. You don’t know what the dots mean, there’s no legend or guide to tell you, and even when zoomed all the way in you still don’t know what the dots actually represent. They aren’t clickable so you can’t view what that location is and it took more than a minute to load the map. Overall it’s not a very useful feature at the moment, but it could be improved in later updates.

Booking feature – This app also lets you book Cyprus hotels, spas, and taxis directly from their app. However, considering the wide availability of hotel booking apps from more reputable sources, I would not recommend using this app to book a vacation to Cyprus. It’s also the first thing that the app asks you for, however I’m just not very trusting to non-reputable apps when planning a vacation could cost thousands of dollars.

By Area Attractions – This is the most useful feature of the app. You can locate nearby interesting locations close by to you and find directions on how to get there through the app. This is probably the main thing I would use the app for as it has many interesting locations and attractions you can visit, as well as a description and pictures of each one.


The app gives you the address and names of most locations, but sometimes it doesn’t give you a description of the place and just leaves it blank. That’s another reason why I wouldn’t recommend using this app for their booking feature, because if some of the more important features in the app are incomplete, you can’t trust to spend thousands of dollars on it to make reservations.

However if you do want to use this app to look for nearby attractions and locations in Cyprus that you can visit, then I would definitely recommend downloading this app. You can download the app by visiting: Your Cyprus Holiday at the Google Play Store.

Review Written on: 5/8/2014
Last updated on: 8/27/2016