Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Design Patterns and Best Practices in Java

You're reading from   Design Patterns and Best Practices in Java A comprehensive guide to building smart and reusable code in Java

Arrow left icon
Product type Paperback
Published in Jun 2018
Publisher Packt
ISBN-13 9781786463593
Length 280 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (4):
Arrow left icon
Kamalmeet Singh Kamalmeet Singh
Author Profile Icon Kamalmeet Singh
Kamalmeet Singh
Lucian-Paul Torje Lucian-Paul Torje
Author Profile Icon Lucian-Paul Torje
Lucian-Paul Torje
Sumith Kumar Puri Sumith Kumar Puri
Author Profile Icon Sumith Kumar Puri
Sumith Kumar Puri
Adrian Ianculescu Adrian Ianculescu
Author Profile Icon Adrian Ianculescu
Adrian Ianculescu
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. From Object-Oriented to Functional Programming FREE CHAPTER 2. Creational Patterns 3. Behavioral Patterns 4. Structural Patterns 5. Functional Patterns 6. Let's Get Reactive 7. Reactive Design Patterns 8. Trends in Application Architecture 9. Best Practices in Java 10. Other Books You May Enjoy

Imperative programming

Imperative programming is a programming paradigm in which statements are written to change the state of the program. This concept emerged at the beginning of computing and is very close to the computer's internal structure. The program is a set of instructions that is run on the processing unit, and it changes the state (which is stored as variables in the memory) in an imperative manner. The name imperative implies the fact that the instructions that are executed dictate how the program operates.

Most of the most popular programming languages today are based, more or less, on the imperative paradigm. The best example of a mainly imperative language is C.

Real-life imperative example

In order to better understand the concept of the imperative programming paradigm, let's take the following example: you're meeting a friend for a hackathon in your town, but he has no idea how to get there. We'll explain to him how to get there in an imperative way:

  1. From the Central Station, take tram 1.
  2. Get off the tram at the third station.
  3. Walk to the right, toward Sixth Avenue, until you reach the third junction.
You have been reading a chapter from
Design Patterns and Best Practices in Java
Published in: Jun 2018
Publisher: Packt
ISBN-13: 9781786463593
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime