<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Webbynode - Latest Comments</title><link>http://webbynode.disqus.com/</link><description></description><atom:link href="https://webbynode.disqus.com/comments.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Tue, 26 Nov 2013 00:37:09 -0000</lastBuildDate><item><title>Re: Finding your BEST Customers</title><link>http://blog.webbynode.com/2013/11/how-to-find-my-first-customers/#comment-1139154032</link><description>&lt;p&gt;Everyone is going to (inadvertently) work with a nightmare customer (or two, or many as is my case) to be able to know exactly what it feels like.&lt;/p&gt;&lt;p&gt;Ideally, prevention is better than cure but once you're there, it's a hard slog to make it through the project. We've had, on one occasion, actually fire the customer and give their money back because we didn't want to have anything to do with them.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Rystraum</dc:creator><pubDate>Tue, 26 Nov 2013 00:37:09 -0000</pubDate></item><item><title>Re: Coming Soon! Webby Manager v2</title><link>http://blog.webbynode.com/2012/10/coming-soon-webby-manager-v2/#comment-771050217</link><description>&lt;p&gt;When will I have access to this new version?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ivan Santos</dc:creator><pubDate>Thu, 17 Jan 2013 12:26:57 -0000</pubDate></item><item><title>Re: The Power of Pair Programming</title><link>http://blog.webbynode.com/2012/06/the-power-of-pair-programming/#comment-558585942</link><description>&lt;p&gt; Doing:&lt;/p&gt;&lt;p&gt;def self.is_fizz_buzz?(number)&lt;br&gt;  is_fizz?(number) and is_buzz?(number)&lt;br&gt;end&lt;/p&gt;&lt;p&gt;Mantain the code more simple [IMHO].&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Leonardo Siqueira Rodrigues</dc:creator><pubDate>Fri, 15 Jun 2012 11:22:18 -0000</pubDate></item><item><title>Re: The Power of Pair Programming</title><link>http://blog.webbynode.com/2012/06/the-power-of-pair-programming/#comment-555336802</link><description>&lt;p&gt;I would not have chosen any of these solutions. The first solution is closest, but it's just a bit too clever in its use of concatenation.&lt;/p&gt;&lt;p&gt;I would have coded it exactly as it was stated - an IF statement with four clauses. That's the simplest solution that could possibly work (it's also the easiest to write, test, and understand).&lt;/p&gt;&lt;p&gt;Then I'd cross that item off my to-do list and find something else to do.&lt;/p&gt;&lt;p&gt;IF and ONLY IF there arose a need to make this game more flexible, that's when I would refactor it.&lt;/p&gt;&lt;p&gt;But the refactorings as shown simply obscure the actual required functionality behind unnecessary abstraction. And a statement like "return "fizz buzz" if is_fizz_buzz?(number)" shows obvious duplication that should be a tip-off that the refactoring has introduced problems that didn't exist before.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mark Wilden</dc:creator><pubDate>Tue, 12 Jun 2012 13:14:12 -0000</pubDate></item><item><title>Re: The Power of Pair Programming</title><link>http://blog.webbynode.com/2012/06/the-power-of-pair-programming/#comment-555252339</link><description>&lt;p&gt;"and" and "&amp;amp;&amp;amp;" are not the same thing on Ruby:&lt;br&gt;&lt;a href="http://devblog.avdi.org/2010/08/02/using-and-and-or-in-ruby/" rel="nofollow noopener" target="_blank" title="http://devblog.avdi.org/2010/08/02/using-and-and-or-in-ruby/"&gt;http://devblog.avdi.org/201...&lt;/a&gt; &lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Yuri Albuquerque</dc:creator><pubDate>Tue, 12 Jun 2012 11:27:14 -0000</pubDate></item><item><title>Re: The Power of Pair Programming</title><link>http://blog.webbynode.com/2012/06/the-power-of-pair-programming/#comment-555237509</link><description>&lt;p&gt;IMO the code is poor :&lt;br&gt;1) is_fizz_buzz? isn't based on fizz nor buzz, so if you change one you have to change fizz_buzz (big architectural problem here considering the size of the code)&lt;br&gt;you should at least make is_fizz_buzz? into the following&lt;br&gt;	is_fizz? number and is_buzz? number&lt;br&gt;2) the point Steve Holmes said : if you have to add a condition you end up with much more code and have line such as return "fizz buzz wizz"&lt;br&gt;you also have close to n^2 functions oO&lt;br&gt;3) just my thought, but a pattern strategy would be nice&lt;br&gt;4) is_xxxx? should be preferably xxxx? (or is_xxxx)&lt;/p&gt;&lt;p&gt;Applying everything you end up with the following :&lt;br&gt;class Game 	attr_accessor :condition	def initialize (condition)		@condition = condition	end		def fizzbuzz(number)		ret = ""		ret &amp;lt;&amp;lt; "fizz " if @condition.fizz? number 		ret &amp;lt;&amp;lt; "buzz " if @condition.buzz? number		return number if ret.empty?		ret	end	endclass Condition	def fizz?(number)		number % 3 == 0	end		def buzz?(number)		number % 5 == 0	endend&lt;/p&gt;&lt;p&gt;---&lt;br&gt;I didn't wanted to use an array so I simply put a space between each strings ;)&lt;/p&gt;&lt;p&gt;Good : -anyone can easily change fizz and buzz condition by inheriting Condition-size of fizzbuzz don't "explose" if you add others rulesCons:-one more class :/&lt;/p&gt;&lt;p&gt;Try it with :&lt;br&gt;game = &lt;a href="http://Game.new" rel="nofollow noopener" target="_blank" title="Game.new"&gt;Game.new&lt;/a&gt;(&lt;a href="http://Condition.new" rel="nofollow noopener" target="_blank" title="Condition.new"&gt;Condition.new&lt;/a&gt;)(0..30).each { |i|	puts game.fizzbuzz(i)}&lt;/p&gt;&lt;p&gt;=)&lt;/p&gt;&lt;p&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sora</dc:creator><pubDate>Tue, 12 Jun 2012 11:09:33 -0000</pubDate></item><item><title>Re: The Power of Pair Programming</title><link>http://blog.webbynode.com/2012/06/the-power-of-pair-programming/#comment-555227639</link><description>&lt;p&gt;good point ;) it is indeed!&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Felipe Iketani</dc:creator><pubDate>Tue, 12 Jun 2012 10:56:12 -0000</pubDate></item><item><title>Re: The Power of Pair Programming</title><link>http://blog.webbynode.com/2012/06/the-power-of-pair-programming/#comment-555226410</link><description>&lt;p&gt;in Ruby, the coding standard is to use fizz?&lt;br&gt;instead of is_fizz? &lt;br&gt;since the question mark already indicates you are asking a question&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">No</dc:creator><pubDate>Tue, 12 Jun 2012 10:54:26 -0000</pubDate></item><item><title>Re: The Power of Pair Programming</title><link>http://blog.webbynode.com/2012/06/the-power-of-pair-programming/#comment-555188777</link><description>&lt;p&gt;Interesting points of view, all of them. A careful look and considering @Steve Holmes approach, I'd use the predicates on the first solution. The nature of the problem is more approachable through your example, and so it fits better. &lt;/p&gt;&lt;p&gt;Adding a `wizz?` method and appending `"wizz" if number.wizz?` (something alike) would be elegant IMO.&lt;/p&gt;&lt;p&gt;Good stuff, Felipe. A good example of how there's more than way to solve problems and how to assess them according to their nature.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">José Mota</dc:creator><pubDate>Tue, 12 Jun 2012 09:57:32 -0000</pubDate></item><item><title>Re: The Power of Pair Programming</title><link>http://blog.webbynode.com/2012/06/the-power-of-pair-programming/#comment-555176798</link><description>&lt;p&gt;Yes, but you haven't completed the final example. If you add the wizz for 7 then following the same style it needs a fizzbuzz method like this:&lt;/p&gt;&lt;p&gt;  def self.fizzbuzz(number)              return "fizz buzz wizz" if is_fizz_buzz_wizz?(number)     &lt;br&gt;    return "fizz buzz" if is_fizz_buzz?(number)     &lt;br&gt;    return "fizz wizz" if is_fizz_wizz?(number)         return "buzz wizz" if is_buzz_wizz?(number)     &lt;br&gt;    return "fizz" if is_fizz?(number)        return "buzz" if is_buzz?(number)    return "wizz" if is_wizz?(number)    return number       &lt;br&gt;end&lt;/p&gt;&lt;p&gt;then you need to define all the new methods.&lt;br&gt;Also if you implement these as in the example you have something like&lt;/p&gt;&lt;p&gt;def self.is_fizz_wizz(number)   &lt;br&gt;    number % 21 == 0 &lt;br&gt;end&lt;/p&gt;&lt;p&gt;And if you want to change the value of buzz from 3 to something else you have to go and edit multiple methods - violating the DRY principle. Also not only do you have to edit all the places where 3 is used you have to go and work out all the places as it's hidden in the magic numbers of 15 and 21.&lt;br&gt;It's not just a code smell it's a code stink bomb ;)&lt;/p&gt;&lt;p&gt;Surely you can't think all of that is better than that one line edit for the original version.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Steve Holmes</dc:creator><pubDate>Tue, 12 Jun 2012 09:38:44 -0000</pubDate></item><item><title>Re: The Power of Pair Programming</title><link>http://blog.webbynode.com/2012/06/the-power-of-pair-programming/#comment-555162676</link><description>&lt;p&gt;Nice, Felipe!&lt;/p&gt;&lt;p&gt;@Steve Holmes , what I understand as being a benefit is that in the first version of the code, he would have to add a line with the implementation that checks for 'wizz', like so:&lt;/p&gt;&lt;p&gt;return "wizz" if number % 7 == 0&lt;br&gt;Although this works, I think they were going for something more expressive, which is:&lt;/p&gt;&lt;p&gt;return "wizz" if is_wizz?(number)&lt;/p&gt;&lt;p&gt;This would encapsulate the logic behind 'what is a wizz?' behind another method, rather than expose it to the Game.fizzbuzz method. &lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Caike Souza</dc:creator><pubDate>Tue, 12 Jun 2012 09:15:14 -0000</pubDate></item><item><title>Re: The Power of Pair Programming</title><link>http://blog.webbynode.com/2012/06/the-power-of-pair-programming/#comment-554927766</link><description>&lt;p&gt;I disagree with your conclusion.&lt;br&gt;Your original code is far better to me.&lt;/p&gt;&lt;p&gt;Let's say we get so good at the game we no longer make mistakes, so we need to add another number. So if you could go back to the code and add "wizz" whenever it's a multiple of 7, you'll see yours is much much easier to amend and the second is not.&lt;/p&gt;&lt;p&gt;(I like pair programming but I don't think the above is a good example of it)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Steve Holmes</dc:creator><pubDate>Mon, 11 Jun 2012 23:37:23 -0000</pubDate></item><item><title>Re: Use Dependency Injection, Your Tests will Thank You</title><link>http://blog.webbynode.com/2012/06/use-dependency-injections-your-tests-will-thank-you/#comment-554219764</link><description>&lt;p&gt;Um, if you set @power to "off" I assume you would also use "on" for the opposite case, and that means it would fail too.&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">iconara</dc:creator><pubDate>Mon, 11 Jun 2012 03:42:19 -0000</pubDate></item><item><title>Re: Use Dependency Injection, Your Tests will Thank You</title><link>http://blog.webbynode.com/2012/06/use-dependency-injections-your-tests-will-thank-you/#comment-554090324</link><description>&lt;p&gt;The issue about !!@power or only @power is that if I set @power = 'off', both of then would fail for example.&lt;br&gt;in my opinion, any method finishing with '?' should be careful. that's why i enjoy @power == true&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Felipe Iketani</dc:creator><pubDate>Sun, 10 Jun 2012 21:49:53 -0000</pubDate></item><item><title>Re: Use Dependency Injection, Your Tests will Thank You</title><link>http://blog.webbynode.com/2012/06/use-dependency-injections-your-tests-will-thank-you/#comment-553946880</link><description>&lt;p&gt;Not sure if it can be considered idiomatic, but it's common to write `!!@power` if you want to make sure you're returning a boolean. The single negation will make sure it's a boolean, and the double makes sure it's not negated.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">iconara</dc:creator><pubDate>Sun, 10 Jun 2012 16:07:19 -0000</pubDate></item><item><title>Re: Use Dependency Injection, Your Tests will Thank You</title><link>http://blog.webbynode.com/2012/06/use-dependency-injections-your-tests-will-thank-you/#comment-545729760</link><description>&lt;p&gt;Nice one&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ray</dc:creator><pubDate>Sat, 02 Jun 2012 11:10:40 -0000</pubDate></item><item><title>Re: Use Dependency Injection, Your Tests will Thank You</title><link>http://blog.webbynode.com/2012/06/use-dependency-injections-your-tests-will-thank-you/#comment-545706313</link><description>&lt;p&gt;And using RSpec you can do like this:&lt;br&gt;subject.should be_on&lt;/p&gt;&lt;p&gt;instead of&lt;br&gt;subject.on?.should be_true&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jarmo Pertman</dc:creator><pubDate>Sat, 02 Jun 2012 10:19:29 -0000</pubDate></item><item><title>Re: Use Dependency Injection, Your Tests will Thank You</title><link>http://blog.webbynode.com/2012/06/use-dependency-injections-your-tests-will-thank-you/#comment-545094642</link><description>&lt;p&gt;Agree, once @power would be set more complex it makes sense :)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Kreimer Georg</dc:creator><pubDate>Fri, 01 Jun 2012 12:57:35 -0000</pubDate></item><item><title>Re: Use Dependency Injection, Your Tests will Thank You</title><link>http://blog.webbynode.com/2012/06/use-dependency-injections-your-tests-will-thank-you/#comment-544981707</link><description>&lt;p&gt;personal taste :)&lt;/p&gt;&lt;p&gt;@power  == true can return only true of false.&lt;/p&gt;&lt;p&gt;@power just can return anything.. i just follow this convention&lt;/p&gt;&lt;p&gt;this is a really small class, so @power == true may seem silly. but i think it's still readable and understandable. &lt;/p&gt;&lt;p&gt;just a personal taste&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Felipe Iketani</dc:creator><pubDate>Fri, 01 Jun 2012 10:27:20 -0000</pubDate></item><item><title>Re: Use Dependency Injection, Your Tests will Thank You</title><link>http://blog.webbynode.com/2012/06/use-dependency-injections-your-tests-will-thank-you/#comment-544973289</link><description>&lt;p&gt;Why not just?&lt;/p&gt;&lt;p&gt;  def on?    @power  end&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Kreimer Georg</dc:creator><pubDate>Fri, 01 Jun 2012 10:16:20 -0000</pubDate></item><item><title>Re: Use Dependency Injection, Your Tests will Thank You</title><link>http://blog.webbynode.com/2012/06/use-dependency-injections-your-tests-will-thank-you/#comment-544957244</link><description>&lt;p&gt;Objects on Rails is very good indeed. I also suggest every one to read it!&lt;/p&gt;&lt;p&gt;The purpose of this post is not about using DI and Outside in development in Rails, but in any kind of project/test. &lt;/p&gt;&lt;p&gt;Good approaches are framework agnostics.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Felipe Iketani</dc:creator><pubDate>Fri, 01 Jun 2012 09:54:52 -0000</pubDate></item><item><title>Re: Use Dependency Injection, Your Tests will Thank You</title><link>http://blog.webbynode.com/2012/06/use-dependency-injections-your-tests-will-thank-you/#comment-544955384</link><description>&lt;p&gt;yeah, really ugly, it was the kind of stuff that i forgot to refactor before publishing.. but you're right!&lt;/p&gt;&lt;p&gt;thanks for the feedback&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Felipe Iketani</dc:creator><pubDate>Fri, 01 Jun 2012 09:52:13 -0000</pubDate></item><item><title>Re: Use Dependency Injection, Your Tests will Thank You</title><link>http://blog.webbynode.com/2012/06/use-dependency-injections-your-tests-will-thank-you/#comment-544954378</link><description>&lt;p&gt;thanks, this was new to me :)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Felipe Iketani</dc:creator><pubDate>Fri, 01 Jun 2012 09:50:50 -0000</pubDate></item><item><title>Re: Use Dependency Injection, Your Tests will Thank You</title><link>http://blog.webbynode.com/2012/06/use-dependency-injections-your-tests-will-thank-you/#comment-544858364</link><description>&lt;p&gt;Nice example and thoughts. To add to @nmk `@power == true ? true : false` should be `!!@power`, the double !! will ensure false is returned if `@power` is nil.&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">krisleech</dc:creator><pubDate>Fri, 01 Jun 2012 06:47:04 -0000</pubDate></item><item><title>Re: Use Dependency Injection, Your Tests will Thank You</title><link>http://blog.webbynode.com/2012/06/use-dependency-injections-your-tests-will-thank-you/#comment-544834042</link><description>&lt;p&gt;Lecturing on DI and writing abominations like&lt;/p&gt;&lt;p&gt;@power == true ? true : false&lt;/p&gt;&lt;p&gt;don't mix well.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">nmk</dc:creator><pubDate>Fri, 01 Jun 2012 05:47:47 -0000</pubDate></item></channel></rss>