I'd like to write better Ruby or JavaScript code for example. I feel i can write code that works but how can i improve it plus reading books?
Reading others' code certainly helps. We had a similar discussion couple of months back. Do take a look - It discusses how and where you can read code written by other developers. Focusses on JavaScript, but you will get the idea.
Starting point: Explore repos on github of your interest and use https://www.codetriage.com/ to get a handful of issues from your favorite repos in your inbox every day. This service will help to save your time searching for issues.
Later you can narrow down projects to contribute and go directly to issues list and pickup.
Also look for PR generated in the project you are interested. It will give you different viewpoints which is very important for building real engineering capability.
Steffen Cope
Indelible Web.
Learning from others: go to github and search for some seed projects that contian some keywords that interest you, try 'ruby blog' for example, CRUD apps are a good way to get to know coding styles, as you will already be slightly familiar with what the code is doing in any file by its filename and project architechture. Look at frameworks in the given language - how have the 'big boys' gone about doing tasks - can and should you try somehting similar?
Generally improving your code: jsperf.com is a good excersize for benchmarking. If you want to improve performance there is nothing better than tinkering with some loops or expressions and being able to judge how that affects speed directly. apart from that read read read, try looking for the 'eloquent javascript' series that guy can explain things well - often you will find that you can move the same concepts into other languages, try out some conference talks aswell people put a lot of effort into presenting their ideas, you can find many on youtube, or actually going can be good if you can persuade your boss to pay.