java console framework

all beginners start with console application programming, as a tutor, I have created a lot of these.

as an effective programmer, I started to see patterns and things that can be optimized.

I have written a few posts about it:

*first thing, printing to console, java doesn’t have a print function. you need to write system.out.print. that’s long for just printing something so I created a class to do it with two letters S.o(“hello world”.):

https://ytutor.wordpress.com/2018/08/13/a-better-way-to-output-to-the-java-console/

*after that you need to get a users console input, fo that I also created a class called input.

I have noticed a lot of console input in console programs doesn’t have validation for data types, this can cause a lot of problems, also I shortened the process of outputting to the user what to input “write your name” getting the input and then validating it, with my class these 3 things are done with one line of code here is the post about it:

https://ytutor.wordpress.com/2018/09/17/java-console-get-input-class/

*a lot of console programs use flat file (text file) as a database, I have created a class for reading and writing to file:

https://ytutor.wordpress.com/2018/10/24/java-file-io-basics-read-and-write-text-file-tutorial/

*another thing that is very common in console apps is the console menu. basically, it’s a text menu that asks you to chose one of the options here is a post about it:

https://ytutor.wordpress.com/2018/08/23/how-to-create-a-simple-console-menu-java-tut/

with these tools, you can create console programs much faster focusing on the task you want to complete instead of the smaller things.

I teach all of these to my students, I don’t understand why programming courses don’t teach this, as these are great practices. save time and standardized code.

I hope this will help you.

 

 

Leave a comment