KillerPHP Blog

Archives


Using a Microservice to extend the lifespan of old apps

March 10, 2016

orm-framework

If you have an old app that works, but it has some problem spots, it might make sense to use microservices to fix these issues.

Sometimes rewriting core modules or classes in an old app, is just not feasible. In these cases, using a microservice to bypass the old code is the way to go. This strategy can work wonders in breathing new life into an app, saving you the cost and headaches of writing a brand new app from scratch.

Bypassing the Apps old ORM with a much quicker ORM

As an example, we recently fixed a huge speed issue (with an old app) that was using an old slow ORM. An ORM is a layer of code, used to interact with a relational database. ORM is short for Object Relational Mapping … just in case you don’t know.

So we used the micro-service pattern (strategy,) to leverage a new faster ORM.The end result: records that took minutes to load, now loaded in 1-2 seconds!

Sometimes you have to break the nerd-rules

We had to duplicate some fields in the database (typically a big no-no,) to make this work. But by using database transactions and database triggers (to keep up the data integrity,) it made sense to break these rules in this situation.

… Besides, these were fields whose value rarely, if ever change.

We deployed Sunday night (as usual) just in case something went wrong on the live server. I am happy to report, all went well.

Stefan Mischook
Killerphp.com

read more


What are Microservices?

February 16, 2016

Hi,

A microservice is basically just a mini app that has these characteristics:

  1. They do only one thing – they are mini apps.
  2. They standalone – they are NOT part of a larger app.
  3. They are language neutral. That means you can write a microservice in Python, and have a PHP Laravel app use it.

I could write a few more paragraphs about microservices or I could just post my recent video on them:

Thanks for watching!

Stefan Mischook
Killerphp.com

read more


Building your First Web App

February 11, 2016

Learn PHP by Building Web Applications

So you’ve done a few online tutorial projects and you know you basics (HTML5, CSS3, PHP, JavaScript) but you don’t know how to do things off the top of your head … should you be worried?

Nope.

Even the most experienced developers will be referring to videos, support forums and books to keep refreshing and building their skills. Yes, once you’ve done certain things a few times (ex: setting up an MVC framework like Laravel, designing databases) you will be able to do them without any help. But I can guarantee that other aspects of the project will send you researching!

… It’s the nature of development.

Experience makes you quicker

That said, as you continue to build more and more apps, you will be doing less research and more coding. You will also be able to build apps much more quickly, and even be able to research new things much more quickly.

… That’s why most of the time, it is cheaper (in the end) to pay an experienced developer a lot more than a junior. So you noobs just starting out, don’t be offended if you are making 1/4 of the what the top nerds are getting paid – they are worth it. But in time, you will be too.

Coding in the dark

I remember back in the day when I first starting coding, many times I would be writing code that I wasn’t exactly sure how it worked. My advice: just write the code and move on.

Eventually you will have the AHA! moment, and it will all make sense. Then in a few years, you will forget the basic syntax! :)

… But no worries, the principles of the code will stay with you.

In the end, what separates the good coders from the bad: a good understanding of the basic principles and techniques.

Hope that helps,

Stefan Mischook
Killerphp.com

read more


What JS framework should you learn?

January 30, 2016

javaScript

PHP developers have to learn some JavaScript. There is no debate there, given that JS is the most important programming language in the world, and since when it comes to browser scripting, there is no other option.

JavaScript, like PHP, has several frameworks/libraries to choose from: jQuery, AngularJS, ReactJS … etc. With that in mind, I had someone put this question to me recently: “Is there JS framework you would recommend or to think about ?”

My answer:

Whatever you do, learn jQuery … although, you don’t have to learn everything about it. Just get an overview and understand the basics. jQuery is big and trying to learn everything might be a waste of time.

… It’s good to know WHAT a framework can do, so you can consider it for projects you are working on. But don’t use a framework for the sake of using it. People often think that they should be looking for a way to use a framework. No … use a framework only if you need to.

So much, and too much to learn!

The thing about learning tech skills, is that you have to learn to filter – there is so much to learn, you can never keep up. You have to pick and choose.

My advice is to first learn the basic concepts and techniques that are universal. Things like OOP, MVC design pattern (and others), separation of concerns etc … then get into more advanced programming concepts. Once you have that, you can poke around some frameworks, keep your eye on what is out there, but keep in mind that it is not possible to learn all things.

I lost 10% of my hair in the 1990’s, trying to learn too much!

Back in the 1990’s when I first cut my coding teeth, I used to drive myself bat shit crazy trying to keep up with all the ‘hot’ amazing nerd-tech hitting the Web. Most of the time, the new amazing thing wasn’t really much better than what was already there, and many a times, you would sacrifice some advantage in one library, framework or language … for another.

Again, know the basics well, learn the key libraries/frameworks so you at least know what they can do. But don’t go nuts. Personally, in the JS world, I would learn jQuery first and foremost. But not all of it.

Thanks for reading.

Stefan Mischook
Killerphp.com

read more


New Beginners PHP course is complete!

December 29, 2015

Hi,

I finally finished my brand new Beginners PHP course! It has 46 video lessons, and 121 quiz questions to reinforce the concepts and techniques taught in the videos.

This is my latest course to provide an immersive learning experience. Previews coming soon!

Thanks for reading.

Stefan Mischook
Killerphp.com

read more


Updating from PHP 5.4 to 5.5 with WHM

November 29, 2015

Hi!

We just updated from PHP 5.4 to 5.5 with WHM. It took the server about 10 minutes to compile, and it went off without any problems. Thanks be to the nerd gods!

We had a worry about a few WordPress installs (WordPress 4.3.1) and an old CodeIgniter codebase – but all went well.

Why the upgrade?

We wanted to take advantage of PHP namespaces. But as an added bonus, we noticed a nice speed boost in PHP – even our old apps are running much zippier now.

… On top of that, apparently PHP 5.5 uses 50% less memory than PHP 5.4.

So far so good.

Stef
Killerphp.com

read more


Google Chrome blocking Flash ads

September 2, 2015

Yo!

Flash was dead a few years back when Steve Jobs put the hit on it, by not allowing Flash on iOS. Then Firefox slapped Flash off the side its’ head, by blocking it. Then Facebook’s security chief ripped into Flash, calling for it to be trashed.

… But wait, there’s more!

Now Google is blocking Flash ads (at least) and that my nerd friends, means the end of Flash. It is no more, and we shall not speak of this passe, bloated, security risk again.

Ahh, how technologies come and go – a very short version of the dead-tech list:

  • Perl CGI
  • Classic ASP
  • Flash

… Is Ruby next?

:)

If you want to do ‘flashy’ things, use HTML5. It’s just better.

Stefan
Killerphp.com

read more


Why I don’t believe in Ruby – and you shouldn’t either.

September 1, 2015

Ruby once was the rising star in the server side development world. Many angry Java programmers (I suspect) jumped on the Ruby on Rails bandwagon, tired of the bloatware that Java and J2EE had become.

… I don’t blame them. Java used to be my #1 language for several years. But no more and for the same reasons.

Is Ruby dead?

Not yet, but it is slowly dying because its advantages (if there ever was,) are largely gone. PHP Laravel is at least as good as Rails.

Not enough market share

Big problem: Ruby (Rails) never really got a big enough position in the market, like Java and PHP have. Last I checked, Ruby based sites/apps are around 5% (at most!) of the market, whereas PHP has about 80%.

No must-have Ruby apps

PHP has 4 big things going for it:

  1. WordPress
  2. Joomla
  3. Drupal
  4. Facebook

… The above 4 are created with PHP. WordPress alone powers something like 25-30% of the world’s websites! Now consider that Facebook is investing heavily into PHP making it better and faster. No such heavy-hitter for Ruby and Rails last I checked.

Also, keep in mind that standard run-of-the-mill PHP, runs circles around Ruby at runtime.

The presence of the 3 biggest CMS’, along with Facebook’s backing, will insure that PHP is here for a long while. Ruby has none of the above.

Ruby is still a biatch, when it comes to getting a webapp online

Try teaching a noob how to get a Rails ‘hello world’ app online. Try teaching a noob to get a PHP ‘hello world’ app online. PHP = upload php page. Done.

Ruby: install gems, read 5 pages, watch incomprehensible videos by nerds who couldn’t teach Hawking ‘hello world’. Good luck with that barrier to entry. PHP is just too damned easy to go live with relative to Ruby and Rails.

Ruby is no longer cool – it’s JavaScript these days

The only thing holding Ruby together was a hipster coder community of twenty-something year old nerds who are now thirty-something nerds. Meanwhile most of the young nerdlings are going gaga for JavaScript and Node.js. What will Ruby do without the hipster mojo? It will slowly fade.

What’s a young nerd to learn?

Well, from a guy who’s been coding since the 1990’s, from a guys who’s built apps in 8-9 languages over the years, from a guy who has built apps for publically traded companies and every other sized business, these days you ought to learn PHP and JavaScript.

…They rule supreme now, and will for the foreseeable future.

Stefan Mischook
killerphp.com

read more