Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Teaching Java, teaching what?

Reply
Thread Tools

Teaching Java, teaching what?

 
 
Arne Vajhj
Guest
Posts: n/a
 
      12-10-2013
On 12/9/2013 11:02 AM, Arved Sandstrom wrote:
> On 12/09/2013 09:34 AM, Stefan Ram wrote:
>> Silvio <(E-Mail Removed)> writes:
>>> Why not have them write a simple Servlet or two?

>>
>> The time for teaching is very limited: I now often have only
>> 30 hours to take students from no programming experience
>> whatsoever to first steps with Swing including exercises
>> done in the classroom. When teaching Java with Swing, I need
>> the JDK as the one single dependency: javac Main.java, java
>> Main, and that's it.
>>
>> I have the impression that teaching servlets is more
>> time-consuming, because the toolchain is longer and the
>> configuration and application of more tools needs to be done
>> and explained.
>>

> I don't see it myself, that teaching servlets would be more
> time-consuming than teaching Swing (or JavaFX for that matter). In fact,
> I think that teaching servlets affords an excellent opportunity to
> introduce students to important real-world stuff:
>
> 1) using libraries;
>
> 2) the ubiquity and importance of app servers;
>
> 3) HTTP request-response handling;
>
> 4) how servlets underlie many Java frameworks, with a brief intro to how
> the frameworks build upon the servlet API.
>
> Can this be done in 30 hours, especially for programming neophytes?
> Maybe not.


Almost certainly now.

It is very useful topics - more useful than Swing, but I can not
see them as step one.

There are too much stuff to learn to get anywhere.

I provide some help at a danish web forum for IT problems. And
there are one university where they have a programming course
in first semester. They decided on Java - which I think is a
fine choice. But they want them to learn Java by doing JSF web apps,
RESTful web services etc.. The result is not pretty. The students
that should learn about data structures, control structures, OOP
etc. are looking at things generated by Eclipse wizards and they have
no idea about what all that stuff is doing.

> But I'm not convinced you can accomplish more by doing "first
> steps with Swing". The issue here may be that 30 hours isn't
> enough...


If kept simple with JLabel, JTextField, JButton etc. I think they
can make something work *and* understand what they are doing.

> but I myself have a gut feeling that you'd do better with a
> servlet approach.


I am not sold on that.

> For a barebones first approach, I think we can over-emphasize the
> importance of GUIs (web or desktop) as being what beginners expect to
> see, or what they feel comfortable with. I'm probably dating myself
> here, but back in the '70's when I learned programming with FORTRAN 66
> and FORTRAN 77, I (and most of my peers) grokked program output to
> printer or tape, and program input from similar sources. It's also not
> difficult to relate a console input prompt to an HTML text input box -
> students understand that what matters is what you do with the input, not
> so much how you got it.
>
> Let me put something else out there. 30 hours is a short semester if we
> suppose three 1-hour classes per week. Is it even realistic to try and
> introduce any kind of GUI (Swing, JavaFX, servlets with simple HTML etc)
> in 30 hours? Perhaps console output is all you should shoot for.


Console apps would certainly be better in the sense that there are even
less context to learn.

The problem here is probably more in the area of motivation. A console
app does not look fancy and that could be demotivating.

Arne


 
Reply With Quote
 
 
 
 
markspace
Guest
Posts: n/a
 
      12-10-2013
On 12/9/2013 5:11 PM, Arne Vajhj wrote:

> But they want them to learn Java by doing JSF web apps,
> RESTful web services etc.. The result is not pretty. The students
> that should learn about data structures, control structures, OOP
> etc. are looking at things generated by Eclipse wizards and they have
> no idea about what all that stuff is doing.



This is intuitively what I would have guessed. Beginning students need
to actually write their own code. It's part of the process that makes
them learn.


> The problem here is probably more in the area of motivation. A console
> app does not look fancy and that could be demotivating.



I think simple GUI calls would be OK. JOptionPane.showMessageDialog()
is fairly painless way of making GUI windows. Ditto for most of the
other JOptionPane static methods. You could get quite a bit of mileage
out of just that class.

If you wanted more, I'd keep the GUI layout very simple, and just give
the class the GUI code to copy. Show them where the entry point is and
just let them call that. I did a large project in my senior year of
school where two grad students had written most of the code and we were
just to "fill in the blanks" where the instructor removed the bits he
wanted us to learn. It was a fairly efficient way of understanding code
as well as having a large project working without a lot of busywork or
endless debugging.

Note that all Swing code is now not thread safe. It all has to be
called on the EDT. That's a further complication, but one I think
students should be exposed to. If not, you'll cause dissonance when you
tell them the way they've learned to write code all along isn't correct.
Some just won't believe you.


 
Reply With Quote
 
 
 
 
Silvio
Guest
Posts: n/a
 
      12-10-2013
On 12/10/2013 02:02 AM, Arne Vajhj wrote:
> On 12/9/2013 10:17 AM, Silvio wrote:
>
> A desktop app is very standalone.


Yes, it is.

>
> Web means:
> - two apps: browser and server


Yep.

> - knowledge of at least HTML required (CSS and JS optional)


Like I already mentioned.

> - a little bit of knowledge about HTTP and the interaction


Likewise.

>
> And web is often less OO than desktop apps, which may move
> focus from the purpose of the course.


I usually get nervous twitches when people start saying something is
more or less OO. There is no such thing as general OO-ness and saying
that web is less OO than desktop is complete nonsense.

An entry level course usually focuses on general stuff like classes,
instances, encapsulation and methods. I personally think command line
test code is best suited there since it distracts the least from the
main topics.

Swing brings an enormous amount of extra logic into the picture. Apart
from the fact that you have to discuss components and hierarchies,
graphics, layout managers, event handling etc. it has a dirty API that
brings along a zillion names, adapters, patterns etc. Enough material to
warrant a course on its own (if you still think it is worth the trouble).

Given that the OP did not want to use a console UI I suggested an
alternative that enables beginners to do more with less upfront
knowledge than Swing or any of its siblings. And yes, you would need a
browser. Since nobody is acquainted to those it was probably a bad idea.


>
> Arne
>


 
Reply With Quote
 
Silvio
Guest
Posts: n/a
 
      12-10-2013
On 12/10/2013 01:07 PM, lipska the kat wrote:
> On 10/12/13 10:56, Silvio wrote:
>
> Way back when, I worked for a training company. My job was to develop
> their Java training offering. One of my courses focused on the early
> J2EE offering with particular focus on EJB. I used an early release of
> Weblogic and built a CD containing everything required to run the labs.
>
> I developed a collection of DOS batch files and Unix shell scripts that
> automated the installation and configuration of the app server and it's
> dependencies. The student would insert the disk, click the relevant
> script file and in less than 2 minutes everything was up and running.
>
> Make no mistake, this was heavy on the OO aspect of software engineering
> with plenty of opportunity to delve into the darker corners of the
> language. It worked a treat and I used and developed it over a period of
> two years. I still have the CD somewhere... wonder if it still works?
>
>


I used to teach assembly (PDP-11 and IBM S/370), C and C++ in about the
same way, except that I had to use floppy disks. Worked great except
that floppy disks where extremely unreliable.
 
Reply With Quote
 
Silvio
Guest
Posts: n/a
 
      12-10-2013
On 12/10/2013 01:56 PM, lipska the kat wrote:
> On 10/12/13 12:39, Silvio wrote:
>> On 12/10/2013 01:07 PM, lipska the kat wrote:
>>> On 10/12/13 10:56, Silvio wrote:

>
>> I used to teach assembly (PDP-11 and IBM S/370), C and C++ in about the
>> same way, except that I had to use floppy disks. Worked great except
>> that floppy disks where extremely unreliable.

>
> Heh heh, my first Slackware came on 23 floppy disks downloaded over the
> university network and installed on an old 386 with a monochrome monitor
> ... jeez, floppy disks, how long ago does that seem now?
>


Especially considering that my current Internet download speed is around
50 of those per second...

When I started my company almost 20 years ago I used to have my wife
bring floppy disks with software updates to my first clients. I once
sent her out with three copies and she had to make the trip twice
because all three failed.
 
Reply With Quote
 
Arved Sandstrom
Guest
Posts: n/a
 
      12-10-2013
On 12/09/2013 09:11 PM, Arne Vajhj wrote:
> On 12/9/2013 11:02 AM, Arved Sandstrom wrote:
>> On 12/09/2013 09:34 AM, Stefan Ram wrote:
>>> Silvio <(E-Mail Removed)> writes:
>>>> Why not have them write a simple Servlet or two?
>>>
>>> The time for teaching is very limited: I now often have only
>>> 30 hours to take students from no programming experience
>>> whatsoever to first steps with Swing including exercises
>>> done in the classroom. When teaching Java with Swing, I need
>>> the JDK as the one single dependency: javac Main.java, java
>>> Main, and that's it.
>>>
>>> I have the impression that teaching servlets is more
>>> time-consuming, because the toolchain is longer and the
>>> configuration and application of more tools needs to be done
>>> and explained.
>>>

>> I don't see it myself, that teaching servlets would be more
>> time-consuming than teaching Swing (or JavaFX for that matter). In fact,
>> I think that teaching servlets affords an excellent opportunity to
>> introduce students to important real-world stuff:
>>
>> 1) using libraries;
>>
>> 2) the ubiquity and importance of app servers;
>>
>> 3) HTTP request-response handling;
>>
>> 4) how servlets underlie many Java frameworks, with a brief intro to how
>> the frameworks build upon the servlet API.
>>
>> Can this be done in 30 hours, especially for programming neophytes?
>> Maybe not.

>
> Almost certainly now.
>
> It is very useful topics - more useful than Swing, but I can not
> see them as step one.
>
> There are too much stuff to learn to get anywhere.
>
> I provide some help at a danish web forum for IT problems. And
> there are one university where they have a programming course
> in first semester. They decided on Java - which I think is a
> fine choice. But they want them to learn Java by doing JSF web apps,
> RESTful web services etc.. The result is not pretty. The students
> that should learn about data structures, control structures, OOP
> etc. are looking at things generated by Eclipse wizards and they have
> no idea about what all that stuff is doing.


I'd agree without qualification that introducing JSF or REST in a first
programming course, that uses Java, is too ambitious.

>> But I'm not convinced you can accomplish more by doing "first
>> steps with Swing". The issue here may be that 30 hours isn't
>> enough...

>
> If kept simple with JLabel, JTextField, JButton etc. I think they
> can make something work *and* understand what they are doing.


I'm not being combative here, but in the big scheme of things, that
knowledge will help the students how exactly? Apart from the top
students, who will probably get on with any approach to OOP, everyone
else - at best - will understand how to write simple Swing apps: some
will eventually (after further study) grasp the larger principles, but
many will not.

>> but I myself have a gut feeling that you'd do better with a
>> servlet approach.

>
> I am not sold on that.


For what it's worth, I'm not sold on it either. To phrase things
differently, *if* you had enough time to do a decent intro to core Java
+ enough time to introduce either Swing or servlets, I'd prefer
servlets. I just don't think 30 hours is enough to do either.

>> For a barebones first approach, I think we can over-emphasize the
>> importance of GUIs (web or desktop) as being what beginners expect to
>> see, or what they feel comfortable with. I'm probably dating myself
>> here, but back in the '70's when I learned programming with FORTRAN 66
>> and FORTRAN 77, I (and most of my peers) grokked program output to
>> printer or tape, and program input from similar sources. It's also not
>> difficult to relate a console input prompt to an HTML text input box -
>> students understand that what matters is what you do with the input, not
>> so much how you got it.
>>
>> Let me put something else out there. 30 hours is a short semester if we
>> suppose three 1-hour classes per week. Is it even realistic to try and
>> introduce any kind of GUI (Swing, JavaFX, servlets with simple HTML etc)
>> in 30 hours? Perhaps console output is all you should shoot for.

>
> Console apps would certainly be better in the sense that there are even
> less context to learn.
>
> The problem here is probably more in the area of motivation. A console
> app does not look fancy and that could be demotivating.
>
> Arne
>


I think this is where the teacher needs to step up and be on their game.
If I were teaching a genuine intro class where practically everyone was
a novice [1], and let's assume it was 30 hours over a semester, and the
working language was Java, I think I'd spend the first 2 or 3 hours
providing context, without diving into code. Pseudocode maybe, on a
chalkboard or whiteboard, but no actual code for the first few sessions.

Part of what you'd cover is a basic discussion of I/O - how do you talk
to a program. Properly done, I think most students would get that I/O
to/from a console, or to/from a file, is just as much first class as I/O
through a GUI. And I think many would then understand that the true
program lies behind the interface.

AHS

1. Keeping in mind what markspace said, that the further away any of us
are from our own first introduction to programming, the less equipped we
probably are to remember what caused us problems.
--
When a true genius appears, you can know him by this sign:
that all the dunces are in a confederacy against him.
-- Jonathan Swift
 
Reply With Quote
 
Stefan Ram
Guest
Posts: n/a
 
      12-10-2013
Arved Sandstrom <(E-Mail Removed)> writes:
> I think most students would get that I/O
>to/from a console, or to/from a file, is just as much first class as I/O
>through a GUI.


I am teaching using a Windows console in Germany.

java.lang.System.out.println( "mig" )

will print something like

mnig

with the default settings in place, while

new javax.swing.JTextField( "mig" )

will show the correct word.

Moreover, today, applications often read user input via a GUI
but only very rarely from a console. (I do not deem command-line
arguments to be reading from a console here).

After many modifications to my syllabus, I now /can/ arrive
at the first Swing programs within 30 hours. I posted the OP
here just to get to know whether this still makes sense.

 
Reply With Quote
 
Jeff Higgins
Guest
Posts: n/a
 
      12-10-2013
On 12/10/2013 10:07 AM, Stefan Ram wrote:
> After many modifications to my syllabus, I now /can/ arrive
> at the first Swing programs within 30 hours. I posted the OP
> here just to get to know whether this still makes sense.


Yes.

Google translate gives me:

mig-adjective
idle
pointless
futile
otiose
of leisure

mig-adverb
idly


 
Reply With Quote
 
Arved Sandstrom
Guest
Posts: n/a
 
      12-10-2013
On 12/10/2013 11:07 AM, Stefan Ram wrote:
> Arved Sandstrom <(E-Mail Removed)> writes:
>> I think most students would get that I/O
>> to/from a console, or to/from a file, is just as much first class as I/O
>> through a GUI.

>
> I am teaching using a Windows console in Germany.
>
> java.lang.System.out.println( "mig" )
>
> will print something like
>
> mnig
>
> with the default settings in place, while
>
> new javax.swing.JTextField( "mig" )
>
> will show the correct word.
>
> Moreover, today, applications often read user input via a GUI
> but only very rarely from a console. (I do not deem command-line
> arguments to be reading from a console here).


I agree that console input for general app users is now uncommon. I also
agree that CLI args (CLI invocation for that matter) is not reading from
a console.

I'd say this though, are you trying to teach users of applications, or
writers of applications? If someone who intends to be a software
developer can't get console input, they are toast. For that matter, I've
worked with corporate and government _user_ teams in just the last few
years that were still quite comfortable with green-screen type console
input apps, and with quite a few user teams that loathed - and were
adversely impacted by - badly designed GUIs (whether smartphone, desktop
or web app).

So I wouldn't focus too much on the methodology of input.

> After many modifications to my syllabus, I now /can/ arrive
> at the first Swing programs within 30 hours. I posted the OP
> here just to get to know whether this still makes sense.
>

Let me ask this, Stefan. You "arrive" at the first Swing programs within
30 hours. Leaving aside the 5-10 percent of natural programmers, and the
bottom 25 percent that maybe shouldn't have been there, are you content
that the middle group is benefiting from a cursory exposure to Swing?

AHS

--
When a true genius appears, you can know him by this sign:
that all the dunces are in a confederacy against him.
-- Jonathan Swift
 
Reply With Quote
 
Robert Klemme
Guest
Posts: n/a
 
      12-10-2013
On 09.12.2013 16:06, Arved Sandstrom wrote:
> On 12/08/2013 01:30 PM, Leif Roar Moldskred wrote:


>> Depends on what the class is meant to teach. If the point is
>> to teach GUI or event-driven programming and the students
>> already have experience with Java from earlier courses, fair
>> enough. If the point is to teach general programming or the
>> Java programming language, I think time and effort could
>> be invested a lot more wisely than teaching Swing.


> I'll add this: we're talking about teaching _programmers_, not users of
> an application. Hence the comments about wanting to present a GUI rather
> than a text console are not really relevant. A working software
> developer is going to be looking at text console output and log files a
> lot, and maybe debugger displays...regardless of what the user interface
> is. So that's what you accustom your students to.


But then again there is the motivational effect: seeing something
visually in a graphical UI can be much more rewarding than some
characters on a console - at least for some. On that grounds I would
not totally dismiss teaching Swing - even if event based programming or
user interfaces is not the primary goal of the lesson. Some care should
be applied to not focus too much on the Swing side then, e.g. by
providing some framework or application where learners fill in certain
parts.

Kind regards

robert
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
oh perlbal you!!! you got what i need....but you dotn work with 5 16 johannes falcone Perl Misc 6 05-16-2013 08:11 PM
xmp, what to use instead of. myphplists@yahoo.com HTML 9 04-29-2013 03:35 PM
What is the reason for defining classes within classes in Python? vasudevram Python 6 04-24-2013 01:29 PM
what is the advantage of using maven for java standalone app mcheung63@gmail.com Java 13 04-16-2013 01:42 AM
What Linux freeware will blur faces & show all frames of a 30second AVI video? Danny D. Digital Photography 8 04-14-2013 10:18 PM



Advertisments