Should Website Authentication Really Require Email Addresses?

At SDPHP we are starting an open source project (grouptopics) for user groups, but that is for another post.

We are setting up oAuth authentication with Google, Twitter, and Facebook.  While doing so, the developer that did the initial integration stopped with the Twitter integration because they do not give you an email address, and he is steadfast that an email address should be required for a user.

I have thought a lot about this lately, and I am of the personal belief that an email address is not required.  While I would like to have one for communication, the main goal is authentication.  Having the email address does nothing to accomplish this authentication, it just serves our greedy desire to send emails that are probably unwanted.

I have not given any final direction towards the group.  What are your thoughts?  Do I listen to him and require it, or go with my gut and say that it shouldn’t be required?

 

 

Mysql Order By Clause Performance

Just had a strange query happen that I thought I would share.  I am by no means a Mysql expert, I know enough to usually write decent queries that are performant.

I had one today that was baffling me.  First, I know this should be extracted into reusable code, but right now that’s not the plan.  In one part of our system a query was happening pretty quickly.  In a new part that I am working on it was taking forever, to the point I had to kill the query (after 30+ seconds) so that it didn’t bring the entire system down.

I was trying everything to figure out why one was worse than the other.  They both seemed like terrible queries from first sight.  I rearranged the WHERE clause so that they matched, and that didn’t fix the problem.

The good query had: ORDER BY dateadded desc, id

The bad query had: ORDER BY dateadded desc

I guess that is something to try when you have non performant queries.  There was a subquery happening as well, so I think the order by may be helping the subquery.

It was just interesting to me and I thought I would share.

 

PHP|Architect being acquired by Musketeers.me

To me this is HUGE news in the PHP World.

If you are in the PHP community and don’t know PHP|A, then you have been missing out.  I learned about them when I decided I HAD to grow and improve my skillset.  I was a sole developer that was stuck.  I wanted to be better, but to do so, you have to work with better people than you are.  So I set out a goal of learning things, and luckily enough I kind of knew what I was looking to learn.  Part of my whole speech about needing to know what you don’t know.

PHP|A offers a magazine (used to be in print, maybe again soon?), books, trainings, and conferences.  The conferences are what first drew me in.  I attended TEK-X, back in May of 2010 and thus start of the new me.  Within 2 years, I completely transformed myself for the better, and made some huge life changing decisions.

I met all of the members of Musketeers.me while on my new quest.  I met @EliW first at Tek-X, and while he won’t remember it, I certainly do.  I got to hang out with a large group of people in his room playing Rock Band until late in the night.  I was very shy that year, and stayed to myself.  I met the rest of the team (@omerida, @SandyS1, and @kevinbruce) this year at Tek12.  I talked with them way more than I thought I would have, and it was a great experience.

The Musketeers were the team behind MojoLive.com, until funding ran out and the backers pulled the plug.  At least this is how I interpreted the story.  They decided they liked working together and formed a new company called Musketeers.met.

This is a great story for potential PHP startups.  I am looking forward to what comes of all of the changes at PHP|A.  Will the conferences continue?  If so, will they be as good as they were, or better?  Congratulations GUYS!!!

 

Introducing Git Into a Legacy Codebase

Developers often inherit legacy codebases, and sometimes those codebases do not have version control. How do we maage that?

I recently joined a team, and while they tried to have some good practices in place, it really was a mess.  Luckily they know that, so I am not saying something they don’t already know.  ;-)

They had 4 production servers and 1 development server.  So when I started, I thought that was a great setup.  They had SVN in place, and while I am a Git guy, I figured I could pick up SVN just fine.  After starting, I learned that they didn’t use SVN very well, and that much of the code was not in sync.

I wanted to get rid of SVN and introduce git into the mix.  My boss was very open to the idea, and surprisingly, so was the rest of the team.  There was a HUGE issue though.  So many changes have been made in production, so there could actually be 5 different versions of the same file across all of the machines.  And not just different versions, but completely different functionality within said file.

Because of these facts, my boss was hesitant about my desire to use git.  I convinced him that I would take it slow, and I laid the plan out in front of him.  Because of my slow and methodical approach, he gave me the approval to move forward.  You don’t have to add all of your code into a version control system all at once.  Start slowly with a well laid out plan.  And I don’t mean that you have to know every file in your codebase and the order you want to add them.  My plan was to start with the files we were currently working on.

Our steps when we needed to change a file:

  1. Copy all 5 versions to the dev server.  Creating different file names of course, these will just be temporary files.
  2. Use some process to figure out the differences between the files.
    1. vimdiff is a great tool for this.  It can help you merge up to 4 files at once.
  3. The goal is to get a single files that could be in 5 different states into a uniform version that should work properly on all 5 systems.
  4. Remove the temporary files
  5. Add the newly merged version into git
  6. The key now is to keep a backup of the various version “Just in case” and get the newly merged code into production.
  7. Lather, Rinse, Repeat

The process is still not complete for us.  However, we are in a MUCH MUCH MUCH better position then we were a few months ago.  I can make changes and test in development, and deploy most of our code fairly easily.

The fact that a company that just hired me, had that much trust in me to completely change their workflow, was pretty impressive as well.

 

SD PHP Website Is Up

Being the organizer of SD PHP has been one of the most fulfilling experiences I have had yet. It has gone above and beyond anything I thought it would mean to me.

I have met some great people, and have learned more about what makes the PHP community so great.

So, we finally put a website up. It’s nothing great right now. It’s just your basic WordPress site, but it will at least give us a place to start putting some content. As always, I am very open to feedback and criticism (of the constructive kind).

 

Book Review: Master Your Mac

I just got “Master Your Mac: Simple Ways to Tweak, Customize, and Secure OS X” yesterday and am amazed with the amount of material covered in it.

It’s almost 400 pages of great material that is useful for everyone from newbies to veterans. It contains simple shortcuts, using the new features of Mountain Lion, using the hardware, configuring the software, and even shows useful third party applications (many of which are free).

My favorite section so far is simply a Bluetooth Proximity Monitor. This chapter tells you how to setup your mac so that if you walk away from it with a connected bluetooth device, it can automatically run whatever tasks you want. For example, pause iTunes, set your away status in your chat app, and even lock the screen. And then it can do the opposite when you get back with the Bluetooth device.

With 38 chapters of information, there will be something for everyone. I highly recommend this book if you have a Mac.

 

VimDiff: How Have I Not Used This Before?

Ok, I have been using Vim for about 15 years now, and even did a whole presentation on vim at my SD PHP Meetup, and had a reference to vimdiff in one of my slides. But honestly I have never used it.

WOW, what a great tool. Here are a couple of links that I found useful.

http://www.debianadmin.com/vimdiff-edit-two-or-three-versions-of-a-file-with-vim-and-show-differences.html

The video shows you how to use vimdiff as your git diffing tool.
http://www.youtube.com/watch?v=hb5RVnOda2o

One thing to add. If you follow the steps for using vimdiff as your git diff external tool, make sure to add this to your .gitconfig
[pager]
diff =

Otherwise you will get errors.

Also, when editting more than 2 files at once, those shortcuts won’t work.
Instead of :dp, use :diffput b#
Instead of :do, use :diffget b#

b# is just a number of the window pane starting at 1, counting left to right.
Shorthand :diffpu or :diffg

 

Do Not Hire Or Be A Sole Developer

I was a sole developer for bowlingball.com for eight years. While there, I was very happy to be the only tech person. I was able to do things my way. There was even an employee that encouraged the owner to outsource the programming, and to get rid of me. Needless to say, I was very unhappy when I heard this.

Looking back… being a sole developer is bad for both the company and the developer themself.

    For Developers:


Developers should strive to be part of a team. It is so hard to grow by yourself. If you have to be willing to put yourself out there and work very hard to learn. If you have co-workers, you will learn from each other. Someone will have your back if you make a mistake. Learning best practices is easier with more people.

    For Companies:


If a company can not afford to hire at least 3 people, they are doing themselves a disservice by hiring any. What happens when that person leaves? Who’s double checking that person? Did you really hire the “Best” you could?

Outsourcing to a group of developers is not necessarily as expensive as it sounds. Sure, per hour you may pay more, but you are basically buying the experience of a group of people. If someone leaves that group, there are others that can pick up where they left off easily. You should not be left hanging in a transition. You are not paying an employee when they are not working to 100% productivity or for them to spend time learning.

    Conclusion:


In the end, a sole developer really isn’t good for either party.

 

The Pragmatic Programmers: Practical VIM Review

I gave a presentation at SD PHP on Vim, and when I got home from giving the presentation, I had this book sitting on my doorstep. A little late for my presentation, but that’s probably a good thing.

All I have to say is WOW. I am going to have to give another presentation from just the new things I’ve learned. This book is not for beginners by any means. And if you think you know Vim well, I would say pick this up and have your mind blown.

I have been using Vim daily for over 14 years. It’s how I write code, which is how I make a living. The book starts off with the dot (.) command. Which is very useful, but not the first thing you would learn in Vim. I have used that command extensively for years. But nonetheless, with that kind of start, I knew that starting there meant the book would be advanced.

I am currently at page 33, and have said OMG many times with the cool things Vim can do, that I had no clue about. Based on this alone, go get this book. 5 out 5 stars/elephants/candy canes, whatever you want to use.

Practical Vim: Edit Text at the Speed of Thought

 

Solved: Facebook sharer.php Not Working for Some Reason

So, we have a ton of share links all over our various domains at work. And much of our domain structure is based on users have subdomains (example: JohnCongdon.herbalhub.com).

All of a sudden, the sharer.php seemed to stop working. Some browsers stayed white, Chrome showed a grey error message with a 500: internal server error.

It took me a long time to track down the problem. I tried so many different things, but in the end, it was the CASE of the subdomain. :( Changing it to johncongdon.herbalhub.com solved the issue. So strange, undocumented, and frustrating.

I hope this helps someone down the road.