<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5691742980190810543</id><updated>2011-07-28T11:08:46.994-07:00</updated><category term='SOLID'/><category term='game development'/><category term='Hansel Minutes'/><category term='final fantasy'/><category term='TDD'/><category term='Software Engineering'/><category term='unit test'/><category term='video games'/><category term='Miyamoto Musashi'/><category term='soul calibur'/><category term='programming'/><category term='tactics'/><category term='range'/><category term='Uncle Bob'/><category term='mock'/><category term='strategy'/><category term='book of five rings'/><category term='tekken'/><category term='dragon warrior'/><category term='mockito'/><category term='sandbagging'/><category term='fighting games'/><title type='text'>Strats and Tacts</title><subtitle type='html'>This is a blog about strategies and tactics I have learned, mostly from my experience of playing 3D fighting games and reading classic strategy books.  Oh... and Java.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://tietyt.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5691742980190810543/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://tietyt.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Date Hater</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_tb5EVNwXqj0/TMYLZtsweUI/AAAAAAAAABM/2xPkAUmGLp8/S220/angry_heart_bigger.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5691742980190810543.post-4881431255589615945</id><published>2009-03-26T17:40:00.000-07:00</published><updated>2009-04-07T11:32:29.460-07:00</updated><title type='text'>The top 8 reasons I don't use Wicket</title><content type='html'>A few months ago I knew I was going to make a hobby website. In preparation I decided to learn a new Java web framework.  Wicket had a lot of hype around it in the #java channel so I figured I should give it a shot.  Along the way, I created 2-3 work projects, 2 practice hobby projects and 2 open source libraries for it.  All in all, I spent about 5 months using it and frankly, it was a terrible experience.  This article will explain my complaints, but first, I will give you a little introduction to the framework.&lt;br /&gt;&lt;br /&gt;In a typical web framework, you write a template that's more-or-less HTML, but with special code to make it dynamic.  For example, here's how to print "Hello World" in php:&lt;br /&gt;&lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote style="font-weight: bold; font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;NOTE: I am NOT saying that PHP is better than Wicket.  I'm just EXPLAINING how Wicket works compared to other frameworks and using PHP as an example of another framework.&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;PHP Test&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&amp;lt;?php echo '&amp;lt;p&amp;gt;Hello World&amp;lt;/p&amp;gt;'; ?&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;In the &amp;lt;?php ?&amp;gt; tag, you specify what HTML will be generated.  Wicket works in a different way. You mark the dynamic parts of your HTML with a special attribute and specify what it does in Java code.  Here's the same example in Wicket:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;Wicket Test&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&amp;lt;p wicket:id="message"&amp;gt;This is replaced&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And then in a Java class:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class HelloWorldPage extends WebPage {&lt;br /&gt;public HelloWorldPage() {&lt;br /&gt;Label component = new Label("message", "Hello World!");&lt;br /&gt;add(component);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;By comparison the html template is simplified: You define the parts that are dynamic but you don't say what the dynamic parts will do. That's done entirely in the Java code.  If you learn more about Wicket, you'll see that your Java code ends up looking similar to Swing code (Swing is Java's GUI API).&lt;br /&gt;&lt;br /&gt;Before I go on to explain the top 8 reasons to NOT use Wicket, I want to say that there is one situation where I would still use it: If a large part of my webapp functioned like a wizard.  Wicket makes it easy to keep track of state from page to page without persisting at each step.  With a traditional framework, you have to manipulate the session or use hidden fields to accomplish this.&lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:180%;"&gt;1. Documentation, documentation... documentation?&lt;/span&gt;&lt;br /&gt;By far my biggest complaint about Wicket stems from problems with its documentation.  Imagine this: You get stuck on an issue and have no idea why.  First you search the official wiki.  You try your hardest to find a section to answer your question but it doesn't seem to be there.  On the other hand, it's so badly organized you may have just missed it.  You &lt;span style="font-weight: bold;"&gt;guess &lt;/span&gt;it's not there and move on to the examples.&lt;br /&gt;&lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;The examples can be useful, but there's a lot to be desired.  Exercise: Visit &lt;a href="http://www.wicketstuff.org/wicket13/"&gt;http://www.wicketstuff.org/wicket13/&lt;/a&gt; and try to find an example that shows you how to redirect to a different page after you submit a form.  I had to ask in the IRC channel to figure out how to do that.  It also doesn't help that there are two example pages.  One is on the main site, and another (much more useful, I might add) that's on &lt;a href="http://www.blogger.com/wicketstuff.org"&gt;wicketstuff.org&lt;/a&gt; (but good luck finding these examples on the &lt;a href="http://www.blogger.com/wicketstuff.org"&gt;wicketstuff.org&lt;/a&gt; home page).  &lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Lets say the examples didn't help so you move on to the Javadocs.  No help there: The class in question and its methods are barely documented.  Take a look at this gem: &lt;a href="http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/SharedResources.html"&gt;http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/SharedResources.html &lt;/a&gt; At least this time it's obvious the answer isn't there.&lt;br /&gt;&lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;Time to move on to the mailing list archives.  You discover that Wicket's mailing list is extremely active and is often the &lt;span style="font-weight: bold;"&gt;only&lt;/span&gt; source for answers.  Here's the downside to that: 1) A mailing list is not the right environment to learn a framework.  A mailing list is for situations where you more-or-less "get" the technology, but are unsure of a few things.  2) It's hard to find mailing list answers by Googling.  Think about it, how often do people link to a mailing list threads?  Almost never.  That leads to poor page ranking and that means the answer to your question, even if it's there, is hard to find.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;2. High learning curve&lt;/span&gt;&lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;Even if the documentation was well written and complete, Wicket would &lt;span style="font-style: italic;"&gt;still &lt;/span&gt;be harder to learn than most frameworks.  Lets look at how to solve some basic problems using the example above:&lt;br /&gt;&lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;How do hide a dynamic tag?  c&lt;span style="font-weight: bold;"&gt;omponent.setVisible(false)&lt;/span&gt;.  How do I dynamically add a class attribute to the tag? &lt;span style="font-weight: bold;"&gt;component.add(new SimpleAttributeModifier(“class”, “classValue”));&lt;/span&gt;  How do I dynamically add a CSS file to my template? &lt;span style="font-weight: bold;"&gt;webpage.add(HeaderContributor.forCss("/path/to/my.css"); &lt;/span&gt; Do you see the problem?  It's subtle.&lt;br /&gt;&lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;Knowing the answer to one of these does not help you in answering the others and each one of these questions requires you to deal with part 1.  On the other hand, as soon as you learn how to write a conditional in PHP/JSP/ROR, you immediately know the answer to all of these questions and many more in the future.&lt;br /&gt;&lt;br /&gt;Let's try an example together: How would you make a page's title dynamic in Wicket?  Is it &lt;span style="font-weight: bold;"&gt;webPage.setTitle(String)&lt;/span&gt;?  Nope, &lt;a href="http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/WebPage.html"&gt;that doesn't exist&lt;/a&gt;.  In fact, the word title isn't even mentioned in the javadoc.  Ok, dead end #1.  Perhaps it's &lt;span style="font-weight: bold;"&gt;webPage.add(new Title(...));&lt;/span&gt; or something like that.  Nope, there's no such thing as a Title class.  In fact, the word Title isn't even part of any class in the javadoc.  Dead end #2.  That also rules out something like &lt;span style="font-weight: bold;"&gt;webPage.add(TitleContributor...);&lt;/span&gt; Dead end #3.&lt;br /&gt;&lt;br /&gt;So, how the heck do you actually do this in wicket?  The only answer I can find is &lt;span style="font-weight: bold;"&gt;webPage.add(new Label("wicketId", "dynamicTitle");&lt;/span&gt;.  You add a Label to your page that attaches to your &amp;lt;title&amp;gt; tag and overwrites the text.  Duh!&lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:180%;"&gt;3. Different... not better, but different&lt;/span&gt;&lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;In my 5 months with wicket, there was no indication that it was a time saver.  Wicket seems more about making a webapp in a &lt;span style="font-style: italic;"&gt;different&lt;/span&gt; way than in a productive way.  Compared to a framework like Struts or Ruby on Rails, Wicket probably decreased my template code by 4x but increased my Java code by 4x.  I ended up doing the same amount of work, just in a different place.&lt;br /&gt;&lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;If you consider writing template code to be traumatic experience, perhaps you'll see this as a huge improvement.  But, if you're like me, you'll think that a webframework should help you write less code.  Writing less code has a lot of benefits.  There's less to understand, less to maintain, less work to add a feature, etc.  &lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Perhaps these time saving features exist and I overlooked them.  Unfortunately, Wicket doesn't have an official list of, "Cool features that will save you tons of time" anywhere, so you'll likely have the same experience as me.  But, I did read most of "&lt;a href="http://www.amazon.com/Wicket-Action-Martijn-Dashorst/dp/1932394982/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1238116126&amp;amp;sr=8-1"&gt;Wicket In Action&lt;/a&gt;" (great book for learning Wicket, BTW), and it didn't change my impression.&lt;br /&gt;&lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:180%;"&gt;4. Lacking 3rd party library support&lt;/span&gt;&lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;Getting 3rd party libraries to work in Wicket is more annoying than other frameworks.  By 3rd party libraries, I mean external tools that add content to your website that may or may not care about the programming language you use.  Things like ReCaptcha to add a captcha to your site, the Facebook API for making a Facebook app, or Rome to add a RSS feed to your site.  Fortunately, there are Wicket extensions for these examples (I made the first two), but unless you make your entire webapp from scratch, you're bound to run into others that aren't.  With Wicket, getting these libs to work can be painful and confusing.&lt;br /&gt;&lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;Lets look at ReCaptcha to see why.  With ReCaptcha, you add a &lt;span style="font-weight: bold;"&gt;&amp;lt;script&amp;gt;&lt;/span&gt; tag to your webpage that refers to an external javascript file. When it loads, the script generates a captcha and an input field for you.  When the user submits the page, you take the input and ask the ReCaptcha server, "User typed this, is that what was displayed?".&lt;br /&gt;&lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;With most frameworks, this is an easy way to add a captcha to a website.  With Wicket, it's a challenge.  Since you didn't include this input in your template (remember, Wicket needs a wicket:id attribute on input fields too) and you didn't put &lt;span style="font-weight: bold;"&gt;add(new TextField("recaptchInput")); &lt;/span&gt;in your Java code, Wicket is unaware of the input.  As a consequence, you can't leverage any framework features.  This includes essentials like retrieving the value so you can pass it to the ReCaptcha server.&lt;br /&gt;&lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;For those wondering "Why doesn't he just put it in his template and add the Java code?", that won't work: The ReCaptcha script would just generate &lt;span style="font-style: italic;"&gt;another &lt;/span&gt;input field for you and cause the same problem.  &lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;What's the solution?  You need to reach into the &lt;a href="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpServletRequest.html"&gt;HttpServletRequest&lt;/a&gt; and extract the value by hand.  Most frameworks, including Wicket, consider this a primitive way to get data from a user response.  Yet, as far as I can tell, it's what you have to resort to.&lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:180%;"&gt;5. Generate HTML or generate pain&lt;/span&gt;&lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;Sometimes you want the server to generate something other than HTML.  For example, you may want to generate Javascript or CSS.  EG: &lt;span style="font-weight: bold;"&gt;var message = "dynamicString";  &lt;/span&gt;To make the string dynamic, the template would have to say &lt;span style="font-weight: bold;"&gt;var message = &amp;lt;span wicket:id="dynamicString"&amp;gt;localized alert&amp;lt;/span&amp;gt;;  &lt;/span&gt;You have to do similar things in your CSS files to make them dynamic: &lt;span style="font-weight: bold;"&gt;.highlight { &amp;lt;span wicket:id="highlight"&amp;gt;highlight style&amp;lt;/span&amp;gt; }&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Unless your editor speaks Wicket, this will drive it nuts.  Not only will the dynamic bits be more verbose than a typical framework, they'll look more out of place.  "Why is this HTML embedded in this CSS file?".&lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:180%;"&gt;6. Easier to maintain?&lt;/span&gt;&lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;One of Wicket's selling points is that it's far easier to maintain than other frameworks because you write most of your code in Java.  I think that's debatable.  Is 4x more Java code more maintainable (see part 3)?  The code you write ends up looking like Swing code so unless you're very disciplined, you end up writing anonymous and inner classes all over the place that share instance variables with the parent class.  Once that happens, it's a real chore to refactor them to outer classes.&lt;br /&gt;&lt;br /&gt;If you put in the effort to avoid these pitfalls, your code may be more maintainable.  But a framework is supposed to facilitate discipline, not put the burden on the developer.  With Wicket I found myself thinking, "OK, how can I add that feature without it turning into a mess later?".  I'd prefer to just focus on the feature itself.  If I wanted to focus on proper discipline, I would've stuck with JSPs and Servlets in the first place.  This goes back to the question, "What is this framework doing to make my life easier?"&lt;br /&gt;&lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:180%;"&gt;7. The "Great for web designers" myth&lt;/span&gt;&lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;Wicket is supposed to be nice for web designers because it doesn't use template code.  You just put a &lt;span style="font-weight: bold;"&gt;wicket:id="something"&lt;/span&gt;  on the HTML you want to be dynamic and replace it in your Java code.  The end result is your HTML is perfectly understandable by a web designer who doesn't know the first thing about Java.  While Wicket may be better than other frameworks in this respect, it still has problems.&lt;br /&gt;&lt;br /&gt;For instance, Wicket has non-HTML tags for special functionality with names like &lt;span style="font-weight: bold;"&gt;&amp;lt;wicket:panel&amp;gt;&lt;/span&gt;, &lt;span style="font-weight: bold;"&gt;&amp;lt;wicket:child&amp;gt;&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;&amp;lt;wicket:extend&amp;gt;&lt;/span&gt;.&lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;i id="brzj0"&gt;&lt;/i&gt;&lt;/span&gt;   These won't render correctly in a browser.  If you research the last one, you'll see you must violate the "Don't Repeat Yourself" principle to get your pages to render outside the browser in a way that looks similar to its production code.&lt;br /&gt;&lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;In general, Wicket is better than most frameworks in this respect.  But, when you consider part 5, it can sometimes be worse than most.  &lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:180%;"&gt;8. Search Engine De-optimization&lt;/span&gt;&lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;By default, the URLs Wicket uses look like this: http://www.startfound.com/?wicket:interface=:3::::  For a search engine, this is a problem for two reasons:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;This URL provides no semantic information &lt;/li&gt;&lt;li&gt;This URL is only valid for &lt;span style="font-style: italic;"&gt;that &lt;/span&gt;user's session. &lt;/li&gt;&lt;/ol&gt; This second point is really important: If google indexes http://www.startfound.com/?wicket:interface=:3::::, when users follow the link, they'll be taken to a "Page Expired" error page.  It's not a great first impression.  You could make your URL look pretty like this: http://www.startfound.com/home, but that requires using a Wicket concept called "bookmarkable URLs".  Hopefully, the name is self explanatory but they bring with them a &lt;span style="font-weight: bold;"&gt;big&lt;/span&gt; downside.&lt;br /&gt;&lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;There are Wicket classes that won't work with bookmarkable URLs.  For example, if you want to use the Wicket "paginator"  (think the bottom of Google search results), your URLs have to look ugly.  So if you want pagination on your site with pretty URLs, you're going to have to write it yourself.  And that goes for a lot of its other APIs.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;Conclusion&lt;/span&gt;&lt;br /&gt;There was a point while working on my hobby website that I was pulling my hair out dealing with these issues on a &lt;span style="font-weight: bold;"&gt;daily basis&lt;/span&gt;.  Finally, I had enough and came to the conclusion that it was smarter to rewrite the whole thing from scratch in another framework.&lt;br /&gt;&lt;span id="lryz0"  style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;I chose what I'd consider to be the exact opposite of Wicket: &lt;a href="http://www.stripesframework.org/display/stripes/Home"&gt;The Stripes Framework&lt;/a&gt;.  During and since the rewrite, I couldn't be happier with my choice.  When it comes to ease of use, quality documentation, simplicity and productivity, I've never worked with a better web framework.  Let me state that I'm not affiliated with the Stripes framework, I'm just a huge fan.  I have experience with Struts, Ruby on Rails, plain old JSPs and Servlets and, of course, Wicket, and the Stripes framework is by far the best web framework I've ever worked with.&lt;br /&gt;&lt;br /&gt;One last note on Wicket: Of all those projects I created while learning it, there was one where I feel Wicket was the right choice (the whole thing was basically a Wizard).  So in the end, I consider Wicket to be a hammer in my tool belt.  Unfortunately, most jobs I come across require a screwdriver.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;You can see my follow up blog post that compares Wicket and Stripes in depth here: &lt;/span&gt;&lt;a href="http://www.assertinteresting.com/2009/03/why-i-prefer-stripes-over-wicket/"&gt;http://www.assertinteresting.com/2009/03/why-i-prefer-stripes-over-wicket/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5691742980190810543-4881431255589615945?l=tietyt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tietyt.blogspot.com/feeds/4881431255589615945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5691742980190810543&amp;postID=4881431255589615945' title='80 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5691742980190810543/posts/default/4881431255589615945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5691742980190810543/posts/default/4881431255589615945'/><link rel='alternate' type='text/html' href='http://tietyt.blogspot.com/2009/03/top-8-reasons-i-dont-use-wicket.html' title='The top 8 reasons I don&apos;t use Wicket'/><author><name>Date Hater</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_tb5EVNwXqj0/TMYLZtsweUI/AAAAAAAAABM/2xPkAUmGLp8/S220/angry_heart_bigger.jpg'/></author><thr:total>80</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5691742980190810543.post-2254216358248317054</id><published>2009-03-21T01:41:00.000-07:00</published><updated>2009-03-21T03:39:15.831-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dragon warrior'/><category scheme='http://www.blogger.com/atom/ns#' term='final fantasy'/><category scheme='http://www.blogger.com/atom/ns#' term='game development'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>The difficulty of designing a Final Fantasy-like battle system</title><content type='html'>I haven't mentioned this before, but in my free time, I've been developing a game.  It's a turn based game like Final Fantasy / Dragon Warrior, but you play online with other people.  You control a party of people and fight against another party of people.  When one character is choosing his ability, game time freezes.  Once he chooses his ability, he chooses a target to use it on.  Then, time progresses a "tick": he performs his ability and the next character in the queue repeats the process.  This is all pretty standard stuff and not too difficult to design. But...&lt;br /&gt;&lt;br /&gt;The part that was / is hard for me to design is the concept of an &lt;span style="font-weight: bold;"&gt;Ability&lt;/span&gt;.  Let me show you some examples of abilities that will exist in my game.  I've highlighted and numbered some key points on each ability that I will discuss in detail:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;Attack&lt;/span&gt;&lt;/span&gt;: &lt;span&gt;&lt;span&gt;One of the simplest abilities.  When you use this on a target, it causes  &lt;span style="font-weight: bold;"&gt;(1) immediate damage &lt;/span&gt;to him.  This &lt;span style="font-weight: bold;"&gt;(2)&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;costs no MP (magic points)&lt;/span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;Poison: When you use this on a target, he will be &lt;span style="font-weight: bold;"&gt;(1) damaged over time&lt;/span&gt;, when it's his turn to pick an ability.  It &lt;span style="font-weight: bold;"&gt;(2) costs some MP&lt;/span&gt;.  It's affect &lt;span style="font-weight: bold;"&gt;(3) lasts a certain amount of the target's&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;turns&lt;/span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;Blink: The target of this ability (generally a teammate), cannot be hit by physical attacks.  &lt;span style="font-weight: bold;"&gt;(3) After the 3rd physical attack&lt;/span&gt; that misses, the effect disappears. &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;Cover: When you use this on a target (generally a teammate), the &lt;span style="font-weight: bold;"&gt;(4) user&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;will take damage instead of the target&lt;/span&gt; if another character attacks the target&lt;span style="font-weight: bold;"&gt; (5) with a physical attack&lt;/span&gt;.  It's effect only &lt;span style="font-weight: bold;"&gt;(3) lasts until the user's&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;next turn.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;Reflect: When you use this on a target and another character&lt;span style="font-weight: bold;"&gt; (5)&lt;/span&gt;  &lt;span style="font-weight: bold;"&gt;uses a spell&lt;/span&gt; on him, the spell will reflect off of the target and &lt;span style="font-weight: bold;"&gt;(4) affect the caster instead&lt;/span&gt;.  Since this can reflect helpful and harmful spells, it can be &lt;span style="font-weight: bold;"&gt;(6) used offensively or defensively&lt;/span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;Defense: This ability &lt;span style="font-weight: bold;"&gt;(7) halves physical damage&lt;/span&gt;, but this can &lt;span style="font-weight: bold;"&gt;(6) only be used on yourself&lt;/span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;Economizer (This is usually an item, but in my game it'll be an ability): The target's &lt;span style="font-weight: bold;"&gt;(2) MP cost is reduced &lt;/span&gt;to 1, regardless of the ability.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;&lt;span&gt;Bad Breath: This casts &lt;span style="font-weight: bold;"&gt;(8) mulitiple&lt;/span&gt;, and often random, ailments&lt;/span&gt;&lt;/span&gt; on the target (eg: poison, silence, blindness).&lt;/li&gt;&lt;/ul&gt;Ugh, that's a lot of bold.  So, what did we learn?  Well...&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Some abilities have an immediate effect, others last for a duration.&lt;/li&gt;&lt;li&gt;Some abilities abilities cost MP, but others don't.  And, there are some abilities that alter the MP costs of other abilities.&lt;/li&gt;&lt;li&gt;Some ability's duration is based on the user's turn, some is based on the target's turn.  Sometimes it's based on how many times you get attacked.  Sometimes it's a combination of these (eg: an ability could last for 3 attacks or 6 turns, whatever occurs first).  The possibilities on this are endless.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Sometimes the target of an ability is not the character that gets affected by it.  For example; if you cast Fire on someone with reflect, Fire isn't cast on him, it's cast on you!&lt;/li&gt;&lt;li&gt;The trigger of an effect can vary from ability to ability.  For example, reflect is &lt;span style="font-style: italic;"&gt;only&lt;/span&gt; triggered by spells.  If you Attack someone who is effected by Reflect, Reflect isn't triggered.  But, if that character was effected by Cover, Cover &lt;span style="font-style: italic;"&gt;would&lt;/span&gt; have been triggered.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Some abilities can only be used on yourself, some can only be used on your enemies and some can only be used on your friends.&lt;/li&gt;&lt;li&gt;An ability's damage is not a constant but can change depending on the other abilities that have been used on the target.  Note the similarity between this and #2&lt;br /&gt;&lt;/li&gt;&lt;li&gt;An ability can have multiple effects.  In other words, sometimes using one ability is like using a combination of abilities simultaneously.  &lt;/li&gt;&lt;/ol&gt;Basically, the Ability is a God class.  It could (and should) be able to do almost anything you can think of (and anything you haven't thought of, yet).  As you can imagine, it's very hard to design a class with requirements that are basically, "It should be able to do anything". &lt;br /&gt;&lt;br /&gt;In my next article, I will talk about the solution I came up with.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5691742980190810543-2254216358248317054?l=tietyt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tietyt.blogspot.com/feeds/2254216358248317054/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5691742980190810543&amp;postID=2254216358248317054' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5691742980190810543/posts/default/2254216358248317054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5691742980190810543/posts/default/2254216358248317054'/><link rel='alternate' type='text/html' href='http://tietyt.blogspot.com/2009/03/difficulty-of-designing-final-fantasy.html' title='The difficulty of designing a Final Fantasy-like battle system'/><author><name>Date Hater</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_tb5EVNwXqj0/TMYLZtsweUI/AAAAAAAAABM/2xPkAUmGLp8/S220/angry_heart_bigger.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5691742980190810543.post-7829154094995835533</id><published>2009-03-10T23:28:00.000-07:00</published><updated>2009-03-13T14:33:05.992-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mock'/><category scheme='http://www.blogger.com/atom/ns#' term='mockito'/><category scheme='http://www.blogger.com/atom/ns#' term='unit test'/><category scheme='http://www.blogger.com/atom/ns#' term='TDD'/><title type='text'>What are mock objects, why do I love them, and why do I use Mockito?</title><content type='html'>What's a mock object?  Here's &lt;a href="http://en.wikipedia.org/wiki/Mock_object"&gt;Wikipedia's definition&lt;/a&gt;:&lt;br /&gt;&lt;blockquote&gt;In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways.  A computer programmer typically creates a mock object to test the behavior of some other object&lt;/blockquote&gt;When you write a unit test, you want to try and focus on testing a single class.  But, in any complex system, classes use other classes.  So, in that situation, how do you just test &lt;span style="font-style: italic;"&gt;one &lt;/span&gt;class?  You separate class creation from class usage: The class you're trying to test never contains the "new" keyword.  Instead, it receives the classes it depends on through it's constructor or setters (the formal term for this is &lt;a href="http://martinfowler.com/articles/injection.html"&gt;Dependency Injection&lt;/a&gt;).  So your code that used to look like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;public void useDependency() {&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;  new&lt;/span&gt; Dependency().useDependency();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;Now looks like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="font-weight: bold;"&gt;public void setDependency(Dependency dependency) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;  this.dependency = dependency;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;public void useDependency() {&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;  this.dependency&lt;/span&gt;.useDependency();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;Yes, there's a little bit more code, but now it's easy to test.&lt;br /&gt;&lt;br /&gt;In &lt;a href="http://www.michaelfeathers.com/"&gt;Michael Feather&lt;/a&gt;'s book, &lt;a href="http://www.amazon.com/Working-Effectively-Legacy-Robert-Martin/dp/0131177052/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1236753439&amp;amp;sr=8-1"&gt;Working Effectively With Legacy Code&lt;/a&gt;, he describes the difference between a &lt;span style="font-weight: bold;"&gt;Mock&lt;/span&gt; and a &lt;span style="font-weight: bold;"&gt;Fake&lt;/span&gt; object.  A mock object verifies its own state is correct.  A fake object, on the other hand, has its state tested by an external object (typically the testcase it's created in).&lt;br /&gt;&lt;br /&gt;Before I discovered &lt;a href="http://code.google.com/p/mockito/"&gt;Mockito&lt;/a&gt;, I got by with &lt;span style="font-weight: bold;"&gt;Fake&lt;/span&gt; objects.  Fake objects have some problems though.  The main problem is you have to make them yourself.  If you need a fake interface, but you're only testing one method, you still have to manually stub out all the other methods.&lt;br /&gt;&lt;br /&gt;For example, I'm making a Swing app and when I wrote test cases for my client, I had to make a fake &lt;a href="http://java.sun.com/javase/6/docs/api/java/awt/Graphics.html"&gt;Graphics&lt;/a&gt; object.  With &lt;span style="font-style: italic;"&gt;just&lt;/span&gt; stub methods, this class is about 300 lines!&lt;br /&gt;&lt;br /&gt;So then I tried &lt;a href="https://jmockit.dev.java.net/"&gt;JMockit&lt;/a&gt;, but I had some major complaints.  It's tutorial is horrid and scattered all over the place.  Whenever I tried to use it, I &lt;span style="font-style: italic;"&gt;always&lt;/span&gt; had to open its documentation after realizing I wasn't using it correctly. What makes this worse is it's not easy to discover you're using it incorrectly! If you do something wrong, it'll usually return null instead of throwing an exception.  99% of the time, you pass this null pointer into a setter and you eventually get a NullPointerException in the middle of your test.  Why doesn't it fail immediately?  Also, it seems like you have to use different API calls for mocking concrete classes vs interfaces (or maybe it doesn't work with concrete classes.  Here's a fun exercise: See if you can figure that out on your own.  See what I mean by the horrid documentation?).  Plus, you need special VM arg to run it.&lt;br /&gt;&lt;br /&gt;JMockit has one redeeming quality (that's actually very cool): It lets you inject classes even if you're not using dependency injection.  At first that may not seem possible, but check out its "documentation" to see how.  For this reason, I would still use this library if I was trying to test crappy legacy code that I was terrified to change in any way.&lt;br /&gt;&lt;br /&gt;Next, I looked at &lt;a href="http://www.easymock.org/EasyMock2_4_Documentation.html"&gt;EasyMock&lt;/a&gt; for about 3 minutes.  I couldn't figure it out with that amount of time so I moved on (I know, not a fair review, but at least an honest one).&lt;br /&gt;&lt;br /&gt;Then, by luck, I stumbled upon this &lt;a href="http://blog.jayfields.com/2008/11/things-to-dislike-about-java.html"&gt;controversial, unrelated article&lt;/a&gt; and in a &lt;span style="font-style: italic;"&gt;comment&lt;/span&gt; I saw a reference to &lt;a href="http://code.google.com/p/mockito/"&gt;Mockito&lt;/a&gt;.  I checked it out and it turns out to be the best of all worlds.  It saves you from writing fakes, it's documentation/API is concise, consistent and without ambiguity, it doesn't require extra VM arguments, and, you can learn it in under 3 minutes.&lt;br /&gt;&lt;br /&gt;I highly recommend it to anyone who's writing unit tests. It saves me a lot of time while simultaneously making my code more readable.&lt;br /&gt;&lt;br /&gt;BTW, if you're already using EasyMock, here's a Mockito article on &lt;a href="http://code.google.com/p/mockito/wiki/MockitoVSEasyMock"&gt;Mockito VS EasyMock&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5691742980190810543-7829154094995835533?l=tietyt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tietyt.blogspot.com/feeds/7829154094995835533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5691742980190810543&amp;postID=7829154094995835533' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5691742980190810543/posts/default/7829154094995835533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5691742980190810543/posts/default/7829154094995835533'/><link rel='alternate' type='text/html' href='http://tietyt.blogspot.com/2009/03/what-are-mock-objects-why-do-i-love.html' title='What are mock objects, why do I love them, and why do I use Mockito?'/><author><name>Date Hater</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_tb5EVNwXqj0/TMYLZtsweUI/AAAAAAAAABM/2xPkAUmGLp8/S220/angry_heart_bigger.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5691742980190810543.post-24473675469175592</id><published>2009-03-08T15:39:00.000-07:00</published><updated>2009-03-08T16:12:46.771-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='soul calibur'/><category scheme='http://www.blogger.com/atom/ns#' term='fighting games'/><category scheme='http://www.blogger.com/atom/ns#' term='Miyamoto Musashi'/><category scheme='http://www.blogger.com/atom/ns#' term='book of five rings'/><title type='text'>Sticking Tight</title><content type='html'>In &lt;span style="font-style: italic;"&gt;The Book of Five Rings&lt;/span&gt;, Miyamoto Musashi has a section called "Sticking Tight".&lt;br /&gt;&lt;blockquote&gt; ...When you and your opponents have taken sides and are facing off and it is not clear who will prevail, right then and there you stick tight to the opponents, so that you cannot be separated, and in that process find the advantage...&lt;br /&gt;&lt;/blockquote&gt;This is often a very good strategy in video games, too.  When I'm playing against someone who's giving me trouble, I often change my goal to get close to him, wait, and see how he reacts. By not attacking, he'll typically respond with confusion, then panic.  In the panic stage, he'll hack together a spur of the moment attack which is easy to interrupt.&lt;br /&gt;&lt;br /&gt;There is a Soul Calibur player named Semi who often just runs into his opponent after an exchange.  This leaves Semi completely vulnerable but it has been the source of many victories.  How can he succeed with a strategy that by all explanation is completely foolish?&lt;br /&gt;&lt;br /&gt;It's the state of confusion it causes.  No one in the right mind would do this so it takes a while for the opponent to realize what's happening.  By the time he does, he's already been pushed to the edge of the ring and Semi has a good chance of knocking him out.  Not only does this strategy work, it's completely demoralizing.&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5691742980190810543-24473675469175592?l=tietyt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tietyt.blogspot.com/feeds/24473675469175592/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5691742980190810543&amp;postID=24473675469175592' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5691742980190810543/posts/default/24473675469175592'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5691742980190810543/posts/default/24473675469175592'/><link rel='alternate' type='text/html' href='http://tietyt.blogspot.com/2009/03/sticking-tight.html' title='Sticking Tight'/><author><name>Date Hater</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_tb5EVNwXqj0/TMYLZtsweUI/AAAAAAAAABM/2xPkAUmGLp8/S220/angry_heart_bigger.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5691742980190810543.post-1319604220086028653</id><published>2009-03-04T23:21:00.000-08:00</published><updated>2009-03-05T00:16:49.865-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tactics'/><category scheme='http://www.blogger.com/atom/ns#' term='strategy'/><category scheme='http://www.blogger.com/atom/ns#' term='soul calibur'/><category scheme='http://www.blogger.com/atom/ns#' term='fighting games'/><category scheme='http://www.blogger.com/atom/ns#' term='video games'/><category scheme='http://www.blogger.com/atom/ns#' term='tekken'/><category scheme='http://www.blogger.com/atom/ns#' term='sandbagging'/><title type='text'>The Art of Sandbagging</title><content type='html'>&lt;a href="http://en.wikipedia.org/wiki/Slow_play_%28poker%29"&gt;Sandbagging&lt;/a&gt; in poker is the opposite of a bluff: You try to make yourself look weaker than you really are.  This post will explain when and where to use this strategy and follow up with some personal examples of how to win with it.&lt;br /&gt;&lt;br /&gt;Lets assume your long term goal is to win an upcoming tournament and you have an opportunity to play against the toughest competitor beforehand.  You can use this time to make your opponent &lt;span style="font-style: italic;"&gt;think&lt;/span&gt; they know how to beat you. You do this by intentionally playing worse than you really will in the tournament.&lt;br /&gt;&lt;br /&gt;When you play that person, they will come into the fight with a strategy based on the way you&lt;span style="font-style: italic;"&gt; pretended&lt;/span&gt; to play.  When nothing he planned works, it will be completely demoralizing and surprising to him.  Generally, a tournament match doesn't last long enough to recover from this shock.&lt;br /&gt;&lt;br /&gt;Here are some real examples I've used in the past:  A very important Tekken 4 tournament was coming up and the night before, I played against the person I was most worried about.  Every time he threw me or jabbed me (you beat these by ducking) I let it damage me.  I intentionally picked these moves because my character had very damaging moves that go under attacks.  Naturally, when we played in the tournament, he ended up using the exact opposite strategy against me that he should have, and lost.&lt;br /&gt;&lt;br /&gt;The night before a big Soul Calibur 3 tournament, I played some of the people I was most concerned about.  My character happened to have very annoying pokes that were hard to interrupt.  During these sessions, I played super aggressively and used these pokes whenever possible.  Here you can see my goal wasn't to look worse than I was, just that 1) my character has really annoying pokes 2) the pokes are very effective.  I believe these people spent the rest of their time trying to figure out how to beat the combinations I was using.&lt;br /&gt;&lt;br /&gt;But, during the matches that mattered, these people were trying to beat an exchange that was never coming.  I switched my strategy to one of "wait and interrupt".  They kept on trying to bait me into poking them and I kept on backing up and keeping them out.  After the tournament, this person wanted to play me again to prove to himself (and others that watched) that he figured out how to beat me.&lt;br /&gt;&lt;br /&gt;Although he didn't win the tournament, he believed that if he played me again, things would go very differently.  Of course, he had no idea that I sandbagged &lt;span style="font-style: italic;"&gt;after&lt;/span&gt; the tournament, too.  :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5691742980190810543-1319604220086028653?l=tietyt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tietyt.blogspot.com/feeds/1319604220086028653/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5691742980190810543&amp;postID=1319604220086028653' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5691742980190810543/posts/default/1319604220086028653'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5691742980190810543/posts/default/1319604220086028653'/><link rel='alternate' type='text/html' href='http://tietyt.blogspot.com/2009/03/art-of-sandbagging.html' title='The Art of Sandbagging'/><author><name>Date Hater</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_tb5EVNwXqj0/TMYLZtsweUI/AAAAAAAAABM/2xPkAUmGLp8/S220/angry_heart_bigger.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5691742980190810543.post-3850294594974483868</id><published>2009-03-04T11:33:00.000-08:00</published><updated>2009-03-04T11:50:44.304-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Uncle Bob'/><category scheme='http://www.blogger.com/atom/ns#' term='Software Engineering'/><category scheme='http://www.blogger.com/atom/ns#' term='Hansel Minutes'/><category scheme='http://www.blogger.com/atom/ns#' term='SOLID'/><title type='text'>The SOLID principles in order of importance according to Uncle Bob</title><content type='html'>&lt;a href="http://www.objectmentor.com/omTeam/martin_r.html"&gt;Uncle Bob&lt;/a&gt; had a podcast on &lt;a href="http://www.hanselminutes.com/"&gt;Hanselminutes&lt;/a&gt; where &lt;a href="http://www.hanselminutes.com/default.aspx?showID=163"&gt;he discusses the SOLID principles at length&lt;/a&gt;.  I highly recommend you listen to the whole thing if you want to learn what the SOLID principles are.  I'll wait..........&lt;br /&gt;&lt;br /&gt;Ok, now that you know what SOLID's all about, I want to point out that off the top of his head, Uncle Bob listed the principles in order of importance:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Single Responsibility Principle&lt;/li&gt;&lt;li&gt;Dependency Inversion Principle&lt;/li&gt;&lt;li&gt;Open Closed Principle&lt;/li&gt;&lt;li&gt;Liskov Substitution Principle&lt;/li&gt;&lt;li&gt;Interface Segregation Principle&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;Or, &lt;span style="font-weight: bold;"&gt;SDOLI&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;I'd like to learn exactly why these principles are ordered this way, but, the podcast didn't really focus on this perspective.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5691742980190810543-3850294594974483868?l=tietyt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tietyt.blogspot.com/feeds/3850294594974483868/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5691742980190810543&amp;postID=3850294594974483868' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5691742980190810543/posts/default/3850294594974483868'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5691742980190810543/posts/default/3850294594974483868'/><link rel='alternate' type='text/html' href='http://tietyt.blogspot.com/2009/03/solid-principles-in-order-of-importance.html' title='The SOLID principles in order of importance according to Uncle Bob'/><author><name>Date Hater</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_tb5EVNwXqj0/TMYLZtsweUI/AAAAAAAAABM/2xPkAUmGLp8/S220/angry_heart_bigger.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5691742980190810543.post-8789526953556180332</id><published>2009-03-02T00:32:00.000-08:00</published><updated>2009-03-02T01:01:57.441-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tactics'/><category scheme='http://www.blogger.com/atom/ns#' term='strategy'/><category scheme='http://www.blogger.com/atom/ns#' term='fighting games'/><category scheme='http://www.blogger.com/atom/ns#' term='range'/><title type='text'>You are here.  You should be here...</title><content type='html'>In a fight, where is the best place to stand?  That depends.&lt;br /&gt;&lt;br /&gt;If you're attacking, the best place to be is &lt;span style="font-style: italic;"&gt;barely&lt;/span&gt; in range.  Here, your opponent will think he's safe when he's not.  He'll get hit by moves he otherwise wouldn't because of a false sense of security.  At this range, even if he does block, you are harder to retaliate against because you're often out of range.&lt;br /&gt;&lt;br /&gt;If you're defending, the best place to be is &lt;span style="font-style: italic;"&gt;barely&lt;/span&gt; out of range.  Here, your opponent will think he can hit you when he can't.  He'll be baited to attack when he shouldn't.  Also, you limit his attacks to the ones he thinks can reach.&lt;br /&gt;&lt;br /&gt;Of course, you're also limited to your long-reaching moves when you're in the ideal attacking position.  That is why you should think of this as a principle rather than a rule:  If your sole strategy is to stay in the ideal attacking range, you'll become too predictable.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5691742980190810543-8789526953556180332?l=tietyt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tietyt.blogspot.com/feeds/8789526953556180332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5691742980190810543&amp;postID=8789526953556180332' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5691742980190810543/posts/default/8789526953556180332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5691742980190810543/posts/default/8789526953556180332'/><link rel='alternate' type='text/html' href='http://tietyt.blogspot.com/2009/03/you-are-here-you-should-be-here.html' title='You are here.  You should be here...'/><author><name>Date Hater</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_tb5EVNwXqj0/TMYLZtsweUI/AAAAAAAAABM/2xPkAUmGLp8/S220/angry_heart_bigger.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5691742980190810543.post-7925316380469047382</id><published>2009-03-01T03:42:00.000-08:00</published><updated>2009-03-02T01:08:47.069-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tactics'/><category scheme='http://www.blogger.com/atom/ns#' term='strategy'/><category scheme='http://www.blogger.com/atom/ns#' term='fighting games'/><title type='text'>The Unfettered Mind</title><content type='html'>There is a book on my shelf called "The Unfettered Mind" by Takuan Soho.  Of all the strategy books I own, this one helped me the least.  But, it did have one very good lesson.  It teaches you about the final stage of mastering a skill that requires reflexes. Here are the stages for a fighting game:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;It's your first time.  You focus intensely on every little detail you're doing.  In fighting game terms, this translates into learning how to use the controls.&lt;/li&gt;&lt;li&gt;You've learned the controls and now you focus on your character's moves.  You spend a lot of time remembering your possibilities.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;You've memorized all your character's moves, now you focus on interesting combinations of how to use them.  &lt;/li&gt;&lt;li&gt;You've learned interesting combinations of how to use your moves.  Now you focus on using them at the right time.&lt;/li&gt;&lt;li&gt;You now know when to use your combinations.  You stop focusing all together.  The game is now part of your muscle memory.  Everything comes naturally without you having to think about it.&lt;/li&gt;&lt;/ol&gt;At stage 5, you've reached The Unfettered Mind.  Many players don't even know it exists or that they'd improve if they got there.  Here's why the unfocused mind is important:&lt;br /&gt;&lt;br /&gt;Lets say you are in the middle of a battle and all the sudden you think, "He's probably going to do x".  At that moment, you've focused on something.  You've given yourself something to anticipate, a possibility to look for.&lt;br /&gt;&lt;br /&gt;The problem is, when you focus on one thing, you've just biased your brain.  You've told it that there's &gt; 50% chance that x will occur.  But, the reality is, there are many things your opponent can do at any time. Focusing on one thing will slow your reaction time down and, even worse, set yourself up to be surprised by anything that is not x.  You never want to be in a position where you are surprised.&lt;br /&gt;&lt;br /&gt;The best way to approach the game is to think without thinking.  You're ready at all times but not &lt;span style="font-style: italic;"&gt;expecting&lt;/span&gt; anything.  This attitude makes you much harder to surprise and greatly increases your response time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5691742980190810543-7925316380469047382?l=tietyt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tietyt.blogspot.com/feeds/7925316380469047382/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5691742980190810543&amp;postID=7925316380469047382' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5691742980190810543/posts/default/7925316380469047382'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5691742980190810543/posts/default/7925316380469047382'/><link rel='alternate' type='text/html' href='http://tietyt.blogspot.com/2009/03/unfettered-mind.html' title='The Unfettered Mind'/><author><name>Date Hater</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_tb5EVNwXqj0/TMYLZtsweUI/AAAAAAAAABM/2xPkAUmGLp8/S220/angry_heart_bigger.jpg'/></author><thr:total>0</thr:total></entry></feed>
