Wednesday, 4 December 2013
Your number one job
Time's up! What did you say?
If you said "to get another, better job" you're right! If you didn't, well, let's talk about this a little bit.
Most people think their job search ends when they accept a new position. That's not at all true, though. After all, there are tons of things that can go wrong with the role you have (or just accepted): bankruptcy of the company, you hating the role you're in, discovering that the work isn't what you love, and more.
In fact, you should be looking for your next role from the day you start a new job until the day you leave!
Your skills as a developer mean that you are a valuable commodity. Even if your current company doesn't recognize your value, somebody in the market will.
Of course, all of us want to attain the best job, the one that we fall in love with and never want to leave. We want to be the "cream of the crop", at the top of our field. The competitiveness of the developer talent market goes into high gear for the top 10% of the developer population. So how do you get into this group?
There are two routes you can take to move up into the top 10% of developers. The first is the experience route, which means working for years and years until you finally gain enough experience to reach the upper echelons of development skill.
The other route is the knowledge route, where you focus on gaining as much knowledge as possible so that when you are faced with hard challenges and difficult problems, you can step into the role and solve those problems with ease.
Security Matters
Recently, somebody asked me to take a look at a product they had, and give them some information on what I could do to improve it. Their product was a simple survey tool, focused on gathering data from users they invited or that had paid to use the tool. It seemed straightforward enough. Sure, I had a few concerns: the site had been outsourced, and this person wasn't a technical individual, but I figured I could take a look.
What I found was pretty shocking.
Passwords stored in plain text. No SSL encryption for logins or credit card data. A complete and total lack of any kind of password policy. And this was before I even got into the code.
Too often, it's easy to forget about security considerations when we're working on building something for a client. Security is one of those things that it seems people learn once and then assume they know, like riding a bicycle. But it's not. Security is an ongoing learning process.
When was the last time you stepped out and took a look at the OWASP Top Ten? It changes every year and is worth a look. How about examined security policies in your own app? Checked to make sure your password storage algorithms are up to par? Verified that you're using the latest and greatest version of PHP with all the security fixes? Updated that legacy site to use PDO instead of MySQL_*?
You might think security doesn't impact you, or that once you're done working for a client that the security of a particular application doesn't matter. It does! Clients can and will come after you for security vulnerabilities if they get hacked. And security vulnerabilities can be expensive: just one set of stolen credit cards can ruin a company's reputation and financial bottom line.
Wednesday, 6 November 2013
11 signs you have been hacked
Sure sign of system compromise No. 1: Fake antivirus messages
In slight decline these days, fake antivirus warning messages are among the surest signs that your system has been compromised. What most people don't realize is that by the time they see the fake antivirus warning, the damage has been done. Clicking No or Cancel to stop the fake virus scan is too little, too late. The malicious software has already made use of unpatched software, often the Java Runtime Environment or an Adobe product, to completely exploit your system.
Sure sign of system compromise No. 2: Unwanted browser toolbars
This is probably the second most common sign of exploitation: Your browser has multiple new toolbars with names that seem to indicate the toolbar is supposed to help you. Unless you recognize the toolbar as coming from a very well-known vendor, it's time to dump the bogus toolbar.
Sure sign of system compromise No. 3: Redirected Internet searches
Many hackers make their living by redirecting your browser somewhere other than you want to go. The hacker gets paid by getting your clicks to appear on someone else's website, often those who don't know that the clicks to their site are from malicious redirection.
Sure sign of system compromise No. 4: Frequent random popups
This popular sign that you've been hacked is also one of the more annoying ones. When you're getting random browser pop-ups from websites that don't normally generate them, your system has been compromised. I'm constantly amazed about which websites, legitimate and otherwise, can bypass your browser's anti-pop-up mechanisms. It's like battling email spam, but worse.
Sure sign of system compromise No. 5: Your friends receive fake emails from your email account
This is the one scenario where you might be OK. It's fairly common for our email friends to receive malicious emails from us. A decade ago, when email attachment viruses were all the rage, it was very common for malware programs to survey your email address book and send malicious emails to everyone in it.
Sure sign of system compromise No. 6: Your online passwords suddenly change
If one or more of your online passwords suddenly change, you've more than likely been hacked -- or at least that online service has been hacked. In this particular scenario, usually what has happened is that the victim responded to an authentic-looking phish email that purportedly claimed to be from the service that ends up with the changed password. The bad guy collects the logon information, logs on, changes the password (and other information to complicate recovery), and uses the service to steal money from the victim or the victim's acquaintances (while pretending to be the victim).
Sure sign of system compromise No. 7: Unexpected software installs
Unwanted and unexpected software installs are a big sign that your computer system has likely been hacked.
Sure sign of system compromise No. 8: Your mouse moves between programs and makes correct selections
If your mouse pointer moves itself while making selections that work, you've definitely been hacked. Mouse pointers often move randomly, usually due to hardware problems. But if the movements involve making the correct choices to run particular programs, malicious humans are somewhere involved.
Sure sign of system compromise No. 9: Your antimalware software, Task Manager, or Registry Editor is disabled and can't be restarted
This is a huge sign of malicious compromise. If you notice that your antimalware software is disabled and you didn't do it, you're probably exploited -- especially if you try to start Task Manager or Registry Editor and they won't start, start and disappear, or start in a reduced state. This is very common for malware to do.
Sure sign of system compromise No. 10: Your bank account is missing money
I mean lots of money. Online bad guys don't usually steal a little money. They like to transfer everything or nearly everything, often to a foreign exchange or bank. Usually it begins by your computer being compromised or from you responding to a fake phish from your bank. In any case, the bad guys log on to your bank, change your contact information, and transfer large sums of money to themselves.
Sure sign of system compromise No. 11: You get calls from stores about nonpayment of shipped goods
In this case, hackers have compromised one of your accounts, made a purchase, and had it shipped to someplace other than your house. Oftentimes, the bad guys will order tons of merchandise at the same time, making each business entity think you have enough funds at the beginning, but as each transaction finally pushes through you end up with insufficient funds.
Source: www.infoworld.com/print/229782
Tuesday, 29 October 2013
The Type Hint Tight Couple
<?php
class MyClass() {
public function __construct(MyObject $mobj) {
$this->myObject = $mobj;
}
}
But type hinting alone is not sufficient to loosely couple our objects. In fact, even though we are injecting our dependency in the initial example, we're type hinting on a concrete object, meaning that we are tied to that specific object for all future iterations. Sure, we can mock it for testing (which is an advantage), but we can't easily subclass it and use it elsewhere.
Fixing the Type Hint Tight Couple
It's easy to fix this particular tight coupling problem. To do so, we can draw back on our knowledge of SOLID principles, namely the Dependency Inversion Principle, which states:
Objects should rely upon abstractions, not concretions.
Fixing this tight couple requires only that we abstract the creation of the interface from the implementation of the object, and then type hint on it. For example:
<?php
interface MyObjectInterface {
// some methods to define interface in here
}
class MyObject implements MyObjectInterface{
// The implementation of the interface
}
class MyClass{
public function __construct(MyObjectInterface $mobj){
$this->myObject = $mobj;
}
}
So, here instead of relying solely upon MyObject to type hint, we can now type hint on the interface, MyObjectInterface. This loosely couples our objects, because MyClass no longer cares about the implementation of MyObject; it only cares about knowing the right interface!
So, do all my objects need interfaces?
In short, no, they don't. The illustration I've provided is for objects that might have reuse potential later on, or are part of a library; when you're working with specific objects that are unlikely to change, there may not be a need for this level of decoupling.
Remember, the principles of object oriented design (like loose coupling) are about offering best case solutions, not final solutions or absolute hard-and-fast rules. It's up to you, the designer, to make good choices.
Monday, 28 October 2013
Tight coupling in OOP
What Is Tight Coupling?
It would help to define exactly what the problem is, in order to solve it.
Tight coupling, in object oriented application, is an abnormal dependency between two unrelated objects. This usually manifests itself in a few different ways; today we're going to talk about the first type: the object creation tight couple.
The Object Creation Tight Couple
Have you ever seen or written code like this?
<?php
class MyClass(){
public function __construct(){
$this->myObject = new MyObject();
}
}
We've all probably observed this. Even if it's in another method besides the constructor, we've all seen code that creates other objects. The culprit here is the new keyword. This keyword creates an object, but the creation of an object tightly couples one object to another. It's impossible to easily swap one object for another.
Solving The Object Creation Tight Couple
There are a few easy ways to solve this particular type of problem. The first is with dependency injection. Dependency injection is the process of inserting an object at runtime, rather than creating it in an object, and looks like this:
<?php
class MyClass(){
public function __construct(MyObject $mobj){
$this->myObject = $mobj;
}
}
With this approach, we are injecting the object, which makes it possible to swap the object out with a mock object for testing or another object to modify the application. But this isn't the only way we can solve this problem.
We can also use a factory to create the object we need at run time, but abstract the creation to another object or group of objects (like the Abstract Factory pattern). Using a factory looks like this:
<?php
class MyClass(){
public function __construct(MyObjectFactory $mobj){
$this->myObject = $mobj->getInstance();
}
}
Now, the real power of this isn't shown in the constructor; it's shown when the getInstance() method is used in a method that requires it. But, you can easily see the power of the factory here to create an object on demand, yet still follow the best practices of dependency injection and testability.
5 Ecommerce Metrics You Should Be Tracking
These are valuable, and should be monitored. After all, measuring such outcomes is what directly impacts revenue and the bottom line.
Thanks to Google Analytics as well as Mixpanel, Flurry, Site Catalyst, and other analytics platforms, these ecommerce metrics are readily available to site owners.
While focusing on the outcomes is key, close attention to tracking user behavior and interaction with the site or mobile app will also yield significant incremental improvements. Here are five interactions you don’t see a lot of people measuring, when they really should be.
Product Categories
You can easily report on top products, what’s selling, and what’s not selling on your website. However, go beyond that and consider rolling up your reports to the product category level. Some categories can be driving more revenue than others..
Product Comparison
Many ecommerce sites allow shoppers to list products next to each other for ease of comparison — dimensions, features, pricing, and other features — and also for an opportunity to upsell the higher value products.
You have probably seen live chat features on sites more often than not. You come to a site to check out a service or a product and you’ll see an invitation — sometimes a pop-up — asking if you would like to chat with a customer support agent. I’ve seen ecommerce businesses where the average order value is 25 to 30 percent higher when a purchase included a live chat.
Wednesday, 14 August 2013
Writing SOLID code
S - SRP - Single Responsibility Principle - A Class should have only a single responsibility.
O - OCP - Open/Close Principle - Entities should be open for extension but closed for modification
L - LSP - Liskov Substitution Principle - objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program
I - ISP - Interface Segregation Principle - many client-specific interfaces are better than one general-purpose interface
D - DIP - Dependency Inversion Principle - one should “Depend upon Abstractions. Do not depend upon concretions.
Record Number of Developers Adopting AI as Vibe Coding Surges
As AI adoption continues to rise across the tech industry, a record number of web developers are turning to vibe coding to build application...
-
The Concept of True North in Lean Methodology In the world of Lean methodology, one of the most fundamental and guiding principles is ...
-
As engineering teams grow, so does the need for leadership that isn’t purely managerial. Enter the Staff Engineer —a senior individual contr...
-
Engineering managers are often expected to provide clarity amid chaos. You may have a team delivering features at full speed, but without a...