DEV Community

John Selawsky
John Selawsky

Posted on

Learn Java as a musician… but faster!


Table of Contents

My younger cousin is a professional musician. He started learning piano at the tender age of 4 and now he is in his senior year of musical college. When I went on a Java developer path I was way much older than he was at his beginning. Thank goodness, learning how to program is much easier and faster than studying music. I mean in a professional way.

In spite of cousin’s young age, looking at him practicing piano and chatting with him about learning during my Java rookie days were extremely beneficial. His name’s Bo, by the way. I usually share his reasoning about my early studies with my students (I work not only as a Senior Software Developer but also as a Java Tutor) and you know what? My students usually become fans of Bo’s methods. However, I have never mentioned him in my articles. It is not fair, and I decided to change that.

Here I want to share my conclusions from my own experience, using my cousin’s language.

So, this article motto is “Avoid typical Java student mistakes and learn to program as a musician (but please, not for such a long time!!)”.

Bo’s tip #1. Do a lot of easy coding exercises, “Scales and arpeggios” of Java

“I do not understand anything in this Java book. I don’t know what to do here and there. Maybe I should just quit learning?”. These were my thoughts and thoughts of many other programming students. Luckily I had young Bo around to complain to him about my tough life! Bo was not only young but also wise:

– I know you’re smart, he said, – You are good at math and so on. I don’t believe you can’t code. I presume your learning is not right.
– What do you mean by that?
– Programming is about making apps, right?
– Right.
– How many apps do you make during the day?
– Well… Not so many. Yesterday and today are my theory learning days. Tomorrow I am going to continue writing my program with today’s theory.
– Oh… I don’t know much about programming, but I suspect, you are not practicing enough. I have some music theory classes and history of music, but piano practicing is the main topic. I mean practicing the piano daily with or without the teacher. I never start my practicing from a composition or even etude. First of all, pure exercises. They are more or less easy, sometimes boring, but they are a must.
– What kind of exercises?
– Scales and arpeggios. Remember “The Aristocats” Disney cartoon?

The moment he said this a strong flow of nostalgy washed me away. The mama cat, two kittens, piano and the song…

Every truly cultured music student knows
You must learn your scales and your arpeggios

  • So, wise Bo continued, I guess there are specific “scales and arpeggios” in programming and you should practice them every day.

It’s somewhat weird, that the first useful advice about learning programming was from a young music student. However, it was my personal turning point. I looked for an analogy of what could be the scales and arpeggios of Java? The answer is easy coding tasks to practice syntax, constructions and language structure. This is true for all languages, but for Java with its million libraries and verbosity, coding exercises are especially important.

I found a lot of tasks collections and solved them every now and then. Nowadays things become easier. Over the past two years, I have found some great sites with Java tasks. Here they are.

CodeGym. Java Core course with 1000 or so coding tasks for Java Students from rookies to confident upper intermediate level. This site not only lets you read Java Core lectures and solve tasks but also check your code validity.

Codecademy. This is probably one of the best-known online platforms for learning numerous languages including Java. Here you start coding from the first lesson. The free course is for beginners.

Bo’s tip #2. Challenging tasks

"Every new technical etude or other composition received from my teacher contains some challenges", Bo said.- "First, I should think about how to solve them. If I don’t get it or I try and nothing good happens, I ask my teacher for help. Sometimes he gives me extra exercises to overcome technical difficulties, or just tells me what to do. Pretty often I feel like “I hate this task” and my study, in general, is too tough, and I want to play something easy-peasy just for fun. Sometimes I play everything but difficult parts again and again for ages. This is stupid! Surely I should pay attention to difficult parts first."

Translation of this Bo’s tip to “Java learning” is straight as an arrow. Some of your coding tasks should be tough for you, that is perfectly natural. Think of the solution before you start coding. If you try hard enough and still can’t solve something, ask your teacher for help. If you are a self-paced learner, ask questions on forums!

Good forums for Java students include Stack Overflow’s Java section(the guys there are not always kind to newbies, according to the comments) or Coderanch (very beginner friendly). Also, there are communities on Reddit such as java and learnjava, where you will find useful tips on learning Java.

Where to find challenging tasks if you don’t have a tutor: Codewars is for users with at least a small background in programming, CodingGame, is where you can write code for a game, compile it and see it take effect within the game. There are many challenging tasks on CodeGym (really good online course, I wrote about it above) and especially Java Docs, a resource with a great collection of coding puzzles for different levels.

Bo’s tip #3. Smart practicing for your “soul”

" You know, every musician plays the best piece they really like. Sometimes music students try to play something way before they can practically do so. I remember the story of one older boy from my school who wanted to play Rachmaninov’s concert #2 in his 4th year. This composer is well known as a very tough author for pianists because he had really huge hands and he wrote his music to play with his hands. That boy’s hands were… just hands of a 10-year-old guy. He constantly argued with his teacher and he let him try… Nothing good happened. The boy just ended up wasting a lot of time and nerves. However, he turned back to Rachmaninov’s concert years later and he is really good at it as 16 years old…"

"On my second or third year, I ran mad about Disney cartoons and Beatles songs, so I learned some of them and really enjoyed this! Now I always have at least one piece of my favorite music to learn."

What does that mean for a Java student? It is all about your own projects, which you may want to create. After you gain some theoretical and practical knowledge you can try creating your own projects. I made some small games, started but not finished one Japanese style RPG and wrote a virtual piano keyboard (Bo’s influence again!). I started my small projects after about 6 months of learning and got more “serious” at the end of my first year. Don’t try to create an operating system as a rookie. First projects could be very small and easy but enjoyable for you. I usually propose to my students to start creating some projects on their 6th month, and 3rd month for quick learners. They make simple time management tables, games, keyboards (for Android) and so on.

Bo’s tip #4. Daily practicing

"If you’re faithful to your daily practicing

You will find your progress is encouraging"

Here we have a quotation from “The Aristocats” again. You know how long average piano college student practices? 5-6 hours per day, sometimes it could be double that… Bo practiced for 1 hour per day when he was 4-5 and later — more and more…

I observed daily practicing of Bo, little boy Bo at that moment, and… I started to understand what I should do if I want to be a pro. First, I started to code 10 to 18 hours per day. That didn’t last long and I slowed it down because I wanted to survive my youth.

So, now I offer a very simple study formula for my students: at least 2 hours on the workdays and 5 hours on the weekends if you want to be a pro as soon as possible. We are not musicians, so it is enough to be close to Strong Trainee level in 6 months.

Bo’s tip #5. Set your goals, big and small

"I was 8 when my teacher told me I would take part in my first more or less serious competition. I was absolutely shocked because I felt like I am not ready at all. However, I had 5 months to prepare. I have to say, that was my first real breakthrough with piano – the preparation for that competition. I was both very nervous and very focused. I practiced a lot, but what was more important, I practiced in a smart way. I thought of a program, chose pieces to play, prepared them precisely… which I later extended to practicing any piece, with a couple of small goals, such as “Today I play Scales and Arpeggios G# minor and learn measures 9-16 of the piece.”, as well as big goals like “Exam in June” or “Big competition”."

Having particular goals, be it big or small, instead of abstract “understand Java well” or “become a professional in Java”, is a really good idea.! I set goals for myself and I use them as a tutor. After a week or two of my classes, I usually help my students to set goals small and big ones. Here is an example.

Mini goals of my average student:

  • Everyday: 4-5 easy tasks (“arpeggios”), work on tough problems (1 tough problem in 2 days to a week, depending on its toughness). Not only coding itself, but thinking through the tasks and drafting.
  • 2-3 times a week(after first 1-2 months): working on a course project.
  • 3-4 times per week, for 1 hour: reading and watching (lectures, other people’s code, pro’s articles, exam questions and so on)

Big Goals for the end of the course (semester’s end):

  • Have at least one good project for resume
  • Take a local Java exam (I do it for my students)

You don’t need a teacher badly to set your own goals. Just try learning Java and after 2 weeks, when you know your speed, set the goals by yourself. Don’t be afraid of changing them later.

Bo’s tip #6. Learn from the others

"Sometimes I don’t know how I should play the piece. I have scored but when I try I get a mechanical and empty interpretation. When you’re still a learner, it is a good time to learn from others… to be a good copycat! Copycat the other students who are one or two steps ahead of you. Go on YouTube and listen to professionals, if the piece you are trying is famous enough. Try to listen to the difference."

Here we have a bunch of tips for software developers. Java is an open source language. You can not only use Java libraries, but you are welcome to read their code. We’ve got github, for example, where programmers of different levels keep their work. Learn from them! BTW, it is a very good idea to create your personal repository on github. Every cultured programmer student knows, that you must learn how to work with cloud repositories.

This is precious if you have some fellow students! Read their code and ask them to read yours. If you don’t have any fellow students, go to forums (Stack Overflow’s Java section or Coderanch) and first look for answers to questions you’re interested in. Didn’t find anything? Don’t hesitate to ask questions! It is very important.

One more tip here: read blogs, articles, and lectures written by professionals or other students. Developers usually share their knowledge and are open to collaborations:

  • Javaworld (news, useful tutorials, “how to’s” and so on);
  • DZone (articles and guides for beginners and experienced developers);

Bo’s tip #7. Do it in different ways

" It is very hard to overcome laziness… and re-learn something in a different way. However, it is a good way to grow as a performer. First I tried the two voice invention in C major by Bach when I was 7. I learned it and could play it… Years later I found this piece performed by 5 professional pianists. I listened to them again and again and tried to replicate them in different ways… It was exciting!"

It is hard to be on an untrodden path. It is even harder if you have two or more different paths, with one of them being familiar to you, to force yourself to take the unfamiliar one. You naturally try to stick to familiar paths while coding. This is how our brain works.

Don’t have this fear of experiments! Once you had solved an interesting problem and then found out a new way to solve it, don’t hesitate, try it!

And now we have…

We, programmers, have a very short period of learning in comparison with musicians. How lucky we are! In a year we can be pros and this is not an exaggeration. Just keep up the good work.

  • Daily practice is a must for your successful learning.
  • Have small and big goals.
  • Dedicate 75-80% of your time to practice, 20-25% to theory.
  • Technical exercises — small easy coding tasks. Do them every day, at least 5 of them or even more. Do it from your very first learning days.
  • Tough tasks: Do them from your second month. Daily.
  • When you are ready (3-4 months of learning) start your own small project, which you can finish in 3-4 months.
  • Read the code of other developers, both beginners, and professionals.
  • Look for answers on forums and don’t hesitate to ask questions there.
  • Found/learned something new? Try to solve the old problem/task in a new way using this new knowledge!
  • Good luck with your learning!

Was published on

Top comments (0)