Git Product home page Git Product logo

java-katas's Introduction

java-katas

badge

License MIT lightsalmon CodeKata Java blue

Java Katas

One repo to rule them all. Java code katas - using JUnit5

The java-katas is a code repository for learning various Java features.

What is a kata (a code kata) ?

From http://wikipedia: Kata originally were teaching and training methods by which successful combat techniques were preserved and passed on. Practicing kata allowed a company of persons to engage in a struggle, using a systematic approaches, rather by practicing in a repetitive manner the learner develops the ability to execute those techniques and movements in a natural, reflex-like manner. Systematic practice does not mean permanently rigid. The goal is to internalize the movements and techniques of a kata; so they can be executed and adapted under different circumstances, without thought or hesitation. A novice’s actions will look uneven and difficult, while a master’s appear simple and smooth.

What is a code kata?

From http://codekata.com: Code Kata is an attempt to bring the element of practice to software development. A kata is an exercise in karate where you repeat a form many, many times, making little improvements in each. The intent behind code kata is similar. Each is a short exercise (perhaps 30 minutes to an hour long). Some involve programming, and can be coded in many ways. Some are open-ended, and involve thinking about the issues behind programming. These are unlikely to have a single correct answer.

Code katas were first introduced by Dave Thomas and are a great tool to practice programming something new.

So, what is in this repo?

This Git repo is a collection of several code katas about features, utilities and APIs in Java language.

The general structure of each project is a maven quickstart project with a pom.xml, a src directory that contains at least two directories. Code Katas are available under the src/test/java while solutions are under src/solutions/java under each module. The code katas typically contain failing tests with TODO markers that need to be fixed in order to fix the test,

Remember, the src/solutions may not be the perfect way to solve the kata, maybe a solution you come up with is better. Feel free to submit a pull request if you think you have a better solution than the one you find.

Current katas

java-handles

Understand Java Reflection and sun.misc.Unsafe, then, learn the alternates for those in Method Handles API and VarHandles API in more recent version of Java.

java-datetime

Learn the Java Time API (introduced in Java 8), that replaces the java.util.Date and java.util.Calendar with a more humane and extensible API.

java-optional

Learn the Java Optional API, as a replacement for null-checks and unexpected NullPointerExceptions that crop up causing developer unhappiness and/or application instability issues.

java-lambdas

Learn Java Lambdas, a feature that allows for closure-like syntax, and the ability to replace anonymous classes with functional blocks.

java-futures

Learn Java CompletableFuture API, an API that allows for synchronous as well as asynchronous tasks with pipelines and task chaining/combinations with many ways to handle exceptions, with and without recovery paths.

More katas will be added, feel free to contribute if you have ideas.

java-katas's People

Contributors

bukama avatar c-guntur avatar faisal6621 avatar sormuras avatar zhelezniak88 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

java-katas's Issues

Add java-lambdas as a kata

Java closures currently resides as a separate repo. Convert to follow conventions and create a java-closures kata in this repo.

Include OpenJDK EA build

Update .travis.yml to include a maven build with openjdk-ea. This build can potentially fail, so allow_failures.

JUnit5 dependencies in poms to test scope

Code that relies on JUnit5, currently resides in the production directories at src/main/java. This causes the maven dependency to be in production scope and not test scope. Move such code to a separate module and depend on that module in the katas. The poms for the katas can then move all JUnit dependencies to test scope.

Fix root README typos

  1. Fix the java-optionals to java-optional.
  2. Fix the 'repacements' to 'replacements'

Run a spellcheck on the entire README, fix other typos.

Fix display name inconsistencies in java-datetime Test

Fix the DateTimeKataDisplayNames to drop the "verify" from the JUnit output. Fix the none.cvg.datetime.DateTimeKataDisplayNames#generateDisplayNameForMethod() to render text from substring after 'verify'. See similar example at: none.cvg.handles.HandlesKataDisplayNames#generateDisplayNameForMethod in java-handles.

java-optional solutions not tested when mvn run from root

Currently three katas exist. When running mvn clean install or mvn verify from the root, the JUnit tests under the src/solutions/java for java-datetime and java-handles are executed and test results produced. However, the JUnit tests under the src/solutions/java for java-optionals are not run. This needs to be fixed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.