• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Chess problem: calculating the intersection point of two bishops with simple equations

 
Ranch Foreman
Posts: 266
12
IntelliJ IDE Firefox Browser Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Junilu Lacar wrote:Before I give it a rest, I just want to show how I would refactor the test code I critiqued earlier.

To tell the story that I think the above code is trying to tell better, I'd do something like this:

I think the above test code is clearer as to intent vs. what it was before and the tests are more focused and have singular purpose.



Morning!
Should this go in the refactoring thread?
 
Marshal
Posts: 14053
234
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, I think it's fine here since its related to some previous replies. You can reference it from the refactoring thread though if you feel it helps the discussion there.
 
Junilu Lacar
Marshal
Posts: 14053
234
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But tell me what you think, does the refactoring I showed make sense?
 
D.J. Quavern
Ranch Foreman
Posts: 266
12
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Junilu Lacar wrote:But tell me what you think, does the refactoring I showed make sense?



Yes, it does, and I am waiting for the final version of the refactoring put together.
 
D.J. Quavern
Ranch Foreman
Posts: 266
12
IntelliJ IDE Firefox Browser Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Junilu Lacar wrote:

D.J. Quavern wrote:Except the bishops you mean ?


LOL. It's nice to see you being such a good sport about all this. Assigning tone to text in a medium like this is a tricky business but you seem to be pitch perfect in this thread



In the start I was a bit out off by what I interpreted as your harshness. But I understood that it was commitment to your role as mentor, generosity to help random people on the internet and passion into making people code and understand better. So now I take you as a...  sort of parent.
Parents have experience and know better, and explain longly to an ungrateful public. The ungrateful might understand that the parent was right in a decade though, and doing what she/he wants still.

Did you see my movie 😀?
 
Water proof donuts! Eat them while reading this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!