Skip to content

Instantly share code, notes, and snippets.

View cbefus's full-sized avatar
🐗
Avoiding Death

cbefus

🐗
Avoiding Death
View GitHub Profile
@cbefus
cbefus / reverse_polish_tdd_1.py
Last active May 31, 2018 18:47
A series of files demonstrating TDD ping pong in python creating a reverse polish calculator
class ReversePolishCalculatorTest(unittest.TestCase):
def test_can_instantiate_a_calculator(self):
ReversePolishCalculator()
# Ran 1 test in 0.002s
# FAILED (errors=1)
# Error
# Traceback (most recent call last):
# File "/usr/lib/python3.5/unittest/case.py", line 58, in testPartExecutor
@cbefus
cbefus / GuessStatisticMessage.java
Last active April 20, 2018 23:01
An improved version of Listing 2-2 in Clean Code By Robert C. Martin
import com.google.common.collect.ImmutableMap;
import java.util.function.BiFunction;
/**
* @author Chad Befus
* This is my attempt at an improvement on Listing 2-2 of "Clean Code" by Robert C. Martin
*/
public class GuessStatisticMessage {
public final char candidate;