Showing posts with label learning. Show all posts
Showing posts with label learning. Show all posts

Sunday, January 1, 2017

Book review - Java 8 in Action


Java 8 was released in the first half of 2014, and it's awesome! The most notable Java 8 features are Lambda expressions, Stream API and Date/Time APIs. There are also a lot of other improvements like default methods which allow addition of methods to interfaces without breaking existing implementations and allow multiple inheritance of behaviour, but not state. Annotation on Java Types and repeating annotations were also introduced in Java 8.

Even if I was using some new features of this update for some time, I felt it was time to get a deeper knowledge of Java 8. There are several books already published on this topic. I've chose "Java 8 in Action: Lambdas, streams, and functional-style programming" based on the good ratings and high number of positive reviews at the time searching for a book, and let me say it, I don't regret it! The book was amazing!

Java 8 in Action is easy to read, but it keeps you excited throughout the whole book. The authors have done a really good job explaining the new features of Java 8. Throughout the book, new concepts are followed by small exercises which can help you to validate your understanding of the concept. A learning benefit for you is that each chapter ends with a good summary of what was discussed.

The book is split into 4 parts, first part is called "Fundamentals" and it contains a short introduction about why these new features are relevant to you, as a developer. In this part you'll learn about "Passing code with behavior parameterization" and get introduced to Lambda expressions. Second part is called "Functional-style data processing" in which Streams are introduced, explained and exemplified. You will be taught how to "collect data with streams" and you also get to learn a lot about parallel data processing and performance. Third part is called "Effective Java 8 programming", in this chapter you'll be introduced to Default methods, to Optional as a better alternative to null, some new concurrency utilities and the new Date and Time API. Forth part is called "Beyond Java 8" in which you learn more about Functional Programming and in which there is an interesting chapter called "Blending OOP and FP: comparing Java 8 and Scala", you'll like it!

As you'll read the book you will realize that it is not just about Java 8 features but you will learn a lot of other things as well. I strongly believe that after reading this book you will not only be able to use Java 8 features but you will also become a better programmer.

I really enjoyed reading this book and I strongly recommend it to you as well. Enjoy it!

Saturday, August 27, 2016

Book review: The Pragmatic Programmer - From Journeyman to Master


These pages published in 1999 contain a tremendous amount of wisdom for all programmers who wish to become software craftsmen. The book contains a collection of ideas, observations and recommendations for programmers who aspire to raise the bar of professional software development.

While reading this book you will feel like you are having a conversion with two very skilled software craftsmen, you might agree or disagree with their ideas but you cannot argue their judgment.

The authors did a nice thing introducing each chapter with a small context attached, also when new concept or section is introduced it has references to things to which it relates. Also there are interesting exercices at the end of each section.

When reading about portability concerns you'll find links to dead technologies like CORBA or OS like Windows 2000, this will definitely make you reflect on how fast technology has evolved. You'll also appreciate that while sharing knowledge about various topics, the authors shared some good jokes as well.

The book has eight chapters, some of the most interesting topics discussed are: estimations, there are amazingly useful tips about estimating, debugging. Also things to do before a project starts, and topics about pragmatic projects and pragmatic teams. At some point in the book you'll also find explanations for Liskov Substitution and Demeter’s Law.

As a software developer you'll find that even if this book was written many years ago, the shared wisdom is still relevant today.

Saturday, February 28, 2015

Book review: Thinking in Java - Fourth edition

To become a better programmer you should always look into reading new programming books, watch online tutorials or attend to related workshop. For Java programmers this book is one of the best and it provides detailed explanations and examples about the most important Java features.

I read this book once and later came back several times when I wanted to refresh my knowledge about a certain Java topic. As it has been such a useful learning resource for me I want to share it with you. To do so I composed a short and straight to the point book review.

Introduction

Thinking in Java was written by Bruce Eckel who also wrote other popular books like: Thinking in C# and Thinking in C++. The book was revised and improved multiple times, as a result of this multiple editions were published. The last one, fourth edition, was published in 2006.

In my opinion you at least must have little to medium programming background and prior hands-on experience Java/C#/C++. Besides this even if you are an experienced Java developer, if you did not read this book yet I highly recommend to do so as you will find a lot of information which will certainly improve your skills.

Good things

  • The book is designed in such a manner that it helps you to learn fast starting with simple Java topics like Operators, Objects and Access Control to more advanced Java features like Annotations, Concurrency and Graphical User Interfaces.
  • This book contains a lot of examples and exercises. 
  • Interesting and relevant references are given when approaching a new topic.
  • Explanations are easy to understand.
  • Author mentions deprecated methods and why those should not be used anymore.
  • Covers common pitfalls.

Bad things


Final note

Reading a technical book is not enough, to get most value of your time you should run all code samples, modify them to crash or even think how to improve them. Besides this you should also solve all exercises from the book in order to clearly understand the approached topics. So what are you still waiting? Open the book, start your favorite IDE and start learning!

Feel free to add your opinion in a comment about this blog post or about this great book.

Robert Rusu

Tuesday, April 29, 2014

Things that you should do in order to become a better programmer

All of us try to become better at what we do, as a programmer I will try to give you a small list of things that will help you to become a better programmer.

#1 Always try to help others

Its always a good thing to help others when they are in trouble, when they need to learn new things or they just need an advice!

First of all helping others will help you understand better a concept or that something that they need explained. Your knowledge regarding that technology or whatever you help them with will get better just by trying to explain it. Being able to explain it in simple ways and giving others simple examples denotes the fact that you can master it.

For example helping others understand a design pattern, explaining them when and how to use it might very well refresh your memory regarding what you know about it. This would be another reason to help others. Helping others will make you feel better however its also important to not neglect your work!

#2 "Learning from the big fish"

This is a term that I often use when I am trying to say that you should always try to learn new things from more experienced programmers. For example I always try to see how more experience programmers act in different situations, how they solve different problems and what practices they use.

Its very important to also understand why more experienced programmers use a tool instead of another or why they are applying a design a pattern instead of another. Just copying what the "big fish" do is not enough!

"Learning from the big fish" can be accomplished in many other ways than meeting them face to face, I suggest reading books, watching videos or tutorials, watching(or even better going) to conferences hold by other programmers, reading articles or by just asking more experienced friends how to solve a particular problem or what would be a common solution to a general problem.

#3 Training

In my opinion its very important to train your programming skills. Even if you work 8 h a day I suggest that you should spend some time improving your skills. Programming is a skill and every skill is lost if you are not continuously training. 

This might be consisted of just working on a personal project in which you use another programming language than the one you use at work. Yes, learning a new programming language will improve your way you are programming in your favorite language just by understanding new concepts, existing problems solved in another manner than you were used to or just getting a fresh perspective.

It might be just you trying to understand concepts that you did not quite understand during work. It might be something new that you will encounter at work and you are trying to get a perspective about it. Or it can just be you write some small program to sharpen your coding speed or improve your analytic thinking.

Good luck!
Robert Rusu

Monday, June 4, 2012

Event Listener Example

Here is an event listener example. I made a little game using Symfony2 framework and I needed to check if the user chose a hero(character) to play before trying to make some actions like view inventory etc.
src/HungryCoders/HeroGameBundle/EventListener/BeforeControllerListener.php:
<?php
namespace HungryCoders\HeroGameBundle\EventListener;

use Symfony\Component\HttpKernel\Event\FilterControllerEvent;

class BeforeControllerListener
{
  
    protected $session;
    protected $resolver;
  
  
    public function __construct($session, $resolver)
    {
        $this->session = $session;
        $this->resolver = $resolver;
    }
  
    /**
     * This is used to check if the user that wants to access some hero game controller
     * chose a hero to play with
     */
    public function onKernelController(FilterControllerEvent $event)
    {
        $controller = $event->getController();
      

        if (!is_array($controller)) {
            // not a object but a different kind of callable. Do nothing
            return;
        }
        $controller = $event->getController();
        $controllerObject = $controller[0];
      
     
        if ($controllerObject instanceOf \HungryCoders\HeroGameBundle\Controller\BattleController
        ||  $controllerObject instanceOf \HungryCoders\HeroGameBundle\Controller\HeroController
        ||  $controllerObject instanceOf \HungryCoders\HeroGameBundle\Controller\InventoryController
        ||  $controllerObject instanceOf \HungryCoders\HeroGameBundle\Controller\TownController
        )
        {
            if ($this->session->get('heroGameHeroId') === null) {
              
                $this->session->setFlash('heroGame.mustChooseAHero', 'You must choose a hero to play');
              
                //a way to create a new response without any redirect just create a response using a controller action
                $request = new \Symfony\Component\HttpFoundation\Request();
                $request->attributes->set('_controller', 'HungryCodersHeroGameBundle:HeroAccess:dashboard');
                $event->setController($this->resolver->getController($request));
            }
        }
    }
}


src/HungryCoders/HeroGameBundle/Resources/config/services.yml
parameters:
    heroGame.battle.maxRounds: 5
    heroGame.attack.rangeLevels: 5

services:
    beforeController.listener:
        class: HungryCoders\HeroGameBundle\EventListener\BeforeControllerListener
        arguments: [ @session, @controller_resolver]
        tags:
            - { name: kernel.event_listener, event: kernel.controller, method: onKernelController }

Twitter Bootstrap Quickstart

Today I found a great video tutorial on how to get started with Twitter Bootstrap. This is not related to Twitter API, Twitter Bootstrap is a cool HTML, CSS, and JavaScript application that helps you setup a site in minutes. This is a quick example of a few of it's features, you can get it here: http://twitter.github.com/bootstrap/
I am planning on using it on future frontend work on any projects that I can. Thank you http://jream.com/

What is Symfony2?

I found a great article wrote by Fabien Potencier on his website the topics that he reached are:
  1. What is Symfony2?
  2. Is Symfony2 an MVC framework?
  3. Why does it matter?
  4. Why Symfony2
  5. The Symfony2 Components
I really encourage you to read his post! Thank you Fabien Potencier!

Monday, May 21, 2012

How to Get the Most Out of Studying

Here is a playlist of videos made by a professor of physiology at Samford University in which he is explaining "How to get the most out of studying". I think this videos are very useful for everyone who is self learning or is a student.