►
From YouTube: Code Suggestions - Coding in Scala
Description
A walk-through of Scala coding with Code Suggestions
by Tan Le (https://gitlab.com/tle_gitlab)
A
A
So
we'll
start
with
a
really
trivial
example
here,
just
about
you
know
just
to
go
on
extending
the
existing
class
and
then
we
go
and
then
implement
the
spec
using
scalar
tests
as
well,
so
see
how
you
know
as
a
programmer
go
through
that
using
course
suggestions
as
a
way.
Just
you
know,
assistant
tools,
all
right,
let's
join
me
and
do
that
all
right.
So
here
we've
got
a
glass
cat
which
is
extending
the
pet
trait,
the
pet,
have
a
property
equal
name.
It's
a
string
types.
A
So
what
we
like
to
do
here
is
just
to
introduce
another
kind
of
pets.
I
would
say
you
know.
Probably
a
dog
will
be
nice,
so
I'll
just
start
typing
around
and
see
if
curve
suggestions,
gonna
suggest
anything
useful
for
me,
I
guess,
probably
there.
That's
that
we'll
do
so.
A
It's
actually
been
just
go
and
introduce
a
pet
Factory,
which
is
quite
cool,
but
I
don't
want
it
at
this
point,
and
this
is
this-
is
Grandma
the
introductions
of
the
new
class,
and
now
we
can
go
in
and
potentially
defy
a
classical
show
and
see.
If
we
can
instantiate
an
instance
of
a
dog
and
a
cat,
and
then
you
know
maybe
a
list
of
animals,
you
know
just
try
and
print
each
of
them
all
right.
Let's,
let's
form
that
so
created
a
variable
for
the
class.
A
Okay,
potentially
not
dry,
because
we
need
the
name
to
be
set.
A
A
A
See
what
what
give
me
a
lizpets.cap?
That's
so
reasonable
I
want
to
be
a
little
bit
picky
here,
but
you
know
using
a
right
buffer
instead,
so
I
want
to
be
specific
about
that.
A
Yeah
cool
all
right
so
trying
to
ask
me
to
show
the
the
list
of
animals:
it's
just
quite
cool
I
go
using
the
for
Loop
in
this
case,
but
I
don't
want
to
do.
I
want
to
be
really
particular
about
how
I
write
the
show
so
I
went
from
and
see
if
I
can
just
show
the
animal
names.
A
I
think
the
other
thing
that
it's
a
fair
quite
interesting
with
this
suggestions,
because
we
have
two
different
versions
of
Scala
and
major
versions
and
the
syntax
you
can
write
invariably
differently.
So
on
Scala
3,
for
example,
it's
slightly
different
syntax.
It's
actually
can
you
can
again
remove
certain
kind
of
closing
bracket
and
things
like
that
which
adding,
unfortunately,
the
tools
is
not
ready
to
pick
up
that
new
one.
So
sometimes,
if
you
want
in
scanner
3,
sometimes
it
just
Scala
2,
for
example,
which
is
quite
quite
annoying,
so.
A
A
All
right,
so
red
buffer
is
not
found,
so
we're
missing
an
import
ant
all
right.
So
this
is
something
that
I'm
quite
bad
at
this
is
actually
to
understand,
or
at
least
to
to
know
what
path
to
import
from
the
libraries
so
with
the
intellisense
most
of
the
time
we'll
do
it
from
a,
but
I
would
want
to
see
how
close
suggestion
performed
this
way,
to
figure
out
how
you
know
what
the
import
path
is
for
common
Library.
A
Obviously
so
I
just
want
to
promote
it
to
say
Scala
array,
buffer
buffer
from
collections,
because
I
know
of
different
collection,
so
it
could
be
a
various
different
versions
of
it.
They've
actually
come
up
with
something
useful,
I
think
that's
spot
on
there.
A
All
right
so
there's
no
main
methods
to
actually
connect
with
me.
A
And
Rover,
which
is
quite
nice,
so
I,
think
that's
really
good.
A
Let's
go
and
Implement
some
specs
for
the
classic,
which
is
written
just
pop
over
to
Pat's
back
in
this
case,
I
might
just
kind
of
start
from
scratch
and
see
if
it
actually
come
up
with
something
useful,
so
you're
gonna
front
it
I,
guess
right
a
spec
to
stand
flat
stack
I
want
to
use
it
quickly
now
with
matches
for
maybe
for
a
cat
class.
A
However,
this
needs
to
be
fixed
up,
because
we
want
to
use
the
matches
as
well
so
shoot
matches
I,
guess
that
could
be
improved
in
a
way
I
formed
it,
but
I
think
it's
pretty
good
to
just
to
provide
me
with
the
Class
cast
back,
expand,
I've
lost
back,
which
is
good
afternoon.
If
you
do
cover
it
a
lot
in
this
space,
you
know
what
to
type
anyway.
A
A
A
Okay,
so
let's
see
it
actually
run
compiled
desk
correctly.
A
So
I
think
originally
with
flat
stack
but
later
with
the
newer
version,
they
move
it
to
any
flat,
spec
I
think
also
the
name
I
have
to
add
it
in
Brackets
as
well.
A
Here
we
go,
we've
got
a
green
test,
so
that's
concluded
our
experimental
suggestions
after
you,
like
it
languages,
for
example,
kotlin
and
see
how
I
perform,
but
for
now
I
think
you'll
have
to
see
how
it
goes.
Suggestions
help
programmer
on
a
day-to-day
kind
of
tasks
like
this.
So
all
right,
thanks
for
watching.