Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Preview
Start a free Courses trial
to watch this video
Let's get started!
Learn more
- Imposter Syndrome sketch
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
[MUSIC]
0:00
Hello.
0:04
I'm Craig and I'm a developer.
0:05
In this course we're going to
explore functional programming and
0:07
specifically how it relates to Java.
0:10
Before we get started I want
to ask that you familiarize
0:13
yourself with your learning environment.
0:15
There are speed controls on the video
player that you can use to speed me up or
0:17
slow me down.
0:22
I won't mind at all.
0:23
In most videos I'll drop more
information in the teacher's notes.
0:24
So be sure to make a habit for
0:27
checking that area for
more juicy tidbits of knowledge.
0:29
And finally if anything at all, and yes,
I mean anything, piques your interest,
0:32
confuses you or if you just want to chat
with somebody about an idea you have,
0:37
there is an amazing community
forum that is attached to
0:41
each of these videos and exercises.
0:43
Please share your thoughts,
ideas, and concerns.
0:45
Okay, so, functional programming.
0:47
You've probably heard of it,
it's been around for a super long time.
0:52
Like since the late 1950's, well it's
been gaining a ton of attention lately.
0:56
And we'll explore why
that is here shortly.
1:02
Now without a doubt you've heard, or
1:04
going to start noticing this term
buzzing around tech circles.
1:06
Before we dive into the why, let's talk
a bit about its relationship to Java.
1:10
With the release of Java 8 in March 2014,
1:15
a bunch of functional programming concepts
can now be expressed in the Java syntax.
1:17
Before that they couldn't.
1:22
Now the big thing that Java introduced
in version 8 was the concept
1:24
of what is known as a function.
1:28
A function in practice looks
an awful lot like a Java method.
1:30
They define parameters, they have a body
that are a series of statements and
1:34
expressions, and
finally they return a value.
1:38
Here's the thing though.
1:41
Prior to Java 8, this method could only
exist as part of an object or a class.
1:43
Now restated,
a method belongs to the object or class.
1:48
With the creation of a function in Java 8,
this ownership no longer exists.
1:53
It's now a thing all on its own and
it can now be referenced and
1:58
passed around like any variable.
2:01
This is what is known as making
a function a first-class citizen.
2:03
A method is really just an owned function.
2:08
Now the term function actually
comes from mathematics.
2:11
And you can probably recall using them,
2:14
depending on how long ago that
type of study has been for you.
2:16
We'll dive deeper into what this means and
2:20
bring in some math terms, as needed
through out the course, but very lightly.
2:21
Math could be a source of concern for
some folks.
2:26
So, if you are one of those folks,
I just want you to know,
2:29
I'm gonna take it slow and steady, and
there is nothing to concerned about.
2:32
An important thing to remember,
right off the bat, is that
2:37
functional programming is a completely
different style than the imperative
2:40
object orientated style of programming
that we Java Doves have been used to.
2:44
It comes with many years of study and
rules, and
2:48
can seem a bit daunting if you
try to take it all in at once.
2:51
Now, the reverse is true,
of course, right?
2:55
For functional programmers, our imperative
style comes with its own set of rules and
2:57
ceremonies that you can't just
pick up all in one sitting.
3:01
They are two different ways of thinking,
with completely different sets of laws and
3:05
dances that we must learn and perform
In order to bring our ideas to life.
3:09
An unfortunate common
reaction to this daunting,
3:15
unknown feeling is to completely
dismiss the technology.
3:17
Let's agree not to do that.
3:21
I've seen too many developers
fall into that trap.
3:23
They see something they
don't fully understand and
3:25
then they trash talk in
the comments section.
3:28
Let's agree to be patient together,
and talk things through, and
3:30
basically just be adults about everything.
3:33
Because there'll be so
many new terms in this course,
3:36
I'm going to employ a practice
that teams often use in meetings.
3:38
It's called the parking lot.
3:41
The way it works is this, when you uncover
some information that is important,
3:43
that you wanna make sure
that we talk about,
3:47
you don't want to interrupt
the current flow of the conversation.
3:49
So you park the information
in the parking lot.
3:51
We'll use it a bit like a to-do list for
3:55
understanding the plethora of new
terms that appear in this course.
3:56
Now, for some of you, this might be
the first time in a very long time that
4:00
you've had to think differently
about your style of programming.
4:05
And it's probably going to feel
a little off-putting at first.
4:08
Now try to remember,
this is relatively new to the Java world.
4:11
So do not let imposter syndrome set in.
4:15
Everyone is pretty much relatively
new at doing this in Java.
4:19
And it is okay to feel however you may be
feeling about the language's evolution.
4:22
Give yourself a break and
some time to just let it sink in.
4:26
So for this course, we'll ease into
using functional programming Java.
4:30
We'll start from the very top, and
we'll work our way into the concepts.
4:34
Along the way,
we'll replace our current way of thinking,
4:38
the imperative, with a more declarative,
functional approach.
4:40
We'll take a hands-on approach and
explore a dataset together,
4:44
that we can use to simulate Big Data, and
then we'll explore the new Streams API.
4:47
After you've gotten your feet
wet with the new tools and
4:52
understand how they work, we'll circle
back to the specific rules that make sure
4:54
the general concepts of functional
programming are understood.
4:58
Let's take a look at why functional
programming is gaining popularity across
5:02
all languages right after this break.
5:06
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up