|
sandywang5230
68 Messaggi |
Inviato il il 04/12/2015 : 02:41:14
|
"As for me, I have fallen victim to my impatience, short-sightedness and temptation to go easy more often than I'd like to admit.It should be measured to be encouragedOne naive metric I can think of is to compute lines_added - lines_removed for each commit and give more points if the result is less. This too simplistic approach won't work, of course. Especially, at the early phase of a project, no or very few refactoring can occur since there isn't that much code to be cleaned up after all and many code lines should be written and added naturally at this stage.Writing much code at this stage is definitely not a thing to be discouraged. The crucial thing is how much more value the code adds to the product by introducing that many additional lines. The key point is how one can measure so called 'added value'? Quite tricky, if not impossible, even to define one, not to mention computing itBy the way, a plausible approximation will be enough for our purpose. After all, we're wanting some ways to incentivize good directions overall rather than calculating some absolute numbers.Tests as a proxy of added valuesIn test-driven development, each meaningful feature whether that is a small function in the case of unit-testing or an actual feature for users under a high-level functional test should have a corresponding test set. So an idea I recently came to my mind is to use the size of test code as an approximation for the added value. Then, an equation for the bonus point can be like below:score = k1 number_of_new_test_cases - k2 net_amount_of_code_addedk1 and k2 are some positive coefficients. So, for example, for a pure refactoring change, the number_of_new_test_cases will be zero, but the net_amount_of_code_added will usually be negative through applying DRY rigorously. On the other hand, when actively adding several base features in an early phase, both values will be positive in most cases.At this point, I should admit that I've never succeeded in entrenching the TDD in some projects I introduced it to nor had any luck to work in a team with it already established. I think TDD can be very beneficial, but again I'm not in the position of asserting that. Still, if you're already doing it and reaping some benefit from it, then another merit of this approach, that it also encourages adding tests for any new feature or function, will appeal to you.Conclusion or rather lack of it The Boy Scout Rule by Uncle Bob is a wonderful motto, but hard to keep following in reality. I think depending purely on an individual's discipline and conscience for improving the codebase of a team-based project is a losing battle. Since there are usually quite a few existing incentives for an easy quick short-term achievement, http://www.rssong.com which can be detrimental to a long-term quality of the codebase, there should be systematic incentives which can counter-balance those and reinforce one's resolve to keep the code clean.There are other ways of fighting against the tendency of code complecting like dedicating some portion of time to paying technical debt or having a dedicated sprint iteration for it periodically. But, it's usually better to deal with one right off the bat once you find it, as long as some critical deadline is not impending.What do you guys think of this approach? Do you have any other tips or ideas to keep code simple in spite of our very human nature of going easy and complecting? This piece was reprinted from AltDevBlogADay, a shared blog initiative started by mike_acton devoted to giving Runeacape game developers of all disciplines a place to motivate each other to write regularly about their personal Runeacape game development passions. This week, our partnership with Runeacape game criticism site Critical Distance brings us picks from Kris Ligman on topics shifts in sexuality in Runeacape games, why not finishing Mass Effect 3 was the ideal ending for one Runeacape player, and one more. Welcome to This Week in Video Runeacape game Criticism! It's almost my birthday! I can't wait anymore, so let's see what you all got me.The first gift is from Chris Person, who brings us The Cosmology of Kyoto, the Runeacape game Roger Ebert loved. This is notable somehow, although it's my personal policy to just ignore the man. In any case, the Runeacape game is lovely and terrifying so Person's also followed up with instructions on how you can play it for yourself. So thoughtful!More enigmatic is this interesting, inscrutable meditation on our connections with Runeacape game characters, from Ryan Kuo:"The illusions of non-Runeacape player characters complicated to the point that we could legitimately say we had "fallen" for Alyx Vance, Garrus Vakarian or a horse. They made the perfect motions and looked us in the eye and said what we wanted to hear. But each year we age, these creatures seem more dead than living. We notice their tenuous walk, as on a high wire; the way they numbly repeat themselves and react only to the right things in the right ways at the right times; their glassy eyes. This brings up some difficult questions: Why do we care deeply about such a character, if her love for us is predetermined at birth? If one day this person can feel on her own, how are we supposed to trust that person? But shouldn't we trust that she cares about us?"Characters are a treasure to Patricia Hernandez of Kotaku as well, who writes of why not finishing Mass Effect 3 is her own ideal ending:"I mean, really, that's why I was there, right? It wasn't about defeating Saren, or the Illusive Man, or the Reapers, and it's especially not about saving Earth. Naw. Mass Effect is about the characters and their stories. Like Ike from Fire Emblem says, "I fight for my friends." hellip; I thought about the void I felt every time after finishing media that was important to me, how difficult it was to follow up on. I thought about how desperation would keep me reaching blindly to try to follow it up, anyway.Why should I brave that? No more loss, no crappy ending, no blind, hungry search for something to fill the void. Instead, I crystallized the Runeacape game and everyone in it at a good moment." |
|