-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

André,

On 3/13/2009 1:25 PM, André Warnier wrote:
> But for instance the following kind of snippet, while undoubtedly
> looking simple and elegant to any confirmed Java servlet programmer, in
> the eyes of this beholder is not any better :
> 
>   this.writer = new PrintWriter( new OutputStreamWriter( new
> CapturedServletOutputStream( new ByteArrayOutputStream())));

Hey, that looks familiar!

> Admittedly, it doesn't contain and cryptic sign, but it merely displaces
> the problem : the Java part of it is minimal and easy; but for someone
> like me, it means going to dig into at least 25 pages of Javadocs to
> figure out what these things do, what kind of parameters they take, and
> how they relate to each other. And I omitted the try/catch block around
> it to save space.

Sure. Java developers will recognize this as simply decorating an output
stream. Familiarity with the Java API certainly helps.

> In the eyes of the beholder, thus..
> Basically, being a Java programmer is not a matter of learning the Java
> language; that part is easy.

Well, syntax is easy. There are some nuances that often trip people up:
synchronization, threading, and heap usage.

> But it's a matter of knowing your classes,
> and that to me takes an incredible amount of time before you can start
> being productive. I have the impression that one can only become really
> proficient in one particular area of the class hierarchy, so long is the
> ramp-up period.  That's a serious comment by the way, and I am curious
> to know if a proficient Java programmer feels that way too.

I agree. The same can be said of Perl, though. If I were to say, "I'd
love to use Perl, but it doesn't come with an easy way to make outgoing
HTTP connections!" you would respond by saying "oh, just use
HTTP:Client". Of course, I've never heard of HTTP:Client before (and
installing it via CPAN is not exactly the easiest process to understand)
and so I would come to the same conclusion you did (knowing what's
available is /hard/!).

> I'm working in a very small company, doing a lot of different things to
> satisfy a wide range of customers.  So I tend to flit from one area to
> the other, without really ever having the chance (not admittedly the
> desire) to become really an expert at any of them.  That's why perl
> suits me fine, because it covers a lot of areas without requiring years
> of study.

If you have the Perl background, then yes. I suspect if I had to do some
of those things, I might turn to Java based upon my familiarity.

>> Yeah... nobody ever got into trouble writing a Java webapp :)
>
> I must admit there's truth to that.  Despite my abysmal Java and Tomcat
> knowledge, I haven't managed to really take down a Tomcat yet.

Wow, you haven't been trying very hard, then :)

> Except
> with system.exit(), but that's cheating (and can be prevented, as
> pointed out earlier) (ok, you can probably manage to trigger the OOM
> gnome).  With mod_perl, it's easier to take down an Apache child or the
> whole thing.

Try creating lots of new threads, or recurse infinitely or something
like that. The former will exhaust your thread limit (and you'll get an
OOME and most likely toast Tomcat) and the latter will toast the running
thread (but it will recover, or at least be recycled/replaced in the
request handling thread pool).

If you're really adventurous, you can create a JNI library and really do
some damage.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkm6xsYACgkQ9CaO5/Lv0PDdZQCfYcP+JqZlThB3+6RHgCGx+U39
eR4Anj3flbEU2GaWIOF5YEzcdUW1Tyjv
=Fhwz
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to