Why PHP always been crap

I really don't like programming. I built this tool to program less so that I could just reuse code. PHP is about as exciting as your toothbrush. You use it every day, it does the job, it is a simple tool, so what? Who would want to read about toothbrushes? I was really, really bad at writing parsers. I still am really bad at writing parsers. We have things like protected properties. We have abstract methods. We have all this stuff that your computer science teacher told you you should be using. I don't care about this crap at all. There are people who actually like programming. I don't understand why they like programming. I'm not a real programmer. I throw together things until it works then I move on. The real programmers will say «yeah it works but you're leaking memory everywhere. Perhaps we should fix that.» I'll just restart apache every 10 requests.

— Rasmus Lerdorf (creator of PHP)

Posted by paxer Thu, 16 Feb 2012 11:04:00 GMT


About self-training

Your career is your responsibility. It is not your employer's responsibility to make sure you are marketable. It is not your employer's responsibility to train you, or to send you to conferences, or to buy you books. These things are your responsibility. Woe to the software developer who entrusts his career to his employer. Some employers are willing to buy you books and send you to training classes and conferences. That's fine, they are doing you a favor. But never fall into the trap of thinking that this is your employer's responsibility. If your employer doesn't do these things for you, you should find a way to do them yourself.
Uncle Bob Martin, The Clean Coder

Posted by paxer Sun, 15 Jan 2012 22:39:00 GMT


Programming job

"Sadly, there’s no one true way. And if there were, we’d all be looking for new careers, so let’s be glad for the absence of the silver bullet."

The RSpec Book: Behaviour-Driven Development with RSpec, Cucumber, and Friends by David Chelimsky, Dave Astels, Zach Dennis, Aslak Hellesøy, Bryan Helmkamp, Dan North

Posted by paxer Thu, 12 Jan 2012 08:40:00 GMT


So true ...

“Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do. If you haven’t found it yet, keep looking. Don’t settle. As with all matters of the heart, you’ll know when you find it. And, like any great relationship, it just gets better and better as the years roll on. So keep looking until you find it. Don’t settle.” [Stanford commencement speech, June 2005, Steve Jobs]

Posted by paxer Wed, 21 Dec 2011 04:10:00 GMT


Prevent Paperclip from deleting attachment files on update

I had a problem with Paperclip other day. My requirement was - every time when I do update my model attachment - Paperclip should not delete the original copy from the file storage (HDD or S3 etc).

I found one way how to handle it

lib/paperclip_monkey_patch.rb:

module Paperclip
  class Attachment
   def clear
    # nop
    #raise "hell"
    # op
    instance_write(:file_name, nil)
    instance_write(:content_type, nil)
    instance_write(:file_size, nil)
    instance_write(:updated_at, nil)
  end
 end
end

Then add this line at the top of any file that deleted attachments:

require 'paperclip_monkey_patch'

Thanks to Ruby Forum

Posted by paxer Thu, 14 Jul 2011 11:18:00 GMT


Generic implementation of Repository pattern for Entity Framework Code First

I have been inspired by beautiful MVC starter kit by Rob Conery from ASP.NET MVC 2 Starter Kit and i 've created implementation of Repository pattern for my project where i use Entity Framework Code First and ASP.MVC 3

Posted by paxer Wed, 17 Nov 2010 02:20:00 GMT


Convert String to enum System.DayOfWeek

As far as i see, there are two ways how to convert string representation day of week to enum System.DayOfWeek

Posted by paxer Tue, 16 Nov 2010 13:24:00 GMT


ASP.NET, HTTP 404 and SEO

The other day our SEO Manager told me that he is not happy about the way ASP.NET application return HTTP response codes for Page Not Found (404) situation. I've started research and found interesting things, which could probably help others in similar situation.

Posted by paxer Mon, 31 May 2010 13:07:00 GMT


Sending email using templates by Kentico 5 CMS email engine API

Today i am going to show you a short example how to send emails based on templates with Kentico API. I found one article about Kentico email engine but it does not explain how to work with email templates.

Posted by paxer Wed, 24 Feb 2010 13:46:00 GMT


Writing to the Kentico 5 CMS Event Log

Thomas Robbins wrote a great blog post about writing events in Windows Event Log Writing to the Event Log However i am going to show how to log events in Kentico CMS by using Kentico Event Log module API.

Posted by paxer Mon, 25 Jan 2010 13:33:00 GMT