Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- Refactor



  That’s Not TDD

A few months ago I was visiting a client who was having a lot of problems using TDD. “It takes over half an hour to run our unit tests,” he said. “You are not doing TDD,” I said. “In order for tests to be valuable all of them must run fast—within a few seconds, or developers will stop running tests frequently.” “But how to I make them run fast?” he asked, “Just connecting to the database takes 30 seconds” So I showed him a techn...

   TDD,Driver,QA,Model,Uncontrol,Method     2011-08-25 02:26:29

  JavaScript Needs Blocks

While reading Hacker News posts about JavaScript, I often come across the misconception that Ruby’s blocks are essentially equivalent to JavaScript’s “first class functions”. Because the ability to pass functions around, especially when you can create them anonymously, is extremely powerful, the fact that both JavaScript and Ruby have a mechanism to do so makes it natural to assume equivalence. In fact, when people talk about why Ruby’s blocks are different ...

   JavaScript,Block,Style,Format,Maintainebility     2012-01-11 11:59:35

  Writing API clients in Perl and Python

I recently released a couple of API clients for the Ge.tt file sharing service, one in Perl and one in Python. (I am just a fan of the service, not an employee or contractor.) I would judge myself an "intermediate" pythonista mostly due to inexperience. It's a culture shock coming from a background of CPAN. The old joke is that Perl is just a life support system for CPAN and that is arguably true, but I am here to tell you: you may not appreciate how good Perl hackers have it with respe...

   API,Perl,Python,API Writing,Pattern     2011-12-23 08:02:38

  Solving easy problems the hard way

There’s a charming little brain teaser that’s going around the Interwebs. It’s got various forms, but they all look something like this: This problem can be solved by pre-school children in 5-10 minutes, by programer – in 1 hour, by people with higher education … well, check it yourself!  8809=6 7111=0 2172=0 6666=4 1111=0 3213=0 7662=2 9313=1 0000=4 2222=0 3333=0 5555=0 8193=3 8096=5 7777=0 9999=4 7756=1 6855=3 9881=5 5531=0 2581=? SPOILER AL...

   Problem solving     2012-04-05 23:40:35

  The 7 stages of refactoring

You have wanted to fix that module for ages. Just one look at it and you cringe. The documentation, the weird naming of functions, classes that are just plain weird. The module hobbeles along, but it is just plain dirty. The real programmer in you cringe, and when there finally is some time to refactor the module, you jump at it. Step 1 - Desperation  So you start to have a real good look at what you need to. Fix a class here, rename a few functions there, tear out a few function...

   Refactoring,Software,Desperation     2011-08-16 08:35:57

  How to maintain a software project?

For a software engineer, at least from my own experience, maintaining an existing software project would take up a considerable amount of time: adding new features, fixing tricky bugs, and so on. In this post, I will share some some tips about how to become a veteran from a novice quickly when facing a new project. (1) Get familiar with the background knowledge of the project. Every software has its own purposes and users: a device driver serves the specified hardware, whilst a SMS gateway helps...

       2017-08-05 02:20:46

  10 habits of 10x developers

Last week, I discovered The Rise of Developeronomics via Brad Feld. As long as I’ve lived, it has always been a great time to be a software developer. The economics keep getting better for us. My favorite quote: The one absolutely solid place to store your capital today — if you know how to do it –  is in software developers’ wallets. If the world survives looming financial apocalypse dangers at all, this is the one investment that will weather the storms. ...

   Developer,Efficiency,Advice,Rest,Focus     2011-12-26 02:54:06

  How I Program Stuff

I love programming. I can truly say that of all the things I enjoy, I enjoy programming the most. There's nothing quite like the feeling you get when you create something. Writing code is a lot like building your own little universe. When you build stuff, you're in complete control, and, no matter how hard you fight it, your code directly reflects yourself. If you write sloppy code, I can almost guarantee you'll be a sloppy person. If you haphazardly throw code around with any ca...

   Programming,Steps,Isolate,Eliminate     2012-01-17 11:39:51

  I hate cut-and-paste

Me, I blame the IDE's.Coding used to be hard. Not because programming itself was overly hard, but mostly because editors absolutely sucked. How much the typical development environment in the 70's and 80's sucked is hard to convey (except for a very lucky few, and those would have likely been using DEC and WANG gear). I got in on the tail end of the punch card era. Punching your own program is lots of fun. Once. And if you drop a deck you get to play with the sorter, which is also lots of fun (o...

   IDE,Editor,Cut and paste,Shortcut,Blame     2011-10-24 11:33:46

  Game Development Essentials #1 - Don’t use inheritance for your game objects

I recently released my first game, X Fleet, available now in Android Market. It’s a fast paced space shooter / rpg riddled with awesomeness and you should get it now. The reason you should avoid hierarchies/inheritance is your objects will be far too varied and complicated in form to be accurately represented as such. More on this below.  The alternative is a component model. This is very basic. Instead of having everything inheriting (e.g. Object -> MovableObject -> Animat...

   Game design,OOP,Inheritence,Game object     2012-02-07 06:26:40