What’s your function?
The last few months I’ve been wanting to expand my data and skill set by learning something new. I’ve long been a fan of content creators and have frankly been somewhat in awe of their abilities. Content creators take an idea, be it their own idea or a concept from someone else, and turn it into something interactive and make it seem almost tangible. To me the act of creating or producing something from your own mind is a very powerful skill.
Programming or coding as it is commonly called, is a skill which I’ve never had a really good handle on. Sure I can do ksh/csh/bash scripting on the UNIX/Linux platform but shell scripting is very limited in scope and abilities, used primarily for automating administrative tasks on a specific server or set of servers. I want to go beyond that and be able to build something almost universally accessible and appropriately interactive.
I asked my present employer if they might subsidize my training in this new skill but was turned down with the logic of “we aren’t programmers.”, regardless of how valuable that skill would be to my team.
Never one to take “no” for an answer, I started looking into other alternatives and found Code Academy.
In the code at line 3, I declare a variable called sleepCheck which is a function expecting 1 parameter called numHours. At line 4 I write the value of the parameter to the console so I can verify it’s the right number. Line 5 starts an if/then comparison which checks the parameter to see if it is greater than or equal to 8. If the comparison is true, line 6 returns the statement. If the comparison is false, line 7 returns the other statement. Finally on line 11, I call the function sleepCheck and give it a parameter of 10. When the script runs, it will return the statement at line 6.
This has made me very happy today. :) I really do love to learn new things, and I want to say “Thank you!” so very much to the folks at Code Academy for making this available, easy, and free.