How important is the choice of programming language – in app creation?

April 14th, 2014

Hi,

I am a big advocate of PHP but you have to ask yourself, how important is the choice of programming language, given so many great apps are created with many different languages? Think about it:

  • Twitter – created with Ruby
  • Facebook – created with PHP
  • LinkedIn – created with Java

I get deeper into this topic in this video blog:

Thanks,

Stefan Mischook
killerPHP.com

Should you use JQuery less and do more raw Javascript?

April 13th, 2014

Yo!

Not strictly PHP … actually, this is not PHP at all! But it is still relevant to any active PHP coders because you will need to use JavaScript with PHP – that is almost a certainty.

Someone put this question to me recently:

What’s your opinion on using pure JavaScript over that of Jquery and other libraries, do you think having a strong understanding of pure JavaScript is vital when using Jquery and other libraries?

My Personal opinion is that you should use pure JavaScript regularly because more likely then not you are going to be doing either edits to Jquery or making custom Jquery plugins. I ask this because i feel we are becoming dependent on Jquery and missing the point that it is just JavaScript at its core. 

My answer:

That’s a great question! My instinct is to say we need to know mechanics of things and so it makes sense to not rely too heavily on JQuery. But the reality is different!

You see, just about every language and framework we use today, builds upon some lower level base that most of us are not even aware of. So for instance, Ruby and PHP are written in C, so shouldn’t we go down to C and learn that? No!

Back to JavaScript; you need to know basic JavaScript and how to manipulate the DOM without JQuery. But in day-to-day coding work, you SHOULD use JQuery and other libraries because they’ve been debugged and handle a bunch of boilerplate tasks … things that you should not have to deal with.

If by chance you see a need to create a JQuery plugin or you need to do some highly custom JavaScript … then go deeper into then. For now though, you have too many things on your plate to worry it!

Stef

I am not sure if I should be quoting myself?

;)

Stefan Mischook
killerPHP.com

CodeIgniter Creators are out, should you be too?

April 13th, 2014

Hi,

Someone asked me recently if I though the CodeIgniter core libraries would still be supported given that the creators of CodeIgniter have officially dropped it. I could write about it, but a quick vblog is easier … here you go:

Thanks,

Stefan Mischook
killerPHP.com

Why you should NEVER use inheritence in your PHP OOP Code!

April 9th, 2014

franken-software
Hi!

First all of, I have to say that I love this guy on the right!!

:)

Anyone who knows object oriented programming is probably having kittens now! How can a nerd like Stef be dissing one of the fundamental tools in our OOP toolbox? Isn’t inheritance one of the key tools that makes code reuse possible?

Well, only in the case of foundation code. Very few of use write that kind code. Most of us are writing business objects and business objects should be using interfaces and object composition.

What is foundation code?

Think the core of web servers, the core engines in database servers. All the stuff that is pretty much written.

Share object code as complete objects, leave the code alone!

Code Reuse doesn’t come so much from reusing code found in one class and using inheritance to bring it into another. No, it’s more about reusing objects across projects and reusing COMPLETE objects within the same project.

Composition over Inheritance

Favor combining objects (this is called composition) rather than creating new objects that inherent functionality from parent classes. Why?

Because inheritance creates fragile dependencies – if some nerd comes a long and decides to rewrite some of your base classes – you will be screwed! I’ve seen it firsthand. It’s not a pretty site: nerds screaming and yelling, app functionality breaking in 10 different places … nerds throwing wussy punches with the intent to do damage.

.. But since they are nerds, no one really gets hurt.

With composition, your objects are loosely bound. That means it’s easy to swap objects in an out of your code base, since your objects are not dependent on the INTERNALS of another object – something you get (unfortunately) with inheritance.

Keep your objects small, highly focused and dumb.

Objects should have very specific task and they should be dumb to what’s going on around them.

Objects should take in an input and spit out a generic output. You don’t want the behavior of your objects to be easily influenced by outside forces. If you want to modify what an object does for you, just grab the output from said object and modify the OUTPUT with another objects methods.

… Keeps the objects dumb I says!

Stefan Mischook
killerPHP.com

Creating a PHP Survey Form

April 4th, 2014

Learn PHP by Building Web Applications

Hi,

We recently had a question on the PHP forums where a guy was trying to create a PHP survey form and though he had bought the Complete Web Programmer package, he did not know which way to go.

All he had to do was do the video course: “PHP and Javascript Form Validation”. Whether you are doing a survey form or a contact form (as we cover in the above course) … it doesn’t matter because it is all the same at the basic level.

The conversation in the forum (PHP forms) fills in more details.

Thanks,

Stefan Mischook
killerPHP.com

PHP Discussion with Stefan Mischook

March 31st, 2014

microphone-podcast-icon

Hi!

I did a guest podcast for DCRadio about a month ago on PHP, programming languages and choosing a PHP framework. I think David summarised it well:

For anyone reading this, scratching your head wondering which language or framework to use… this is a good discussion on the factors that you should consider…

If the audio player doesn’t show up, here is the direct link:

Podcast: (31:02 min) PHP Frameworks in 2014

The length of this podcast demonstrates my ability to speak non-stop, for extended periods of time. Something that is painfully clear to the ears of those around me.

Thanks!

Stefan Mischook
killerphp.com

KillerSites University vs. StudioWeb.

March 23rd, 2014

studioweb logo
Yo!

I recently got an email from a single mom asking two questions:

  1. Should I take StudioWeb or KillerSites University?
  2. Making money with PHP.

My response:

Hi Samatha,

You asked:

“… StudioWeb vs. KillerSites University?”

KillerSites University was/is basically StudioWeb in an earlier form … that means you want to go with Studioweb. In fact, KillerSites University is pretty much shut down; I just kept it up for old subscribers.

… Studioweb is now being used by public schools, community colleges and tutoring centers – the courses and the Studioweb system are much more refined vs. KillerSites University. Makes for a much better learning experience.

Why did we change the name from KillerSites University to Studioweb?

We actually changed the name, because school boards did not like the word ‘killer’ in software they were using at the school.

Fortunatly, I was lucky enough to have kept studioweb.com – I created this domain in 1998 for my web design studio.

… Time flies!!

PHP and making money:

Yep! Not only will you be able to raise your price, you will find many, many more jobs open to you.

Studioweb’s cost:

It cost me a small fortune (!) to build and refine Studioweb over the last two years – but it will cost you practically nothing to use it!

We kept the price low – $119 for year. Or three payments of $39.99. This comes with the option to go for certification with us – same one being used by public schools.

If you are interested, feel free to contact me.

Stefan
Studioweb.com

Becoming a Web Developer – tips from an old pro.

March 2nd, 2014

light bulb

Hi!

I’ve been teaching web design and programming for over a decade and I’ve been active building websites and web apps since 1994 – I’ve been around the block … and back again.

Web Developer as a Career

I have a few tips for you if you are thinking of becoming a web designer or programmer/developer:

First thing, becoming a web developer is a great career move – this is a growing field that will have plenty of demand for many years. In fact, there will be many more jobs than there are people for at least a decade … it’s a major problem in the US and other western nations.

Learning web development can seem like a daunting task … so here are some learning tips:

  1. Be prepared to make mistakes and hit roadblocks. It takes a little time to develop the nerd-eyes.
  2. Concentrate on learning code and the foundations of code – don’t be tempted by tools that try to hide code from you .. because in the end, you will save more time learning to code.
  3. Don’t just sit back and watch the videos – do the code examples, even the simple ones. Repetition is the key.

If you want to learn web development, you might as well learn from the best – that us! Why not take advantage of my popular Web Developer from Scratch training package – these are the SAME courses that K12 public schools, community colleges and career centers are using today to train their students.

If you have questions, feel free to contact me.

Stefan
killerPHP.com

Why PHP should be the first language you learn.

February 13th, 2014

Yo!

Anyone who reads my stuff knows that if I am anything, I am practical. So when it comes to learning (and teaching) programming to someone new to the whole programming game, for several pragmatic reasons, I think PHP by far is the best language to begin with. Here are some of the reasons:

  • It is easy to learn.
  • It is the most popular web scripting language.
  • It is fast to program with.

Now, you can watch me yap about this in video for about 5 minutes – enjoy!

Thanks,

Stefan Mischook
killerPHP.com

Speed up PHP with JSON and AJAX

January 27th, 2014

javaScriptLogo

Hi,

So we decided to work on streamlining and speeding up StudioWeb’s basic functionality. When it comes to user perceptions of a web application’s speed, the most important thing to look at is the request/response cycle. But first, the most obvious thing you can do, is to just increase your server’s speed:

  • More RAM
  • More CPU
  • Faster disk drives
  • Empty disk drives – <50% full disk always move much faster.

… New servers are coming very soon to StudioWeb. In the meantime though, there are things you can do the application’s code itself.

AJAX with JSON

StudioWeb makes heavy use of AJAX to submit answers to the server for processing. So we decided to utilize JSON to send the data – rather than posting just a raw strings of text. What we get out of this, is a much faster response time from the users point of view.

To use JSON, you Typically use JavaScript

If you are sending post request via standard post and not AJAX, you can’t take advantage of JSON, since JSON is a function of JavaScript – meaning, it is all about creating JSON objects with JavaScript and the only way to use JavaScript in the request/response cycle, is to use AJAX … or specifically, the XMLHttpRequest() object.

… But now I am getting deep into nerd territory. All you need to take away is that using JSON to pass information to and from a server can speed up things a lot.

Stefan Mischook
killerPHP.com

CodeIgniter is out and Laravel is In!

January 22nd, 2014

Learn PHP by Building Web Applications

Yo!

I don’t how many of you are interested in PHP frameworks … if you are an intermediate level PHP programmer who understands OOP PHP, you ought start learning about PHP frameworks because they will save you a lot of time developing web applications and make them more robust.

Anyway, when you have frameworks, you will have framework battles! CodeIgniter was one of the more prominent PHP frameworks out there but it is quickly loosing favor to a much younger sexier framework called Laravel.

… The ironic thing about this, is that the Laravel developers are probably not very sexy themselves* … given that they had time to develop a new PHP framework. But this matters not, because the world needs more non-sexy nerds developing good code.

;)

So here is my video take on this subject:

1. Being a staunchly heterosexual male, I have no ability to discern whether a man is sexy or not. In this particular case, I have no inside knowledge or any information whatsoever with regards to the sexiness of the nerds in questions. For all I know, they could be master pickup-artists who have mastered ‘The Game’.

Thanks!

Stefan Mischook
killerphp.com

Building Mobile Apps – what is the best approach?

January 18th, 2014

Hey!

I am not sure why I feel like writing these days (could be because of more sunlight) but nonetheless, here I am with yet another article and video on PHP … in the same week!

This weeks nerd question:

When building mobile apps, should you use native languages (Objective C or Java typically) or should you go HTML5, CSS3 with a PHP back-end?

Personally, I think that many, many times, you will find the HTML5 route the best choice because:

1. Native iOS and Android development has a steeper learning curve and the languages themselves, are not exactly trivial – Object C is for iOS and Java is for Android and both are not the easiest to learn.

2. If you write your mobile app with HTML5, it will be universal and supported on all types of devices:

  • iOS – that’s iPhone, iTouch and iPad
  • Android devices
  • Windows Phones – not that anyone uses these. But still …

Enough with the writing, time for my video commentary!

Thanks!

Stefan Mischook
killerPHP.com

What is Refactoring PHP Code?

January 16th, 2014

Hi!

For whatever reasons, I am in the mood to write … and I have a video too! So, what the heck is code refactoring? In a nutshell:

It is the process of code refinement – taking messy code and reorganizing it into much more manageable (cleaner) chunks. Refactoring is such an important part of coding, that I slap my programmers on back of the head, if they fail to refactor their code!

The video:

To summarize:

  • Refactoring is something you should do as you are programming – not 6 months later!
  • A common refactoring strategy is to take big multipurpose methods/functions and create two or more smaller fined-grained functions out of them.
  • Code that could be used in multiple functions, is a good candidate for refactoring.

Thanks!
Stefan Mischook
killerPHP.com

How to develop great software

December 3rd, 2013

light bulb

Hi,

The point of this article: get people using your software ASAP!

Now some of the details …

The best teacher in any field is experience … and web programming is no exception! In the case of app creation though, it’s not just your experience as a coder that counts, but the experience of your users.

What 2000 users can teach you.

It’s amazing what getting software into users hands can do for you – revealing its’ flaws is one thing! Yes but then you can improve and refine … so it’s all good!

Read the rest of this entry »

Bitcoin and Litecoin from a Programmers Perspective

November 27th, 2013

bitcoin

Hi!

I’ve been programming for about 18yrs … give or take a few months. I’ve been self employed or running businesses for over 20yrs and so when it comes to code and business, I know at least a little bit.

Speaking of ‘bits’, let’s quickly talk about the latest ‘investment’ vehicle: bitcoin.

What is Bitcoin?

It’s a number … yes, just a number. These numbers are mined/discovered by very powerful computers running mathematical equations. Once they solve the equation, you have a Bitcoin.

Yes, a bitcoin is just the result of a major math problem!

What is the value of Bitcoin?

Bitcoins are as valuable as the market would have it. People say it is valuable since there is a limited supply – this is false.

Bitcoin and Litecoin are just a couple of examples of the many, many digital currencies that are floating around out there. You, me and anyone else can come up with a new digital currency pretty easily (killerCoins?) … and as long as other people buy into it, they will circulate and go up in value.

Read the rest of this entry »

Obamacare Websites Failed because it looks like Spaghetti.

November 17th, 2013

spaghetti code

Best way to not build a massive website: load up a canon of nerds and fire them at said website.

:)

Ok, let’s define that a little better! In a nutshell:

A very large complex software system, has to be designed as a set of smaller independent systems, that communicate with each other using a common set of protocols. These systems/software, should be have a fairly narrow scope in terms of what they do. That means, don’t try to make your software into a ‘swiss army knife’ of functionality.

… This is basic OOP programming but it seems that in real life, many software developers seems to forget this simple principle.

Separating Concerns, or Defining the Logical Parts of Software

The hardest part of architecting software, is figuring out how to break it down into its’ logical components. One common way to do this, is to look at a software from the point of view of the users … for example:

- user
- administrator

So in this case, you might break your software down by ‘user’ functionality and ‘administrator’ functionality. So you would have one team working on the ‘user’ app and another working on an ‘administrator’ app.

Connecting the two Apps together

In case of most PHP apps, you will be tracking information with a MySQL database and so you can use the database as the bridge between the user part of your program and the administrator part. Doing so can really simplify development and it makes it easier to have programmers work independently – without having to talk too much with people working on the other app.

A good Software Architect is Needed!

Of course, when you are developing apps like this, you first need to have an experienced architect who can properly structure the project so that the developers of each part (user and admin) are not stepping on each others toes!

What to take away?

The above example is just an example. For many projects, dividing the app by user type may not make any sense! The key thing you want to take away is that you should look to create your software so that the major functions (and the code associated) is isolated from the code used in other major functions found in your system.

I hope that helps,

Stefan Mischook
killerPHP.com

You know Code but your Design Skills Suck – what can you do!

October 3rd, 2013

Hi!

I wrote this post originally for killerSites.com but then I figured that PHP programmers are probably the biggest suckers when it comes to page design – in short, you probably need this more than most!

;)

design skills

Hi,

Based on a recent forum post where someone with code skills (HTML, CSS, JavaScript) wanted to improve their design skills … and he was not talking about learning PhotoShop … actual design skills he was concerned about. My answer:

To begin with, look to design principles:

- alignment
- whitespace
- font use
- color use

If you have your page elements nicely lined up, don’t use more than two fonts on the page(!), keep your page colors properly matched (no clashing colors) and give the page a lot of breathing room (good use of whitespace) … that will go a long of making the website look good.

Read the rest of this entry »

What are PHP Peekaboo Bugs? What causes them and how to fix them?

September 24th, 2013

peekaboo-bugs

Peekaboo bugs are the worst sort of bugs, because they just pop-up randomly and are really hard to track down.

When a PHP peekaboo bug appears, I get very nervous because I know that I might be spending hours trying to track it down. I also get nervous because the peekaboo bug itself, tells me something is rotten with the codebase to begin with.

What causes a Peekaboo bug to appear?

In a nutshell: messy code.

Messy code typically means code riddled with ultra long monster-methods … or as some people refer to them: god methods. If you have a method/function with 200 lines of code and 3 or more nested conditionals – you are begging for a peekaboo to appear!

Squashing the PHP Peekaboo Bug

The first thing to do when peekaboos show up, is to localize (as best you can) where the source of this error is. You may only be able to narrow this down to the class, but that doesn’t matter … what you are looking for is the aforementioned monster-methods or god methods.

Once you’ve identified these, it time to start simplifying/refactoring them and do what Fowler calls ‘extract method’. This is the process of breaking down these massive monstrosities of nerd madness into smaller more manageable chunks.

… So for example, you might take out a few if and if else statements from a method and place them into their own method that the original monster-method can call. Besides making the code much easier to debug and update, you will probably squash your peekaboo bug in the process.

A final tip:

You should always be looking to refactor code AS YOU BUILD your app. Think of it as opportunities when you are coding and you run across a messy chunk of code that can be easily simplified.

Thanks,

Stefan Mischook
killerPHP.com

PHP Data Type Mismatch Crashes CodeIgniter!

September 21st, 2013

Learn PHP by Building Web Applications

Hi,

It’s been a long while since I’ve blogged about anything here … been busy building things.

Refactoring a Prototype

Recently, we were refactoring a PHP/CodeIgniter based project, cleaning up the code from a quick prototype we put out. When you have an idea for a piece of software, it is almost always a good tactic to first put out a rough prototype, to see if it has any legs … will anyone find use in your brilliant new idea?

Get user Feedback ASAP!

Another advantage of quick prototyping, is that you can use user feedback to finetune your app to their needs. I became much more successful as a developer doing things this way, over building a rock solid app from the start. Users will always find flaws in your original ideas and many of your ideas will simply not work … so it’s best to get the app into peoples hands as soon as you can.

Read the rest of this entry »

PHP Programmers must Harness the Power of Laziness

July 5th, 2013

Normally people think of laziness as being something negative. Generally it is, but when it comes to programming, laziness can be a virtue. But why?

Programming is all about saving time.

Don’t forget that the whole point of writing software, is to automate some process … to save time. You should carry that forward, into your actual programming as well, where you are always looking for ways to make your code and your coding more efficient. In PHP that can mean:

  • Leveraging PHP libraries – never write from scratch.
  • Learning OOP PHP – harder at first to learn, but in the end, writing OOP PHP will save a lot of time.
  • NOT using PHP when other more efficient options are available.

I think the last point is the only one that needs clarification. PHP is a great language, but sometimes it may make sense to use some outside language or even the server itself to get the job done.

For example, let’s say you need to run a PHP script say every day. The easiest way to get this done would be to run a cron job on your server. This functionality is built into any Linux server and a simple command can be used to run whatever PHP script/page you want:

0 0 * * * php /var/www/vhosts/yourdomain.com/httpdocs/scripts/myphp-script.php

The above cron code will cause the server to run your PHP page every day at midnight.

Some people may want to figure out a way to do this all in PHP, buy why bother when you can get the job done with one line of code?

What we can learn from the lazy?

The larger point is to always look for ways to save time – lazy people naturally look to do this all the time. They don’t equate success with lots of hard work, they equate success with getting the job done as easily as possible – you should too.

… Of course, some lazy bastards are so lazy, that they equate success with doing nothing at all. That doesn’t work to often unfortunately!

Thanks,

Stefan Mischook
killerPHP.com

Created By Stefan Mischook  |  Top of page  go to top of page