How to Hide Your JavaScript Source Code (Don’t!)

Just don’t. If you are trying to focus on hiding your trade secret sauce that you’ve written into your new single-page JavaScript application you’re just wasting your time. If you’ve coded the entire framework and all your libraries by hand then no one will be able to understand your code enough to steal pieces, they will do an entire copy of your website. The odds are however that you’ve leaned on some existing libraries, that more of the code in your final product was written by someone else entirely. That’s completely okay! For years now as developers we’ve stood on the shoulders of giants to create our finished work. Great libraries like jQuery, frameworks like AngularJS, layout frameworks like Bootstrap all give us a great and well tested path of least resistance to launch.

The idea that you’re able to protect your code through minification or obfuscation isn’t new. ActionScript decompilers started coming out much to the dismay of Flash developers and shortly after that the ActionScript obfuscators hit the market. Minification is the process of removing all extra spacing and lines from a file or set of files for the reason of saving space. Obfuscation is the process of making your code illegible, even going so far as to encode strings that are later decoded. Obfuscation can lead to introducing hard to debug issues, and only protects your strings from a first glance as it is simple enough to unencode the entire document and retrieve said strings.

It’s the strings that can allow anyone to see in your code what your trade secret sauce is. What combination of libraries you used in a project help make it unique, but the interconnecting code that brings them together is what make it a product. Each library has a certain set of strings in them that act as markers, version numbers, unique variable names that will allow those libraries to be identified even in a minified state. You can’t hide the recipe for your JavaScript application. So stop trying! There are also restrictions on certain libraries that ask for attribution, or that they remain as part of open source projects.

View source is the spirit of the web, being able to look at how the documents and applications are structure is part of how the World Wide Web became so popular. That low barrier to curiosity where you could simply inspect the client side code being delivered to you allowed for a generation of tinkerers to be born. Those same tinkerers went on to build the libraries that you have now brought together to make your application. Don’t focus on hiding what you’ve created. Focus on making the best product possible and be proud of the libraries and frameworks you’ve used to create your product. Without a herculean effort, no one will be able to discern a gem of code that you’ve wrote, pull it out and then profit off it. Stop worrying and get back to making sweet JavaScript applications.

Knowledge Alone is Not Enough to Succeed

I’ve been reading technical texts for years; ever since I saw dinosaurs come to life in Jurassic Park. I went to the library and started reading all the books on genetics a middle school library might have. I didn’t then and still don’t really know what I was reading, but I just kept reading for a while until my interest waned. Somewhere along the line I got the idea that this was how to be successful:

  1. Read non-fiction books
  2. Learn “useful” knowledge
  3. ???
  4. Profit!

I continued this trend when I first began my interest in computers. I tried staying away from books that covered a product (FrontPage!) since they moved so fast. I read several books talking about compilers, but I never got anywhere. I couldn’t find that piece to take the text in the book and run it on my family Windows computer. I was stuck programming on my calculator which taught me a lot of basics. None stop reading, I kept reading technical books and haven’t stopped for years. I just finished getting an MCSD that took four books. I’m so tired of working like this though, there has got to be a better way of making it in life. In my quest to master one thing I’ve become a polyglot programmer, never feeling certain if the path I’m on is the one that will lead me to the financial success I seek.

That’s what it ultimately comes down too, what technology can one become invested in that will take them to financial freedom they desire. Work for yourself, or at least remotely the majority of the time. Own a nice McMansion home you can decorate during holidays that has a two car garage in a neighborhood you can feel safe in and that has great internet speeds. I’ve found out the answer; there is no right choice.

I jumped ship on Flash development a few years back but even with that I could have continued and move into Flex and Air, both are still being used in enterprise development. That leaves me with trying to make educated guesses about which technology will enable me to reach my goal faster. Technology is wonderful and a kind of hell in that way. You can get work and complete a task in a myriad of ways. Too many choices can lead to over analysis and a paralyzing feeling that I’m making the wrong choice. There it is again, the fear that I’m making the wrong choice to get to my end goal.

There is no right choice, no one technology that will open a door that wouldn’t have opened otherwise. So long as you have your nose in a book and your head down learning you’ll never take enough action, you’ll never see the door open when it finally does. It’s not enough to learn something without acting upon it. So here’s to action over planning, to decisions over analysis in the new year. No one will see all the knowledge you’ve got and point you to that open door. Don’t wait, write, program, start something, because just knowing how to run a program won’t get you anywhere.

My Experience Earning a MCSD for Windows Store Apps Using C#

This summer I had been having fun working on a Windows 8 RT C# application. I decided to take the momentum of learning a new language and platform and apply that to getting certified. To earn a Microsoft Certified Solutions Develop for Windows Store Apps Using C# you need to pass three tests of increasing specialization, 70-483, 70-484, and 70-485.

Exam 70-483: Programming in C#

microsoft-specialistThe first of three exams was 70-483 on programming in C# which I felt pretty good about already. A few other developers had written a few Microsoft 70-483 exam preparation guides and more than one suggestion to read Pro C# 5.0 and the .NET 4.5 Framework which was a intimidating tome to start with. This was easily the most difficult test to prepare for because C# is an enormous language when you start looking under the covers and getting into the details. After reading the book cover to cover and going back through a few times I felt pretty confident about passing the test. Needless to say I was really disappointed to fail it the first time out. They don’t leave you blind and told me the general areas I needed to brush up on. I spent another two weeks going back over everything an hour or two each night before psyching myself up to take another stab at the exam. It was quite a relief to pass the first of three exams. I didn’t realize it before taking the test but passing also gave me my first certification step. In three months of work over the summer I became a Microsoft Specialist in Programming using C# complete with a logo I can use.

Exam 70-484: Essentials of Developing Windows Store Apps Using C#

I took a well deserved break for a week before starting my studies for the next exam, 70-484 on the Essentials of Developing Windows Store Apps Using C#. Here it started to get a lot more interesting as this is what I had already been working on for the last few months. It was at this time I found the Microsoft Virtual Academy and my study methods changed drastically. I did continue reading on the bus and picked up Exam Ref 70-484: Essentials of Developing Windows Store Apps Using C#, but I also started watching Jerry Nixon and Daren May present the video training Windows Store App Development Essentials with C#. As an aside, the MVA is an incredible resource, and I really enjoyed watching and learning from both Jerry and Daren over many hours of video. After finishing up both the book and video I went on to pass this exam on my first try. The sum of knowledge I was building up was obviously cumulative. Understanding what to expect, the exam conditions, familiarity with the facility I think all helped to make this happen in just a couple of months.

Exam 70-485: Advanced Windows Store App Development Using C#

MCSD_2013(rgb)_1484

Feeling like I was on a roll at this point I dove right in to prepare for the final test, 70-485 on Advanced Windows Store App Development Using C#. I started reading on the recommended book Exam Ref 70-485: Advanced Windows Store App Development Using C# and MVA video training Advanced Windows Store App Development Using C# immediately. There was a sense of urgency at this point because the reading material and videos (at the time I was watching them) were about to be out of date! Microsoft was updating the series for the new Windows 8.1 release and additional features. Before I was done with any of the study material I signed myself up for a November 30th test date. It was going to be all or nothing because if I didn’t pass then it would set me back another month to go over new material. I spent all my free time studying to cram it all in before the test and my effort was well rewarded. I passed that morning, and I was elated that I had completed my personal challenge to become a Microsoft Certified Solutions Developer. I’m excited to share with you my new certification logo as well, so shiny.

MCSD and the Future

No certification process covers every piece of possible material, and I am not coming out the other side of this experience knowing all the answers in Windows Store app development. I would do the process again for sure, and I’m probably going to get re-certified in two years. This was a long standing dream of mine that I was able to seize this year and I’m now I’ve got to make my next step. Thanks MVA, Daren May, and Jerry Nixon for putting together the videos and my wife for giving up so much free time.