Immutability makes your programs more robust and easier to test and debug. Learn how to avoid state change and the many problems that come with it.
- [Instructor] The first major concept … of functional programming is immutability, … and it's a concept … that may surprise a lot of people at first. … You see, most programmers learned early on … that you could assign a value to a variable. … For example, we can define a variable called X … and store the value five in it, … and then later on in the program, … we can change the value of that variable … to some completely different number, … and later on, we can change its value again … and so on, so forth. … However, in functional programming, … this is actually not allowed. … When we say that X is equal to five, … we mean that for the rest of the program, … X will only ever be five. … There's no way we can change it. … In short, immutability means that we need to treat … most of the values in a program as constants, … and this can either mean that we use Java's final keyword … to make sure that we don't change a given value, … or we can simply learn to write our code in such a way …
Skill Level Advanced
Java Design Patterns: Structuralwith Bethan Palmer1h 38m Intermediate
1. Introduction to Functional Programming
2. First-Class Functions
3. Working with Streams in Java
4. Advanced Concepts
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.