r/javahelp • u/Makashinga • Oct 14 '19
What are the projects in java that made you a much better programmer?
I have been coding in Java for a while now and I am at a loss of what to create to get better. I want to know the projects that were most effective that have made you better at coding in java.
14
6
u/wsppan Oct 14 '19
Necessity is the mother of invention. I had a log file that would not roll over (either by size or time) and I needed to know when something got logged to it (basically tail -f) I had to reinvent the wheel by writing a log roller and implement tail -f to parse the log entry whenever it was written too. I did this in a multithreaded way with file listeners. Basically create NIO WatchService as I was relegated to Java 6.
2
u/OffbeatDrizzle Oct 14 '19
What's wrong with logback (or any other logging framework)? The entire point of the Java ecosystem is that you don't need to re-invent the wheel because it's already been done for you
1
u/wsppan Oct 15 '19 edited Oct 15 '19
Logging was done by a mainframe application to a production server that was periodically (when the file got to a certain size) copied to a server I had access to and then concatenated into a daily log file. This was all done outside of my control. I was tasked with creating an application that would parse this log file into a Oracle database and make it available via a web page. This log file can get concatenated with new data from production at various rates depending on how busy it was and can get pretty big by the end of the day
I wanted to only parse what was getting concatenated as soon as it was concatenated. To do this I needed a thread that would poll the file every few seconds for when it changed (had to figure out how long it took to parse data the size of the concatenation) and then let a filelistener thread get notified to continue where it left off from the last notification to parse and update the database.
[Edit 0]. Each time the file was parsed after concatenation I would roll it over to a time-stamped version of just the concatenated portion in case something went wrong. This was done spread out into /var/log/{appname}/{yyyy}/{mm}/{dd}/{timestamp}.log. So far, nothing has gone wrong with this application. Been running non stop for 16 mo.
[Edit 1]. All coming back to me now. Been 16 months since I wrote this. Soon after midnight, this file would get moved to a time-stamped backup and there would be no daily log file until the production file was sent and created again. So, I had to check for this and kill and restart the polling thread once the daily file was recreated.
5
u/arphio Oct 14 '19
Programming an Iterable LinkedList with double pointer from zero. It also helps to understand how this data structure works and how to manage an Iterator
4
u/sdiamante13 Oct 14 '19
One of my first Java projects was a Stock portfolio desktop application built using Java Swing. I interacted with an API and used web scraping to get the stock prices. I had no idea what I was doing in the beginning and I had no idea how I was going to do it, but eventually I found the tools necessary to bring it all together. I suggest you work on a project related to something you enjoy. That makes it easier and more fun.
4
u/bluepug Oct 14 '19
Projects that motivate you: 2d game, fractal images, a tool for something you need, coding chalenges,etc. Took a course on uni and made a project, but only when I made a personal project(a network analyser to see how much downtime i was having in my personal network) that I felt more secure being a programmer
4
u/bluepug Oct 14 '19
But talking objectively: my suggestion is to look for projects about making a rest api or a 2D game. These help you understand many things about a project(things to avoid and things to follow in programming). Also look for data structures and design patterns.
4
u/jcar74 Oct 14 '19
Better or more employable?
Get legacy project, migrate to spring boot with rest endpoints. Play with other technologies and libraries(Elastic, Kafka, Selenium... whatever you like or seems interesting to you), extract data (Tika) and do some parse, scrap something and generate an excel (POI)...
I code java (and others) for a living for 19 years. Most of the time is spent studying libraries, eating old code and dead frameworks, migrating applications, converting data from foo format to faa format, connecting with apis ... From time to time I do katas so as not to get bored.
But if you are learning, do something to have fun!
1
u/TomahawkChopped Oct 14 '19
converting data from foo format to faa format
Google employs 50,000 SWEs to do this very task. We take the data from one proto and put it in another proto.
2
u/milchreisjunkie Oct 14 '19
A year ago I started working with Spring Boot for internal tools. Therefore I took a deep dive into the whole spring ecosystem. It was very helpful to use this framework. A lot of unconfortable things in java are solved and you get "rails" to programm right. Moreover the testing possibilities are great. Programming and testing the application was a pleasure and I learned a lot.
1
u/FrenchFigaro Software Engineer Oct 14 '19
I'd say the stuff that made me profress the most was working on legacy code.
Seeing shit I never want to see, and striving never to have my code put another developper through the horrors developpers of the past put me through. Okay, I'm slightly exagerating here, but you get the gist.
1
u/Kango_V Oct 15 '19
Huge plus was moving from Spring Boot to Micronaut. Then using Immutables, Mapstruc and rxJava. Development is fun again. So little boilerplate code now.
1
u/GhostrickScare Oct 15 '19
Terminal chess. Any chess really, but terminal chess in particular has helped me most.
0
Oct 14 '19
[deleted]
18
u/xaviermiller Oct 14 '19
Idk if I can trust anything with "waifU" in the name >.<
0
8
2
u/Kijop Jan 04 '20
Heyo. I know this post is kinda old but I wanted to let you know this really helped me grow as a programmer!
0
Jan 05 '20
[deleted]
1
u/Kijop Jan 05 '20
I’m not very advanced. I’m still working on understanding java swing and image manipulation
15
u/Gismotron Oct 14 '19
Made a few scripts for RuneScape using tribot API. taught me how to impement API and accomplish my own goal. design the problem research the functions. Implement, test.
My thoughts are just finding something you are interested in that require a programmatic solution.