Trisha Gee on Building a Buzzword-Compliant Web App | GOTO 2014
Recorded at GOTO Conference 2014
•
•
UGtastic Archive
Trisha Gee on Building a Buzzword-Compliant Web App | GOTO 2014
Loading this player connects your browser to Youtube.
Full Transcript Available
LIVE CC
UGtastic Archive
Press play or click any turn in the transcript to start real-time synchronized playback...
📼 FROM THE UGTASTIC ARCHIVE (Recorded on-site at GOTO Chicago 2014)
Archival conversation with Trisha Gee on building a modern web application with Java, MongoDB, and AngularJS, recorded at GOTO Chicago 2014.
Recorded during the 2009-2015 software craftsmanship and developer community movements, this archival interview captures early ideas, debates, and community organizing in real time.
---
🏛️ ORAL HISTORY RECORD:
• Series: UGtastic Technical Conversation Archive (2009-2015)
• Recorded: GOTO Chicago 2014 (May 20-21, 2014)
• Guest: Trisha Gee
• Interviewer: Mike Hall (UGtastic / https://www.just3ws.com)
• Legacy UGtastic Archive ID: sZee7lRAUF4
📖 FULL ARCHIVE & ORAL HISTORY:
https://www.just3ws.com/interviews/
🏷️ TOPICS: Trisha Gee, GOTO 2014, GOTO Chicago, Java, Web Architecture, Software Craftsmanship, UGtastic, Mike Hall
Restored and preserved by Mike Hall (https://www.just3ws.com)
The Guest
Unattributed voices
UGtastic archive transcript with speaker attribution pending
The Presentation
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
Hi, it's Mike with Ubitastic. I'm here again at GoToConf
2014. I'm sitting here with Tricia G, who gave a talk about,
well, to me it almost sounded like the nightmare web app
scenario, a whole stack of topics, but you'll be able to
tell us all about what you worked in and whether it was a
nightmare or a dream. But first I want to say thank you for taking the time to
speak with me, and can you tell me what the title was,
because it was a lot of stuff in there.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
I think it was AngularJS, HTML5, Java, MongoDB, and Groovy. That's a lot of stuff. Yeah, what could possibly go wrong? Yeah, I couldn't imagine.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
Or actually, I could imagine. But
what was that? I guess you'll tell us in a minute whether
that was a good thing or a bad thing, but what was the
basis for that talk, and what did you talk about in there? So the thing was really that I wanted to do, so the last
few talks I've done were very high level, very architect-y,
and I wanted to get back down to something very code-y, and
do something which kind of demonstrates what we do on a
daily basis as developers, and show, one of the things I
didn't want to do is do a toy application, something which
is totally not realistic,
or do a deep dive on one particular piece of technology,
because in the real world, you have a whole app with lots
of moving pieces.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
And I wanted to show how those moving pieces interact,
where they belong, and kind of what their role is. And the other thing that motivated it was, I get asked a
lot, like what is, by people who are non-Java people, what
is the Java front-end of choice? And of course, the answer is, it's not Java. It's web stuff.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
So, and I realized I was way behind the curve on web stuff,
so I started looking at Angular and HTML5 to see what that
was like. And it turns out that Angular is a lot easier to pick up
than I thought, and it fits quite nicely with REST and web
services and JSON stuff. So, you could fire off stuff from an Angular front-end to a
Java back-end, and especially using MongoDB, because I work
for MongoDB, which kind of stores stuff in a JSON-type
format. That stack works quite nicely together, passing JSON
messages around, persisting it in the database, and passing
stuff back up again.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
And you're using JSON on the front-end, I mean, JavaScript
on the front-end, and JavaScript on the back-end, so... Yeah, kind of. Well, I mean, the... It depends what you
mean on the back-end, so...
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
Well, I should say the Mongo. I mean, I'm sure you're doing
web producers and things like that. So, yeah, so I didn't get as far as any of that stuff, but,
yeah, there's a JavaScript on the server for MongoDB, so
when I'm doing my queries in MongoDB, it's JavaScript. And the objects are very JavaScript-y for MongoDB.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
And I think, for me, as a Java developer, and I've been
doing back-end Java stuff for a while now,
I had not really realized where the front-end had moved to
recently, the way that things like Angular works. And because of that, I wasn't really aware of how the
JavaScript was kind of thinking, if you like, on the back-end
with MongoDB,
because I'm thinking in a Java-type way. So it was nice to tie all those together and sort of see,
this is kind of how it works,
and this is where your head needs to be to get it all to
work together. So you have this laundry list of technologies to build a
stack.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
What did you build? I built a web app, which is designed to be used on your
phone, and you're walking down the street and you think,
I need a coffee, and I need a coffee so badly, I'm going to
order it from my phone. I do that all the time. Right.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
I'm going to order it from my phone, and then by the time I
get to the coffee shop, it'll be there. And then this requires you to do things like, what I wanted
to showcase was, obviously, some things from MongoDB. You can do geolocation searches. So I can send Mongo my location and say, given your list of
coffee shops, give me the closest one.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
And that's quite simple in Mongo. So you don't get any choice. You don't get to say, I want to go to the closest Starbucks. Right.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
But you can say, right, this is my coffee. Send it to my closest place and tell me what that closest
place is. Yeah, because it's just coffee. Right, exactly.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
It's going to be a latte wherever you go. Yeah, yeah. So yeah, that was the idea. Okay, so you built this app.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
Do you walk through your development process in the talk? Yeah. So the aim was to walk through from zero. So one of the other – so obviously, I had multiple
motivations in this talk.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
But one of the other things I wanted to address is people
always say, well, Java is difficult to – it's long-winded
to develop in. It's difficult to get started. So people tend to prototype in languages like Ruby, which
is fine. There's nothing wrong with Ruby.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
But, you know, often then when they get to a point where
they need to scale, they often move to the JVM. Right. So I thought, okay, how – is it really true that it's
difficult to prototype in Java? Let's try and do something tiny like this in an hour and
get it all up and running in Java from zero, from nothing.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
I haven't installed an app server somewhere. I don't have a cloud server or something. It's just running on the laptop. So I start from zero, and I use this library – well,
framework called Drop Wizard, which starts up Jetty and get
really lightweight, JSON stuff, kind of without having to
do anything particularly challenging, and then build up
from there, then build up the UI a little bit piece by
piece, trying to use user stories to say, right, now I've
got this.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
Now I want to move on to this. Now I need to do this. Now I want to make it look pretty. And one of the other things was I added Bootstrap into the
mix because as Java developers, we tend to think that web
development is difficult to do in a pretty way, and it has
been.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
But with Bootstrap, we just kind of get a vanilla, not ugly
web app for fairly minimal cost. Yeah, and it's like looking at the title of the talk, and
as a web developer myself, I'm familiar. Okay, yeah, that's all normal stuff, and I can kind of divvy
up what goes where in that stack. But I have to imagine somebody who's maybe not so well-versed
in that stack just looks at that and just hears all these
technologies, and it's just kind of daunting to look at
that and be like, what does all that stuff do?
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
Is that what you kind of wanted to help make less daunting? Yeah, I kind of wanted to show the niche for each
technology, specifically, like I said, things like don't
put Java on the front end. It doesn't really belong there. And I also heard, I've been to a bunch of conferences
lately, and I find out that lots of Java programmers are
doing JavaScript as well.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
I wanted to see what that looks like. I want to see how they talk to each other. So this way, by saying, right, this is the user story we're
going to do now, that requires an Angular thing on the
front end here, a bit of JavaScript here, and then
something on the back end here to take that request and
send it to the database. And you can sort of see where all the pieces fit together.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
That was the goal of it. And did you do any live coding, or was this mostly pre-built
snippets that you were walking through? Oh, it's all live. Oh, okay, it's all live.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
You said you were incredibly brave. Well, yeah, I rehearsed it, like, many, many times
beforehand. And that's the what could go wrong part. Yeah, and when I gave it at QCon London, right at the very
end, it didn't work, and I was absolutely devastated.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
And then it turned out that there's a few different error
cases, one of which is, if your Wi-Fi isn't on, the HTML5
thing, can't find, blah, blah, blah. I don't know. Yeah. But to begin with, at the very beginning, I'm doing all
just straight, pure coding.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
I'm using IntelliJ to help me, so it does loads of autocomplete. There's loads of live templates in IntelliJ, which will
generate things like HTML and stuff for you. So if you say input select, it will generate an input
select for you, which is great. Okay, so then I can just fill that in.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
Right, and one of the things I wanted to show is that if
you use the tools properly, you don't have to spend all
your time typing,
because typing is not the difficult thing. Right. It's kind of understanding what you need to do. So at the beginning, it's all live, live, and then
gradually, as it gets more complex,
and I don't need to repeat the same sort of typing for a
different widget on the screen,
then I cheated with some live code snippets, so I type in a
shortcut, and it does that bit.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
Okay. But, yeah, most of it is you have to remember them in order
and do it live. Yeah, and like when you said about the, it's not
necessarily the typing. I had a sticker for a while called, typing is not the, it
was, it's a little slogan, was typing is not the bottleneck.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
Right. It's what do I want to do. And I'm wondering if that's what also you're trying to say,
is that it isn't the tool, Java isn't slow,
it's the thought process you have to do, and maybe the way
you have to think might be a little bit harder,
because you might have to do a little different order. But, I mean, is that something that came out in the talk,
or?
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
I'm not sure. Maybe. I mean, that's kind of the, it should be clear that the
typing is not the bottleneck,
because I do this program, and I create something from
scratch in 50 minutes by typing it out. But it didn't take me 50 minutes to create it the first
time around.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
Right. You know, it took me a week to learn Angular, to get an end-to-end
piece working with Angular when I've never used it before,
another half a day to get to bootstrap, then another couple
of days just to finish it all off. Right. So, it took me nearly two weeks to create the code, which I
can then type out in 50 minutes.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
Yeah, and that's the trick. It sounds like the overnight success in 10 years. Right. It took two weeks to be able to write an hour, but that
investment, you know, once it's sunk, you now can do that
again.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
Right, exactly. And I wanted to say, you know, most of that week and a half,
two weeks, was me learning Angular in one week. Now, I don't pretend to be an expert in Angular. I kind of show how it works, but I don't, and I kind of say
a little bit of, obviously, what I'm doing and why I'm
doing it.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
But I'm not pretending this is best practice. This is how you do Angular. The point is, in a week, you can be up to speed on Angular,
and you can write some quite nice modular code,
which reads in a sensible fashion, whereas as Java
developers, we tend to think of JavaScript as being blah,
you know,
this big mess of procedural code. And I want to say that in a week, you can be writing quite
pretty-looking Angular.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
And hopefully, if I give this talk again, I can perhaps
find some better patterns for Angular and get them even neater. So, diving in, so you're working for Mongo, and obviously,
JavaScript is important for Mongo. But when you were able to look at JavaScript from another
perspective of writing Angular,
was any of that able to come back into your work on Mongo
and be like, oh, this kind of changed the way I look at how
I write JavaScript? Yeah.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
I mean, I'm not doing lots of JavaScript with Mongo, but
obviously, we use JavaScript all the time to interface with
MongoDB,
and the JSON objects are obviously JavaScript objects, and
something which kind of passed me by in a way,
because when I was writing JavaScript back in the day, it
was like this procedural thing. You didn't have objects, really. And so, it really, doing the Angular stuff made me realize
what JSON objects look like, what you can do with them,
how, you know, you can treat them. And it did give me some thoughts on what I'd want to do
with the Java driver, because we, the Java driver,
you've got the Angular front end, you've got Java in the
middle, and as you say, something JavaScript-ish at the
back end,
and the messages have to pass through those layers.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
So, how do we make the Java driver more friendly for those
things while still being idiomatically Java-ish? Because, at the moment, the translation into a Java object
in the Java driver is a little bit clunky,
because they don't have this idea of nice, lightweight, map-ish
objects. So, it did kind of help me rethink. I haven't rewritten the Java driver for it yet, but it
really helped me understand the shape of those things a lot
better.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
Okay. Well, thank you very much for taking the time to
speak with me. No problem. User groups with lots to say, interviews, and more.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
No way! Sharing great ideas in the tech community. Fascinating conversations, a plethora of information. Find out for yourself today at ugetastic.com.
Unattributed voices
UGtastic archive transcript with speaker attribution pending
▶ Speaking
Thank you.