
watching fun fun function a viewer Cory
sent in this question what are your
thoughts on various diagramming systems
eg UML and ADL for code documentation
and how often do you use them for the
ones of you that don’t know what this is
UML and ADL I had to look up with ADL
was by the way they are visual languages
like they are basically very specific
ways of drawing boxes with arrows
between them to describe different parts
of software architecture how classes
relate to one another how long how
databases how databases look basically
and then stuff like that since these
languages are pretty specific there’s
also ways of actually generating actual
code from these diagrams and and also
the inverse generate these diagrams from
code I’m using UML a little when I
started out as a developer and the more
I try to use it the more I found that it
was a very elaborate waste of time
and I’m far from the best developer in
the world but I have worked with some of
the best developers in the world and
none of them are even close to using UML
when communicating our own code what you
use when you communicate around code and
want to describe high-level context
complex concepts it’s using a white
board we use white board and you and you
draw arrows between them you talk with
your colleagues around that that is how
you describe software and of course
that’s not very specific but that’s kind
of the point
when you’re making a map of a city you
don’t want to draw every single eye
every single thing that is on the street
you want to draw only the things that
are relevant specificity specificity is
not the goal when you are describing
high-level concepts you’re making a map
for the person so to speak if you
actually need specificity that
what we have computer code for actual
code code is what we use to describe
very very specific relationships
like exactly how things are supposed to
work that’s what what code is for I
don’t really sense this is lost on a lot
of people that code the computer code
like JavaScript and C sharp or Java or
C++ this code is this is for humans to
read and write the computer does not
actually understand JavaScript or C++
that is compiled down to machine code
which is just some for us unintelligible
garbled that a computer actually can
understand
so programming languages there for us
they are languages for us to communicate
with each other so that I write some
code and you can reasonably read that
code and then that is compiled of
something the computer can understand
but the code is for our collaboration as
developers or if you’re not in a team
it’s yes therefore so that you can
understand what you’re for myself was
doing and this is why things like
specification software specifications in
documents in written in English don’t
work if you’re not familiar with writing
specifications for software you’re doing
it for the first time you will believe
that you can define at least largely the
software all the software details and
translating that specification to code
will be as relatively easy this is of
course incredibly untrue as anyone that
has tried to do this knows English is a
language that is not terribly expressive
it’s it’s not good at describing things
exactly it’s very good at describing
things roughly for example if I look out
the window here I will see that there is
there is a bus stop a lamp Pole and a a
some kind of flower bush and a road that
gives you an idea a
of how what things look outside of my
window but if you were asked to draw
that exactly from my description you
would probably be pretty far off my
brother who is an artist he said it’s a
very technically act but it’s not a
programmer and a lot of people that come
into programming for the first time and
they see code they believe that this is
out this stuff this is where the
computer this could be made a lot easier
we should we should be able to do make a
visual programming language where we can
draw we think of draw our programming
stead and so that we don’t have to type
it out it seems that seems very archaic
programming that should work like any
other software it should be visual and
easy to do and then you run into the
very same trap here like you believe
that boxes and arrows and visual
constructs like that are effective at
describing complex relationships and
they really are not they are very good
at describing them roughly like if you
if I say okay roughly here here’s the
model and here’s the controller and
here’s the view and you draw arrows
between them then I that that is good at
describing the rough idea but if you
actually try to implement this and
actually map this this construct exactly
towards what the the logic actually
actually looks like things are going to
start breaking down and you’re going to
start seeing how how rough this this
tool is and it’s fine that they are
rough then I see then that’s super
useful it is very useful to draw things
for people and it’s very useful for me
too to say rough things about the
environments outside of the outside of
the window that is useful for you when
making sense of reality but we must not
fall into this trap of believing that
just because English and drawings are
good at describing
concepts in reality in a rough way we
can also use them to describe conference
concepts in a specific way that does not
work very well to describe things like
physics for instance we are going to
need a language that is very well
adapted at describing physics like math
and in order to specifically describe a
software system we’re going to need a
language designed to do just that which
is a programming language and this is
the essence of why specifications don’t
work they don’t work because if the
specification was so good that it
described the whole software system the
specification would be code if we want
to describe a software system exactly
then we use code that is what code is
it’s a perfect description of a software
system writing specifications and plans
and describing architecture and software
using languages that are not programming
languages it’s kind of like squeezing a
soap you you have to squeeze just right
and if you try to squeeze too hard you
soak your scores good and this is my
problem with UML it tries to squeeze the
soap too hard these tools they try to
give an overview of software at the same
time as giving a lot of detail and that
just creates a tool that is good at
neither you can become even more
philosophical with this you can talk
about mental models in general for
instance like a bus is passing outside
my window right now and when I say but
that word is a mental construct for me
we have this roughly the same
abstraction you have you have an
abstraction in your head about how this
bus looks like and I have an abstraction
in my head about how about looks like
however both our models are very far
from what a bus looks like in reality on
a detail level and that is the way it
should be in order for the abstraction
to work it has to get rid of a lot of
detail and be very decouple from the
actual
actual object that’s what an abstraction
what a model is a map of your city it’s
meant to lie a little bit another
parallel I would like to make is to
language cucumber cucumber is a language
that looks very much like English that
you use to write specifications for
software and those specifications are
executable so you can write things like
given that I navigate to the home page
and I click the cart icon then I should
find myself on the cart page and then
you specify a step like for given that I
navigate to the home page you write the
actual code that will remote-control the
browser to go to that home page and then
you like repeat that until you have all
the the steps specified and the whole
idea with this is to give this as part
of the behavior driven development
movement by the way that do that this
can be used as a language that you and
the customer can use it gives you an a
customer and common language which is a
great idea are you really like the idea
appeals to me a lot but I have never
quite been able to pull it off in
reality because cucumber as a language
it has two responsibilities if on the
one hand it’s supposed to give the
customer an overview of how the system
looks and how does the behaves and on
what the other hand is supposed to have
be a way of creating these test
specifications that the test system can
parse and execute and verify that they
work and in trying to do these two
things at the same time it’s kind of a
next mediocre at both because in order
to do this thing
be executable it needs to be pretty
specific and in order to be pretty
specific it needs to sacrifice this
overview because it may it becomes hard
for the customer to to understand the
system from the specifications because
they tend to be like there’s a lot of
noise from the detail that you need to
add in order to have this thing work and
it works the other way too because in
order to make this thing work make the
overview make it feasible for the
customer to have an overview you need to
sacrifice a lot of detail you can show
all of the execution stuff in the
Cucumber specs so it becomes kind of it
becomes kind of problematic for for this
thing too because it’s not quite as
specific as you would like it to be so
if you’re creating a communication tool
and remember code is like it’s a
communication tool then you can either
have one that is good at describing
things on a very high level with low
detail or you can have a tool that is
very good at describing things at high
detail but very bad at giving an
overview and a high level perspective
and if you try to create a tool that is
in the middle it’s gonna be bad at both
those are my thoughts on UML you are
just watching episode of fun fun
function I release these every Monday
morning Oh 800 GMT but if you don’t want
to wait that long if you check out this
episode that the machine learning known
that Google have selected for you I am
mpj until next Monday morning sanctuaries