Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #1722

=?UTF-8?B?UmU6IFN5c3RlbS5

From "RedGrittyBrick" <redgrittybrick@THRWHITE.remove-dii-this>
Subject =?UTF-8?B?UmU6IFN5c3RlbS5
Message-ID <VoednZ3Vc5kOoMbbnZ2dnUVZ8qWhnZ2d@bt.com> (permalink)
Newsgroups comp.lang.java.gui
References <8qGdnT31bq50lsfbnZ2dnUVZ_sWdnZ2d@comcast.com>
Date 2011-04-27 15:34 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
Lew wrote:
> RedGrittyBrick wrote:
>> - System.out.println() works
>>   - it needs no special classes/jars bundled with your app.
> 
> Specious.
> 

>>   - it needs no class instantiation/initialisation
> 
> Neither does log4j unless you need the flexibility.

All the examples I've seen seem to involve something like
`static Logger logger = Logger.getLogger(test.class);`

> 
>> - Logging classes seem like they're oriented to making complex
>>   logging needs possible. Few of them make simple jobs simple.
> 
> I have no idea how you came up with this.  Logging libraries are 
> dog-simple to use, about as complex as:
> 
> Logger logger = Logger.getLogger( getClass() );
> ...
> logger.error( msg );

Can you just invoke methods statically like
    Logger.error(msg);


>> - There's too many to choose from. Writing System.out.println()
>>   a few dozen times takes a lot less gumption than studying a
>>   half dozen logging classes and choosing one then using it.
> 
> I cannot believe you are touting ignorance as an excuse. 

I didn't think I was :-)

Actually its a problem I've encountered more than once with Java. A 
recent example: I have a web-service written in Perl and wanted to test 
access to the service from Perl, C# and Java. I'd a little experience of 
Perl and Java but none of C#.

With Perl, THE way to do web services is to use SOAP::Lite. No need to 
research lots of options. A SOAP::Lite test client can be written in 
under a dozen lines of code.

With C#, I'd not written a line of C# before, but I downloaded Mono, 
read http://www.mono-project.com/Web_Services, wrote a dozen lines of C# 
and typed four commands and had a working client within an hour. I 
didn't have to research several toolkits and choose one.

With Java I've spent hours Googling and reading reviews and tutorials 
for what seemed like dozens of web-services toolkits. Most of it seemed 
ten times as much work as Perl or C#. It was hard to work out what was 
obsolete stuff and what was 'standard' for Java 6. I downloaded the 
latest Eclipse Web-Tools Platform and tried to generate a stub class 
from the WSDL but had problems. In the end I used the rather nasty 
approach suggested in 
http://www.ibm.com/developerworks/xml/library/x-soapcl/ which I 
supplemented with a SAX parser, simply in order to avoid spending too 
much time learning something which was somewhat peripheral to the project.

> Pathetic.

Cruel bastard ;-)


> Logging takes all of five minutes to learn.  

I spent hours trying to find out what logging classes were available, 
which were widely used and whether any were a standard part of JRE 1.5.


> You should actually learn to use, say, log4j, before you pass judgment.  
> By admitting that you haven't learned either that nor java.util.logging, 
> you admit that you do not have a basis for your judgment.
> 
> Try it, you'll like it.
> 

I will try it, but I suspect I'll probably still use 
System.out.println() in small programs (one or two classes, < 200 LOC).




Appendix A:

Complete Perl web-services client

   #!perl
   use strict;
   use warnings;
   use SOAP::Lite;
   print SOAP::Lite
     ->proxy('http://example.com/service')
     ->uri('Widgets')
     ->getWidgetDescription('Foo');


Complete C# web-services client (excluding stub generated from WSDL)

   using System;
   class GetWidgetDescription {
       public static void Main(string [] args) {
           WidgetService service = new WidgetService();
           Console.WriteLine(service.getWidgetDescription("Foo"));
       }
   }

My real service returned arrays of objects but that didn't add 
significantly to the time taken to produce working Perl or C# clients 
with which to test the service.

Doubtless a Java client *can* be just as concise and easy to learn but 
the above were almost straight from the first tutorials I found. I've 
not found a simple Java tutorial that only uses classes that are part of 
the standard JRE.

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

=?iso-8859-1?q?JComboBox= "Piet71" <piet71@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000
  =?iso-8859-1?q?Re:_JCombo "Piet71" <piet71@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000
  Re: JComboBox.setSelected "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000
    =?iso-8859-1?q?Re:_JCombo "Piet71" <piet71@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000
      Re: JComboBox.setSelected "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000
        =?UTF-8?B?U3lzdGVtLm91dC5 "RedGrittyBrick" <redgrittybrick@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000
          =?UTF-8?B?UmU6IFN5c3RlbS5 "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000
            =?UTF-8?B?UmU6IFN5c3RlbS5 "RedGrittyBrick" <redgrittybrick@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000
              =?UTF-8?B?UmU6IFN5c3RlbS5 "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000
  =?utf-8?B?UmU6IEpDb21ib0J "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000
    =?iso-8859-1?q?Re:_JCombo "Piet71" <piet71@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000

csiph-web