Show newer

@Lossberg by the way, I do a here, you can look at the origination of it all the way back the 'Ninety-Nine Bottles of Beer" challenge. qoto.org/@Absinthe/10280565958

Feel free to play at any of them that interest you. There is no timebox on these. Watch for the tag and include it on any answers you offer to any of them.

@freemo @namark @Lossberg

When I say TDD, I mean it is the way of design and development. (maybe even a way of life :D )

This means following the 3 laws:

1. You are not allowed to write any production code unless it is to make a failing unit test pass.

2. You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures.

3. You are not allowed to write any more production code than is sufficient to pass the one failing unit test.

Using a Red-Green-Refactor work flow. Write just enough of a unit test for the simplest unit test. Then see that test fail(Red). Then write the SIMPLEST solution in the code to make it pass. (Green) Then refactor to remove complexity and simplify. Lather, rinse, repeat.

@namark @freemo actually, what would be interesting would be to just sit down and knock it out. Then do it again walking the steps of TDD and compare the results.

@freemo @namark one of the fun things about TDD is how it can organically create an algorithm that you might not do just by sitting down and hacking at it.

@freemo I am trying to get one started somewhere else, and in that particular place it will have to be FOSS.

However, I would have no problem doing it as a for profit thing, but that sounds more like the definition of a "Coding Business" I wonder if it could make any money? :)

@freemo I guess, why not? Adds another layer of complexity to things whenever money gets involved though. :)

@yisraeldov It's been a while since I did clojure but as I remember it, the REPL ran your tests. But I would agree just running your program in the REPL each time you save certainly doesn't constitute TDD :)

@yisraeldov Well, if you test first, you on'y need to really know the syntax of your test package... :) Since it is going to fail anyway, it might help you to get the syntax as well.

@freemo Here's the idea. A group of people gets together (well virtually)
1. Brainstorm a project
2. Design the project
3. Code the project
4. Release it to the wild
5. Start over

There is a little more to it, but that is the basic flow. Add whatever other fluff is involved in a club. :)

Okay folks, this should be simple, but maybe not.

The goal is to write a function that takes a positive integer and returns a list of its prime factors. So if you did 12 you should get the list [2, 2, 3]

As neither 1 nor zero are prime, as a result should return an empty list.

This is taken from a , so if you have not done this one I encourage you to do so. If you are not into then solve it however you like.

Is anyone interested in, or has anyone been a part of a programming or coding club?

@tomekw at work we have a very large code base and we use cxxtest (yes even for the C code) and I have used boost's tests for C++. There are quite a few out there. What have you tried?

@yisraeldov
One might posit that actually test_hello_world. should precede hello_world. :)

@sir googol or even googolplex? Both of them are pretty big not sure if any larger ones have names do they?

@sir so all you do is first line testing? I ran it, it worked. Let's ship it! :) Been there, done that.

No, I am not concerned with little green lights.

You and I have a problem of vernacular. When you say TDD and when I say TDD we are not talking about the same thing.

Like I said in the beginning, I am not interested in changing your mind or having an argument about it.

@sir making human beings do mindless repetitive tasks is immoral and akin to cruel and unusual punishment. A computer can do that better. There are testings that are suited to humans, let them do that, because computers are not quite up to that task. Right tool for the job. Sometimes that tool is a human.

@sir if you are doing TDD correctly, you are refactoring after each passed test in the process. If your code is constantly refactored to remove unnecessary complexity, then there is little to refactor later. It is a process. Work the steps. Save the world :)

@sir I disagree with that statement as well. But you are certainly entitled to that opinion.

@sir if you do TDD properly what you get in your unit tests is different than if you just write unit tests after the fact. You also get well refactored code earlier so there aren't the same needs for mass refactorings later. But there are plenty of need of TESTS besides unit tests. Functional tests, end to end tests, integration tests, regression tests. Untested code is immoral.

Show older
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.