[JAVA] I tried to verify whether it would be fun to combine "programming" and "hobbies".

My job is an IT shop. I'm writing a program in Java or Ruby, but I want to find fun.

My hobby is cooking. When I'm cooking, I don't have to think about anything, I just move my hands, so I like it.

I wonder if programming can be done like cooking ...

Today's recipe is "hamburger"

** Hamba ァ ァ ァ ァ ァ !!!!!!!! **

material

--Seeds --Minced meat --Onion --Egg --Bread crumbs

Process

  1. Mix the seeds
  2. Bake 1
  3. Boil the sauce
  4. Place the baked hamburger on a plate
  5. Sprinkle the sauce

It's easy.

Then immediately.

This time I will make it in Java.

//Hamburger cooking class
// -Each cooking process class is inherited as if it were
// -There is also a plate class
class CookingHamburgSteak extends Cooking {
  public static void main( String[] args ) {
    //Bake
    Seed beakedSeed =
        super.beak( new Seed() );
    //Boil down
    Sauce boilDownSauce =
        super.boilDown( new Sauce() );
    //Serve
    Dish dish = new Dish();
    dish.on( beakedSeed );
    dish.on( boilDownSauce );
    //eat
    System.out.println( dish.isBeautiful() ? "looks so good!!" : "looks so bad..." );
    System.out.println( dish.isTaste()     ? "yummy!!"         : " yucky..." );
  }
}

//Hamburger seeds
// -There shall be a class for each material
class Seed {
  // field
  private Meat meat;
  private Onion onion;
  private Egg egg;
  private Breadcrumbs breadcrumbs;
  // getter
  // (・ ・ ・ Because it is troublesome, it is omitted ...)
  // setter
  // (・ ・ ・ Because it is troublesome, it is omitted ...)
}

//Hamburger sauce
// -There shall be a class for each material
class Sauce {
  // field
  private Ketchup ketchup;
  private Worcestershire worcestershire;
  private RedWine redWine;
  private Honey honey;
  // getter
  // (・ ・ ・ Because it is troublesome, it is omitted ...)
  // setter
  // (・ ・ ・ Because it is troublesome, it is omitted ...)
}

Conclusion

Cooking with programming is not fun.

Recommended Posts

I tried to verify whether it would be fun to combine "programming" and "hobbies".
I tried to verify yum-cron
I tried to verify this and that of Spring @ Transactional
Delegated type added in Rails 6.1 and Union types of GraphQL seem to be compatible, so I tried it
I tried to verify AdoptOpenJDK 11 (11.0.2) with Docker image
I tried to link grafana and postgres [docker-compose]
I tried to link JavaFX and Spring Framework.
Since the argument of link_to is nil (null) and an unexpected link was generated, I tried to verify it
I called YouTube video from DB with haml and tried to embed and display it
I tried to read and output CSV with Outsystems
I started MySQL 5.7 with docker-compose and tried to connect
I tried to integrate AWS I oT button and Slack
~ I tried to learn functional programming in Java now ~
I tried to chew C # (reading and writing files)
roman numerals (I tried to simplify it with hash)
I thought that the initial drawing would be faster if I used Spring WebFlux to get 1 million data from the server and display it on the browser, so I tried it
I tried to develop a web application from a month and a half of programming learning history
I tried to collect and solve Ruby's "class" related problems.
I tried to summarize the basics of kotlin and java
I tried to make Java Optional and guard clause coexist
I tried to summarize personally useful apps and development tools (development tools)
I tried to summarize personally useful apps and development tools (Apps)
[Rails] I tried to implement "Like function" using rails and js
I tried to be able to pass multiple objects with Ractor