From the course: Functional Programming with Java

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

What is declarative programming?

What is declarative programming? - Java Tutorial

From the course: Functional Programming with Java

Start my 1-month free trial

What is declarative programming?

- [Instructor] So now that we're a little more familiar with the main problems that functional programming can help us solve, the next thing you'll want to understand about functional programming is that it's a declarative style of programming. And this is in contrast to things like object-oriented programming and procedural programming, which are generally imperative styles of programming. So then we have two contrasting styles of programming here, declarative and imperative, what's the difference? Well the simplest way to put it is this. Imperative programming focuses on how to do things, whereas declarative programming puts more focus on what things are. Let's look at this in a little more detail. A simple example of this would if we were to talk about houses. If we wanted to describe a house in a declarative way, that is if we wanted to describe what a house is, we might say that a house is a foundation, four walls, and a roof on top. On the other hand, if we were describing a…

Contents