Buy Valium Safely Online Buy Roche Valium 10Mg Buy Diazepam 10Mg Online Uk Buy Valium 1000 Buy Diazepam Legally Uk Cheap Valium Online

106: TZ Discussion – The Bad Version

Justin and Jason discuss WordPress backup site BlogVault, the backlash on the Skype 5 UI and the possibility for a Skype competitor, the guerrilla tactics behind bootstrapping a startup, methods of sending email through code, Anonymous and the Wikileaks controversy, why Jason is irritated by Justin’s iPhone email trailer, securing images on a web server, why arguing is pointless, Justin’s eager vs Jason’s lazy approach to abstracting code, why Jason feels that switching to Subversion has been a waste of his time and understanding the motivation equation.

30 Comments
  1. Justin says:

    Justin’s “Roll Your Own” Drip Campaign

    function my_mail($to,$subject,$message,$post_at=false)
    {
      // Note: $post_at = unix timestamp
      if ( $post_at )
      {
       // Insert parameters into email scheduling table
       return;
      }

       // Wrap message in HTML with unsubscribe link
       // Send mail via elastic email or php mail
    }

    And the drip campaign…

    my_mail('joe@bloggs.com','Day 1','Hello'); // send instantly
    my_mail('joe@bloggs.com','Day 2','Hello',strtotime('+1 day'));
    my_mail('joe@bloggs.com','Day 3','Hello',strtotime('+2 day'));
    my_mail('joe@bloggs.com','Day 4','Hello',strtotime('+3 day'));
    my_mail('joe@bloggs.com','Day 5','Hello',strtotime('+4 day'));

    And the cron (run once per minute)…

    if ( $messages = $db->get_results("SELECT * FROM schedule_emails WHERE post_at > NOW() AND is_sent = 0") )
    {
      foreach ( $messages as $message)
      {
       // Send
       my_mail($message->to,$message->subject,$message->message);
       // Update the db for this message and set "is_sent" = 1
      }
    }

  2. Hi,

    I use Justin’s approach regarding abstraction. You never know what might happened.. one day you use email as notifications in your system and the other you use SMS messages, so when abstracting it’s easier to do such big changes [lots of examples here.. mailing, logging errors and etc..].

    Another thing,
    do you know what sites like Groupon use for mailing? they probably never marked as spam.. they use services like Elastic EMail or MailChimp? or use their one server for that?

  3. Bopinder Abu Morpalinder Singh says:

    I learned the hard way: abstract pretty much every single thing you can. It isn’t much work but it’s like source control: when you need it, you will be a hero.

  4. Bopinder Abu Morpalinder Singh says:

    Jason: you are now on the list. Be careful.

  5. Justin says:

    I think one of the big issues Jason has with abstraction as a daily practice is that he feels he would over engineer each abstracted component and spend hours thinking about how to abstract it.

    What I wasn’t very clear about is that can easily be re-framed as MVA (minimum viable abstraction). After a few weeks practice of MVA the abstraction part ends up being no more than creating a placeholder/stub/shell function for each abstracted thing, and honestly only takes a few seconds to a few minutes at most to create.

    Then the big saving comes when, three months later, your abstraction is embedded in your entire codebase and shazam you can make a system wide change in an instant.

  6. Bopinder Abu Morpalinder Singh says:

    That’s a great way of putting it. Minimum Viable Abstraction: what is the simplest thing that will let you swap out the behaviour of this component?

    Some things where I have reaped great benefits by abstracting:
    * Executing user-requested commands
    * Error handling
    * Caching

    I’m sure there are more.

  7. Spencer says:

    In my own experience, procrastination translates in to a messy environment (papers scattered, dirty dishes, ect..). The way I stop procrastinating is to just tackle messiness as soon as I start to notice it creeping in. It might be just a psychological thing, a ritual effect, but I always get really productive when everything is neat and organized around me. It is kind of like my environment is a fractal of the order and focus in my mind.

  8. Bopinder Abu Morpalinder Singh says:

    At the same time, I think you can’t pre-abstract everything, especially the large stuff. I tend to abstract stuff I already know that has been a pain in the butt before or is somewhat related to something I’ve had a pain with.

    Poor Jason, we’re all ganging up on him.

  9. Bopinder Abu Morpalinder Singh says:

    As for Subversion, just stop using Subversion. It’s awful.

  10. Like most (i assume) I was shaking my head at Jason’s not wating to abstract things. I guess having been in the boat where doing this bit me I shy away from it now. For me though the biggest reason for doing it is, *drum roll* Unit Testing. Since I love unit testing my code I had abstractions forced on me as a way of performing proper tests.

    That said when it comes to throw away code I just hardcode, but anything I expect to maintain gets refactored.

    @Jason I would be curious to know if you have worked with any large teams before? If so how large and on what languages? I found personally that with the larger the team the more important interfaces and source control were.

  11. Jason says:

    @BAMS – That doesn’t sound good. What list am I now?

  12. Jason says:

    @Ben Boyter – I’m guess I’m what you’d call a “lone wolf” or “cowboy coder” and have never really worked on a team before and that’s probably why I’ve developed the habits that I have. I’m also a perfectionist and a control freak and that might also help explain things. While I probably won’t ever change the way I work in any substantive way since I’ve learned to be pretty efficient and effective using my own method, I also understand that it wouldn’t work for most other people and especially not for anyone working in a team environment.

    The primary languages I’ve used and in which I’d consider myself an expert are C++, VB, C#, Javascript and PHP.

  13. @Jason that answers it then 🙂 till I joined larger teams I didn’t see the need either, and never really bothered abstracting. Having gone through the pain of not using them on a large team though I find it easier to apply them in the correct places the not.

    If you ever get into Unit testing with C# VB or C++ you will quickly discover you need to throw interfaces around as otherwise you cant do proper unit tests.

    I am with you on the over architecting though. I work with people who are always talking up Dependancy Injection, throwing around Gang of Four concepts, new patterns such as repository etc… I think that most people want to be engineers and not coders so much. The prefer the ivory tower building of concepts rather then shipping products.

    Personally all I want is code that is fully unit tested (it makes me lazy which is a good thing). Because of this need and since in my day job I work with C# I find interfaces are required in order to mock things. Its just my preference since I find unit testing really produces better more understandable code.

  14. Bopinder Abu Morpalinder Singh says:

    @Jason: One does not name the list.

  15. I really enjoyed the technical spin on this discussion show.

    @Justin, I did try the Pluggio drip-drip campaign and really liked the execution. The daily content was just the right bite size. I thought you would have used the MailChimp campaign feature so I was surprised you implemented a simpler version. By the way last week Amazon released their own Simple Email Service.

    @Jason, another benefit of encapsulating 3rd-party interfaces early in the process is that you can mock their behavior. That comes in really handy to reduce complexity and maintain control over what you’re testing. It can also be a great way to build and test features incrementally. – signed: #notTryingToChangeYouOrArgue! 😉

  16. William says:

    I think disrupting skype would be hard for one very important reason:
    Bandwidth. When I was in Malaysia around December, we used Skype to communicate with people back home. It was great sound quality and such–until it went down. The problem was that some of the users that served as their “super nodes” had received updates that broke the system and the network was crippled….Then it dawned on me: Skype is a peer-2-peer network. So, that means that for skype, they don’t need to use their bandwidth serving messages, but can distribute the cost over their “free” users. Then, their paying users can have good sound quality. So, if you want to take on Skype, then you can either go the server route, but then Skype eat’s your lunch on price (because you’re paying for bandwidth and their only bandwidth is spent on making connections)–or you can try to establish your own P2P network. BUT–the problem is that your quality will be worse because your network is less dense. But, it’s no longer green field where people are willing to tolerate that, because computer-to-computer communication is free on Skype and computer 2 phone is still cheap. So, I think challenging Skype on pure VOIP grounds would be difficult–because the margins are already low (what, are you going to charge 1 cent/minute instead of 2?) and the quality is high….

  17. William says:

    One place that Skype runs into problems is that it’s banned on government networks (I believe due to it’s encryption). So, for organizations that can’t use Skype, there might be an opportunity to go against Webx/ GotoMeeting/etc. But, it’s hard to envision P2P without encryption being viable…

  18. William says:

    I’ve also been thinking about the file storage issue–both for work and for side projects. For work, we have a number of small textfiles (though when we expand to more of the facility, we’ll have binaries and larger files) that users can upload (or are transferred to us as part of live data from experiments) and we’ve stored them as files (to be honest, because it was easy) named by their md5. We then store the md5 (In retrospect, we should use SHA1+salt based on the name of the file, to minimize collisions). However, this was for a prototype and we haven’t tested it with a huge number of files in the directory. I wasn’t so worried about performance (if the number of files grew, then I would go with Justin’s multiple directory scheme)–but rather just worried about the directory being locked down (cannot be viewed, cannot be used to traverse the file system). One advantage of S3 (and for us, since the info isn’t sensitive, there’s not need to encrypt to files for storage/decrypt for serving) is that we just don’t have to worry about it, and we get scalability (I think you can even have the option to have files served closer to the requester to have less latency). Of course, you then incur the extra costs of using S3 instead of your own server…I should give some thought to the issue of large files though for local storage. Also, is there any easy way to limit the size of files–before you’ve received them? I think I’m with Justin on this one. I’ll abstract it so we can change later ;>

  19. Akshat says:

    Thanks guys for talking about blogVault. Really appreciate it.

  20. Yeti says:

    Fantastic show guys!

    I use subversion on my personal projects even though I’m the only one working on it and its been very useful.

    The troubles Jason mentioned regarding his Mac development environment are precisely the reason I switched to using Linux as my desktop many years ago. I’m always deploying to run on Linux servers so my development environment is pretty close to Live. Given the environments are so similar its extremely rare that I run into any issues with platform differences.

  21. Ben Boyter says:

    @Jason, something else to consider, if you are storing blob objects in the database and using binds with PHP (possibly with any other language too) keep in mind that for the bind it will block out as much memory in RAM as is required to fill the blob, even if your object is much smaller.

    That is, if you have a 16 meg blob then every insert or select that uses the blob will consume an extra 16 meg of ram regardless if you fill it or not. I belive you can get around this by doing the following,

    prepare()
    execute()
    store_result()
    bind_result()

    If you run the store result method before you bind you wont end up eating all your ram. Or you can identify these queries and do them the normal way.

    No idea about streaming from the DB but I suspect thats not going to be possible since the query should just return all the data in one go. You could flush it from there in steps though.

  22. William says:

    I have been using svn for my own projects, but switched to git…

    William

  23. Tim Kaisner says:

    @Jason: Funny how the last 25 min were right after you talked about listening. Justin was spot on in technique and while I fully appreciate Jason’s guerilla, “getting things done” approach, sometimes experience trumps everything. If Justin is telling you that he’s tried both ways and the way he’s suggesting is significantly better, maybe you should give his approach a try. It was amazing how defensive you were getting about everything that was being suggested. Quite frankly and on a more serious note, I was a bit dismayed hearing how you code (no version control, averse to suggestions for improvement e.g. encapsulation) and then can turn around and talk about how awesome the AppIgnite code really is. I’m one of those Corporate types who’s looking forward to leveraging AppIgnite in our development centers (easily at even your most expensive $ range) but I have to take a step back and wonder if I’m putting my money in the right place. I guess I’ll just have to see it now to believe it. It also tickles me that despite your getting things done approach, AppIgnite is taking ages to be released whereas Justin keeps pumping out code for Swarm, Plugio and others.

  24. Bopinder Abu Morpalinder Singh says:

    Ouch…

  25. Justin says:

    I’ve seen Jason’s appignite code a number of times, if anything it’s over engineered and abstracted in all the important functional classes such as model view controller etc. The code quality is very high that’s a guarantee. I think the issue is that because he’s a perfectionist when he focuses on abstraction he is very dedicated to engeneering all the alternatives (which takes a long time). So, if I understand correctly, this discussion is not about “never” abstracting (which Jasons code has plenty of) it’s about abstracting “all the time” vs “some of the time”.

  26. Bopinder Abu Morpalinder Singh says:

    Question for Justin: why aren’t you #1 for “Twitter for business” search? 27K queries per month. Make a good landing page and you’re raking it in.

  27. Perhaps Justin should post source for a appignite generated blog or something else thats trivial to make. Im pretty sure quite a few people would be happy to pull it apart and comment on it.

  28. Errr make that Jason of course 🙂

  29. Janko M. says:

    Awesome show, especially the last, productivity hacking theme. At first it looked just obvious stuff, and I was thinking that I somewhat do this anyway. But then I realized that exposing it, thinking about it as a straightforward algo. (that matches my observations) is a whole new deal. Thanks.

    About the style of coding, my personal philosophy is very similar to Jason’s. I joked about it that “I make crap and then turn it into diamonds”. I even named my company Refaktor :). But most colleagues don’t agree with me, or get my arguments.

    You mentioned No Agenda a little and their view of WikiLeaks. I have a theory now, that they make awesome show on a normal or slow weeks, because they dig out all sorts of things that we should know about. But when something really big happens, it’s somewhat hard to listen (to me at least), because they just try to find conspiracy in everything (like shooting in tuscon or wikileaks).

    Now I’ll go listen to some older techzings that I missed…

Trackbacks / Pings