I didn’t like how heavy Java seemed and that I had built a lightweight GUI (thick app) although it was a good experience. Who distributes apps like that anymore? If I’m really going to pursue this, I needed to learn web programming. All of my questions around RESTful APIs, Python, and building web apps brought the relationship with my tutor to an end, but he told me about a friend of his that knew some “web programming.”
We’ve all heard of the LAMP stack, so I thought, let me learn that. Turned out his friend, my new tutor all of a sudden, knew this “stack.” I followed some instructions got the stack up and installed Sublime (his recommendation) to get it going. Sublime 2 is the text editor that I used for the whole project. I’m sure there is a real IDE that I could have used, but I wanted to challenge myself. A lost semi-colon had me troubleshooting for hours. With an IDE, I imagine I’d have seen an error like in Eclipse, but it just made me be more careful, which I hope is better in the long run. We met the first time for about 2 hours. We talked about things like HTML/CSS (a lot of that), JavaScript, and of course PHP (a key component of the LAMP stack). All of this talk around HTML/CSS turned me off at first because I just wanted to program! However, it gave me a greater appreciation for all these 3 and 4 letter acronyms that I had always seen in the world of programming. He later told me about “Twitter bootstrap” which is pretty cool and saved me a ton of time formatting down the road. It’s a twitter-made CSS file that simplifies the formatting. Going into this first session, I knew I couldn’t just learn for the sake of learning though, so I found a need at work and had a goal in mind.
My plan was to replace an excel file that gets emailed around almost daily by people who need to calculate budgets of sorts. It included lots of inputs, but then some complex calculations are calculated on the data input. Having a project at hand helped tremendously. I now had a goal. After my first 20-30 hours working, I realized I still had not even touched PHP though and that’s what my goal was. I got so engrained with formatting forms, fields, text boxes, drop down menus, radio buttons, and working with twitter bootstrap, I was designing the user interface, but forgot about the actual code (and business requirement I gave myself). A sexy UI does help sell though. Another good lesson – if you design your application upfront and know all the inputs you are going to have, you can easily start the application programming part before you see the front-end presentation layer. Easier said than done I’m sure, but now I know why there are dedicated jobs for each of these. That said, after I was pretty happy with the layout, I started with PHP. I was able to build multiple PHP files and 15-20 functions to try and modularize it as much as possible (over a period of weeks). I think it was around 2500 lines of code. Was I finished?
What about all the data that was input? I had no intention on learning the “M” in LAMP, but I had to if this was going to replace an excel file. Excels are static, it’s a database in itself and you can always go back and open it. There needed to be a way to save the input data and/or calculations if this was really going to work. One or two hours with my tutor on MySQL gave me the jolt to plug about 40 more hours into database work. I used phpMyAdmin for almost everything so I didn’t do much with the MySQL CLI to be honest, but again, it gave me an appreciation for this stuff. Months later when I went to OpenStack training and there was references for MySQL for all of the projects’ local databases, it made much more sense and I’m sure I’ll have some of the know how to check those databases out (or add my own tables, etc.) when I dive deeper into OpenStack.
On a side note, there was a short period of time, I almost added JavaScript to the mix to validate and at the very least require some inputs be filled in before the form be submitted, but that didn’t happen. First, this brought clarity to client-side vs. server-side languages. Second, in that research, I learned that HTML5 has new functionality added where you can just say “required” in the HTML code to enforce a field be filled out! Not as fancy as JavaScript, but kept me from a learning another language for this project and spreading myself too thin.
The project went as far as I wanted to take it. I was able to store lots of data in the database and retrieve data back accordingly. I went as far as integrating with AWS’s hosted database offering called Relational Database Services (RDS). That was pretty cool actually because we know the Cloud rules. All in all, it was about 140-150 hours of work. That was a new skill and new language. In a new language/framework today, that should take less time, much less time.
I heard great things about Ruby on Rails, and going back to OpenStack, I remembered they are using a framework based on Django/Python. This reminded me about Python and I had really wanted to learn Python since it gets a lot of attention for REST API integration and scripting within Linux. I also want to be able to understand in more detail the OpenStack Horizon project just in case I want to customize anything there, if ever needed, so this is what I said I was going to learn. I watched some of Google’s free Python classes online, ran threw a few exercises, and was on my way. My plan was Python for a few weeks and then Django integration, so I thought. A few weeks later…
For a while, I was on the fence on learning Cisco’s onePK. It’s going to be a southbound protocol and I don’t need to learn it. If I program anything in this new world of SDN and open APIs/SDKs, I want it to be exposed via a RESTful API via a controller, even if it’s just to communicate with one network node. That was my thought process. While I do agree learning the southbound side natively will make for a better foundation for the REST side, I just didn’t want to do it because the only libraries I could use right now with regards to onePK are for C and JAVA. And I did not want to program any more in JAVA due to not being able to easily “web-enable” those applications that I’d be writing in Java.
After much debate internally (in my head) and with some other folks, I was holding my ground until a patient engineer at Cisco said, well you can easily web-enable Java apps. I heard him out and I learned about a new web frame work. Why are there are so many damn frame works? Anyway, I learned about the Grails framework. Grails leverages Groovy and native Java. Groovy is a Python-like language (very loosey goosey), but leverages standard java libraries, etc. and can also integrate with pre-existing java classes and .java files. I saw a demo of this and was sold. Web programming and onePK --- hopefully killing two birds with one stone. The IDE for this that I’m using is called Groovy/Grails Tools Suite (GGTS). I’m actually just starting down this path as you read this, so much to learn with the Groovy framework! Really hoping the documentation out there is as good as what’s out there for PHP and Python.
I’m sure if I can ever program with Python onePK libraries, the Django/Py framework may be back in the picture, but I guess we’ll have to wait and see. I may in dabble in Python anyway if time permits. Not sure yet – it’s all about having time and having the right project or kick in the ass to get you going.
Well, that’s where I’m at. As I go down each path, I continue to learn more about general programming principles and at the end of the day, that’s the most important. Why? For continuous learning and to prepare for what may come in the future.
The syntax for each is definitely different, but high level concepts are the same. My recommendations would be pick one language/framework in the beginning, go deep, and really understand the in’s and the out’s. Jumping around like I am doesn’t make the most sense for most, but it does give a broader look at larger ecosystem, which is extremely beneficial as well. The bottom line is do something and it in all likelihood will end up being a win/win for you.
When you look at technologies like PHP, MySQL, Django, Python, Rails, Ruby, Java, C, Groovy, Grails, etc. it’s confusing and a year ago, I didn’t even know where and how they were used. I still definitely don’t have all of the answers, but I know much more now than I did before I started, and that’s a step in the right direction. That said, it’s hard getting some basic answers, so if you’re a network engineer going down a similar path, feel free to reach out and I’ll do what I can to help.
Check out an update on my progress here (10/7/13):
Network Control Manager - onePK in Action
Thanks,
Jason
Twitter: @jedelman8