Archive for the ‘Programming’ Category

Skills, degrees, or product?

Monday, April 29th, 2019

In the recent explosion of technology and all the varying degrees of “skills” that result from it. I feel a little overwhelmed. I am from a time where tech was essentially Apache, HTML, Javascript, CSS, and some sort of language that supports dynamic generation of HTML aka, DHTML. Then with every language there’s it’s evolving syntax, AND the various frameworks and their ever evolving practices.

Now? For javascript, you have your Grunt, Gulp, NodeJS, jQuery, VueHS, ExtJS, Angular, React, and the list goes on. For your CSS, you have your SASS / LESS, and browsers and varying versions of browsers to support. For your hosting, you have Kubernetes, AmazonMesos, DockerSwarm, Docker, VMs, Baremetal hostings, various hosting providers, and so and so on.

The following article really conveys the explosion of tech really well:


//hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f

In addition to everything, you have the Machine Learning field introducing it’s own thing or two as well, where hiring anyone with less than a Ph.D doesn’t seem too credible or meaningful.

I feel paralyzed by the sheer degree of stuff I “have” to learn. I see myself looking at wide lecture hall’s triple-column double-row chalkboard of tech thinking that these are the skills I have to know to be an effective programmer now and days, but is it?

I don’t think so. It seems that in the torrent of tech terms being thrown at me, and the various fear of being labeled as dinosaur, or a person who’s opposed to change, a fear of obsolescence, the fear of being all those “has beens” I’ve seen. Being caught up in this tech wave, I forgot something VERY important to me, which was WHY I do the things I do in the first place.

Did I sign up to learn and master EVERY tech out there? No. Did I sign up to be a programmer as a profession? No. What did I sign up for? To do what I love, and if I happen to be paid for it, great! Do I need EVERY tech out there to do it? No! No I don’t. Are some of the new tech out there applicable? Yes, I think so, but not all.

I think it’s important to be opened to the idea of new ways of doing things, so if there is a new tech / method that allows YOU to do things better and more efficient, you can. At the same time, realize that even if your methods aren’t the “latest and greatest” they are STILL capable of doing things. My focus is shifting away from the latest and greatest, and back to my original way of doing things, which is to use the proper tool for the proper task, and adopt tech only as necessary, and just have fun. Adopt tools that help with my goal of creating that cool thing I wanted to create, but stay away from that next shiny thing that everyone is raging about. Make it work first, optimize it later.

Do I need to use a machine learning model to write a web portal automatically? Probably not. Do I need to add webpack to my static HTML one pager? Probably not.

A long time ago, I talked about various methods introducing their own overhead, and how I coded faster as a new programmer than a senior programmer thanks to adherence to all the “latest and greatest”. I’ve forgotten about that, and I think, it’s time for me to get back to that, at least for my hobby projects.

Perfection Paralysis

Tuesday, February 5th, 2019

I’ve spent more than a decade in professional software development. I’ve seen and fought this demon time and time again. The demon’s name is Perfection Paralysis.

It’s quite the beast. When you have so many eyes reviewing and critiquing your code, you want to be the best you can possibly be. You want your code to be representative of all that you’re capable of, because that’s what you’re judged by.

I think this is why I find writing my own hobby code so relaxing. No code reviews, no tech designs, no architecture reviews, and planning meetings and etc. I simply let the thoughts flow from my mind to my fingers; code happens, the world is changed.

I warn of the dangers of perfection paralysis because there is no single solution to solving a problem, there’s in fact, probably an infinite ways to solve it. No matter which way you go, there is always room for criticism and improvement. You can make it faster, you can make it neater, you can make it more extensible, you can make it more testable, and the list goes on.

I think one factor that a lot of developers don’t take into account, is how much more work they’re subjecting themselves and possibly their organization to.

Your code looks great, but did you do Doc Block commenting? Your code works, but is it type strict? Your tests passes, but does it handle mutation testing well? You have test coverage, but is it 100% test coverage, or partial coverage? Your test passes 100%, but does it pass for all device, or just a single device? Your application works now, but will it work once the load increases by a hundred folds? So on… and so on…

I find myself in this situation ALL the time, both in the professional environment and the non-professional environment. Great, this JS code works, but should I have done it in React? Great, it works in React, but should I have incorporated Flux/Redux? I finished it in native PHP, but should I have used the Laravel Framework? I did it in Laravel, but maybe I should have done this in GoLang? Great, I’ve coded it in GoLang, but maybe I should have coded it with Gorilla? The data persistent layer is in MySQL, but maybe I should have used DynamoDB? The list goes on and on and on, it will NEVER stop, because there’s simply no stop case, this is simply the nature of our work, there will never be a best, because the best is yet to come.

I think remembering the BIG picture helps me maintain my sanity. Reminding myself of the objective allows me to focus on running past the finish line instead of being crippled by anxiety at the starting line. In the end, code is code. It’s simply a series of instructions to a computer, a persistent mechanism, and presentation mechanism. No matter how we’ve changed things, those things stay the same. In the end, no matter how you code it, if it fulfills the objective, it’s working code.

I think a concept that a lot of developers forget in the software development life cycle, is that code becomes obsolete. In this RAPIDLY changing world, should be optimize for 10 years? 5 years? 3? 2? 1? 6 months? That’s a tough question, but let me answer it with another one. If you wrote optimal code using ES 5, is it still optimal under ES 6? If it was optimal ES 6 code, is it still optimal ES 7 code? If you coded it using React, could material UI have done a better job? If you used jQuery, and now you have all these built-in selectors to javascript, is it still the optimal approach?

I urge myself, and other developers to optimize for the situation as it stands, in their own life, in their environment, and future proof it to a reasonable extent. Architect it for the current and PLANNED next steps, but I wouldn’t optimize it any further than that.

Advance the code and project in an interactive, self-rewarding manner, rather than a giant hunk perfection that is either ALL or NOTHING, a long ways into the future from now. When you have 1 or 0, the expected value is 0.5, but if you allow yourself to build everything in an incremental manner, it’ll be much less stressful, and you’ll have more fun.

So for myself, or anyone else reading this… “It’s okay, it’ll be fine, even if there might be a better way, just do it the best way for the current circumstances, when the circumstances change, much like the Monty Hall paradox, we can pivot then”.

Enable Infinite Homepage Scrolling on Note 4 (rooted Android 6.0)

Monday, May 1st, 2017

So! My loyalty to the Note 4 at this point is borderline fanatical. Samsung has YET to make a better phone, in fact, neither has Apple. I’ve recently bought a Verizon Note 4 to replace my T-mobile Note 4, since Verizon allows me to use both T-mobile and Verizon, but the T-mobile version wouldn’t work on the Verizon network. If I’m going to replace that phone that’s been acting up, I might as well replace it with a better one.

After a ton of pain, I’ve managed to figure out exactly which ROM, I should install, what’s working in what version of the ROM and so on… Eventually, I just went with a nearly stock ROM that’s simply rooted.

Everything looked normal an kosher, until I’ve noticed that the homepage doesn’t do infinite scrolls. I’ve found a lot of instructions online, but it no longer really covers the file structure of Android 6.0.

I’ve decided to write a post, and if it happens to help someone out there, then awesome.

-Open up your file manager, in this case it’s Root Explorer
-Go to /system/csc/others.xml (hold down on others.xml and open in text editor)
-Scroll down to the end (on my phone, the line we are looking for was the third or fourth from the bottom)
-Find the line that looks like this:

<Cscfeature_Launcher_DisabledPageRotation>true</

-Change “true” to “false” (without quotes). It should now read:

<Cscfeature_Launcher_DisabledPageRotation>false</


Citing my sources, but saved it for last, since I didn’t want to force my readers to read through things they didn’t want to:

The solution is actually an interpreted combination of:

How to Enable Hidden CSC Features on Samsung Galaxy Devices with Root Access

and

//forum.xda-developers.com/showthread.php?t=2311335

 

Useful command to test speed of a container, vm, or system

Monday, March 6th, 2017

I’ll be breaking down the following command part by part:

time dd if=/dev/zero of=test.dat bs=1024 count=100000

 

What does time do? It runs a process and then captures how long it took to execute.

What about DD? Well, it’s a command that copies data from a standard input to a standard output.

What about the params if, of, bs, and count?

“if”: It’s decently obvious, but “if” specifies the input, in this case we’re taking input from a special file that provides as many null characters as there are read from it; an infinity file of sorts.

“of”: It’s the output file.

“bs”: Byte size

“count”: the number of blocks

So all together, the command writes 100,000 blocks of 1,024 bytes of binary zeroes into the file of “test.dat”. In other words, generates a 100 MB file. This command allows you to generate a 100 MB file and test the  IO performance of a system. As we move towards a world we’re optimizing the crap out of everything, this is a very useful command to know.

Amazon S3 Outage

Tuesday, February 28th, 2017

Today’s post is regarding //techcrunch.com/2017/02/28/amazon-aws-s3-outage-is-breaking-things-for-a-lot-of-websites-and-apps/

These type of occurrences are becoming more and more common. Tons of company has placed a ton of faith into the Amazon ecosystem, and time and time again, it looks like Amazon has let them down. When these things broke, it broke at a MASSIVE scale (AWS outage knocks Amazon, Netflix, Tinder and IMDb in MEGA data collapse, //www.theregister.co.uk/2015/09/20/aws_database_outage/ )

//research.omicsgroup.org/index.php/Amazon_Web_Services

There were other outages in 2012, 2013, and probably more unlisted. I think it’s an interesting challenge that Amazon is tackling, and I feel like more and more of the web is putting all of their eggs into one giant basket.

I wonder, if we were to build a truly scalable, and unlikely to be impacted system, maybe it might make sense to diversify the system’s infrastructure to utilize multiple services. Maybe some redundancy at the DNS layer, then some more at the LB, some more at how things are replicated, localized and so on… Just something to reflect on due today’s outage, “How can I prevent my organization from being impacted by this?”

How I cleaned more than 8,000 thousand emails from my mail box

Thursday, January 5th, 2017

Long long time ago, briefly after the birth of gmail, I created an email account, and mail was good. Fast forward to now, holy spams. Years and more than a decade of neglect, I’ve managed to amass more than 11,000 emails, and this is post spam filter. I guess over the years, I must’ve signed up for every single notification and newsletter out there. Each them I delete an email, and unsubscribe from a list, another newsletter shows up, and I’d think that I must’ve unsubscribed already, but I’m not too sure anymore. All I knew was that my inbox was looking like this:

I’d stare at that number every day, thinking “Someday, I’ll clean it, but today is not to the day…”

The idea of going through my mail one by one, and then checking to see if the sender was a bulk sender or not, and then unsubscribing from it, just seems like such a time consuming task. Then I start noticing that in the midst of the spam, here and there, there were some important emails I’m starting to miss. That was the spark that lit my fire to put an end to this spam once and for all.

Using my computer programming powers, I created a program to go through my mail, and build a list of senders I receive emails from, and the amount of emails I have from them:

thousands upon thousands of emails later

I’ve built a list of emails and their frequencies, and life was good, but I knew I can do better.

I took it a step further, and built another list based on the domain of the sender.

Utilizing these two newly crafted weapons in my arsenal, I blew away thousands upon thousands of emails, some of which were spam, some of which were transaction emails that no longer have any importance. Once the non-important emails have been unsubscribed from and removed, it was so much easier to deal and organize my old emails. Once that noise was removed, it was so much easier to deal with my new emails. Now, my emails look like this

And life… was good.

PHP Pop Quiz

Friday, May 29th, 2015

I took the PHP Pop Quiz on w3school’s today: //www.w3schools.com/quiztest/quiztest.asp?qtest=PHP

Guess what I got?

php

This relatively old technological dinosaur still has it!

The Fall of PEAR and the rise of COMPOSER

Saturday, October 4th, 2014

I’ve been out of the loop for a while, and more and more I keep hearing about “composer”. I appears that composer is the new PEAR, so I guess it’s time to get with the program.

//fabien.potencier.org/article/72/the-rise-of-composer-and-the-fall-of-pear

PHP Framework Plugin Evaluation

Friday, October 3rd, 2014

Which one is the BEST framework? Well! There are many ways to benchmarking a framework, speed, adoption, usability and so on. Today, I want to examine the plugin community for these frameworks.

I’ve pulled a list from //hybridauth.sourceforge.net/plugins.html and //github.com/opauth/opauth/wiki and I plan to review frameworks that are on both URLs, the reason being, is that I don’t believe it makes sense to code authentication systems anymore. It’s been done a trillion times before, why are we reinventing the wheel? If the framework isn’t listed on these two URLs, I’ll prematurely conclude that the community isn’t active enough to put them on the map.

The frameworks that show up on both URLs is as follows:

  • CakePHP
  • CodeIgniter
  • Laravel
  • Symfony
  • Yii
  • Zend

Here are the URLs I’m using to compare the plugin / extension libraries of each framework:

Not meant to draw any real conclusions, but it does give an idea of how active the community is, and sheer amount pre-coded stuff out there. I’ve basically went through each site, and scrapped the urls, the followed the urls and parsed the resulting HTML for the date which the extension was updated. I haven’t prod any further than that, although at this point, I am hopeful that if I was on either the Symfony or the Laravel platform, I can look forward to a lot of pre-written code.

Hybris vs Magento

Friday, September 26th, 2014

“We’re on Magento, but we need to upgrade to Hybris!”

“Nothing is true, everything is permitted

I went to magento.com and hybris.com and I took a look at two companies, and then did a benchmark on the two companies. Which of the following do you think is the “better” version?

bloom Oakley

 

The slower loading one is actually Hybris. The faster one is Magento. People are often quick to dismiss languages, technologies, and softwares. I say nay! Try to figure out things first before you throw all those “extra screws”. It’s important to do a cost-benefit analysis on MANY fronts.

Don’t buy into hype. Too much of this world is built upon inefficiencies. Do understand that often times, interests conflict, what is in your best interest isn’t in their best interest.

Hybris is built in JAVA, JAVA has many pros, but one of the cons is that developers are hard to find, and it’s not exactly the fastest to code on either. Magento is built on PHP, many cons, but one of the pros is PHP developers are plentiful and projects can be built quickly and often times, very cost-effective.

Just understand that the more complex and inaccessible your environment, the harder it is to scale it. You’ll run into issues into many forms of scaling issues, whether it’s code, load, or human-capital. Switch to a solution only after carefully assessing the pros and cons of it, this choice MUST be made extremely carefully because the impact of this decision is extremely far reaching. Also understand that simply because certain things are “best practices” doesn’t necessarily mean that it’s the “best practice” for your company and situation.