Some Noob Questions


K

Kyle T. Jones

Any examples of well-known apps written in Java (such as Vuze, for one)?
Particularly anything that involves networking and/or security. For
instance, IIRC, the mozilla projects are written in C++ - although the
addons (again, IIRC) are generally done in Java. Why?

I'm glancing around, trying to decide which language would be best to
pick up for several purposes -
Need to occasionally put together a web-app for the organization I work
for - so far have been cobbling things together using Javascript and
PHP. Security is an issue - would like to write secure code, of course
- would J2EE be suitable for these sort of apps? Basically, I
occasionally have to put together some kind of database-driven dynamic
page that's truly fairly simple/straightforward (use MySQL for database)
- the emphasis here is placed on function rather than aesthetics.

Need to do some System Administration work that requires occasional
scripting - I know Java isn't a scripting language, but would it work
for throwing together occasional apps to make changes to clients, or
check various features of their systems (whether new processes are
running, changing host files, checking size of a few directories, stuff
like that). I've been looking at python a bit for this, (and Django as
a possible framework for the pages I mentioned above) - but have some
reservations. Any compare/contrast comments would be greatly appreciated.

Eventually would be interested in writing basic firewall apps and a few
other things along those lines - related to network security.

What I want, basically, is the best language for writing networking
apps, with an eye toward security. Hope this is all making sense.

Thanks for any suggestions. Noob flaming, as always, rolls off my back
- have at it, haha. I have some programming experience, and a good
amount of network administration experience (although, if I told y'all
how I ass-backed into this job, you'd probably laugh your collective
asses off), but want to get more deeply into the security side of things
- like to learn new things, and have a lot of extra time on my hands for
reading, working through examples, etc - had a CS minor as an undergrad,
but kinda got away from the whole thing in grad school, and only
programming classes were in C/C++ and Cobol (lol). I'm looking at this
over a "years" time line - really want to choose one language and learn
it well, but want to make sure I've picked one that's suitable for what
I'd like to do, long-term. Hope that makes sense. TIA!

Cheers.
 
Ad

Advertisements

M

Mark Space

Kyle said:
Any examples of well-known apps written in Java (such as Vuze, for one)?
Particularly anything that involves networking and/or security. For

I think Tomcat is written in Java. I'm not 100% sure however.

instance, IIRC, the mozilla projects are written in C++ - although the
addons (again, IIRC) are generally done in Java. Why?

Add-ons for Mozilla are written in Java? Uh, don't think so. Not even
one, in fact.

and PHP. Security is an issue - would like to write secure code, of
course - would J2EE be suitable for these sort of apps? Basically, I

I think JEE would be a vast improvement over PHP for security. Some of
the past versions of PHP have "features" and bugs that scare the crud
out of me. Also the development team for PHP seems to lack a real
security minded attitude. But I don't have any hard data to back those
impressions up.

check various features of their systems (whether new processes are
running, changing host files, checking size of a few directories, stuff

I don't think Java has any access at all to running processes. You
could always execute other utilities from Java and sniff their output, I
guess.

Eventually would be interested in writing basic firewall apps and a few
other things along those lines - related to network security.

Er, this sounds like a fantastically bad idea. Get a working firewall
app. Don't re-invent the wheel.

What I want, basically, is the best language for writing networking
apps, with an eye toward security. Hope this is all making sense.

I don't think there's just one. You'll need to learn at least two or
three, minimum.

- have at it, haha. I have some programming experience, and a good
amount of network administration experience (although, if I told y'all

This here might be the problem. There's a big difference between
administrating a system and designing software. Both in the mind-set
and in the skill set as well. I wish you luck, but I think you have
some hard knocks on the road ahead.

Short answer: Java good, but does not do everything. You'll need more
tools in your toolbox than just Java.
 
J

Joshua Cranmer

Kyle said:
Any examples of well-known apps written in Java (such as Vuze, for one)?

The Sun JDK has a lot of components written in Java. Strictly speaking,
the java executable is merely a wrapper around the jvm library; all of
the other tools like javac are written in Java. Many tools that process
Java code are also written in Java.
Particularly anything that involves networking and/or security. For
instance, IIRC, the mozilla projects are written in C++ - although the
addons (again, IIRC) are generally done in Java. Why?

The source code for NSPR and NSS is in C; Gecko and SpiderMonkey are all
in C++. There's some Objective-C++ floating around. Toolkit code is a
mixture of JavaScript and XBL, as is the browser shell.

Extensions are for the most part in JavaScript, not Java. The difference
between the two are like the difference between Python and C. /me
prepares a shotguns for the unnamed Netscape execs who insisted on the
name JavaScript.
 
T

Tom Anderson

Any examples of well-known apps written in Java (such as Vuze, for one)?
Particularly anything that involves networking and/or security.
http://www.hsbc.com/
http://www.santander.com/
http://www.bankofamerica.com/

For instance, IIRC, the mozilla projects are written in C++ - although
the addons (again, IIRC) are generally done in Java. Why?

Oh, you mean *desktop* apps? No, not so many.
Need to occasionally put together a web-app for the organization I
work for - so far have been cobbling things together using Javascript
and PHP. Security is an issue - would like to write secure code, of
course - would J2EE be suitable for these sort of apps? Basically, I
occasionally have to put together some kind of database-driven dynamic
page that's truly fairly simple/straightforward (use MySQL for database)
- the emphasis here is placed on function rather than aesthetics.

Java would do. Python would probably do better.
Need to do some System Administration work that requires occasional
scripting - I know Java isn't a scripting language, but would it work
for throwing together occasional apps to make changes to clients, or
check various features of their systems (whether new processes are
running, changing host files, checking size of a few directories, stuff
like that). I've been looking at python a bit for this, (and Django as
a possible framework for the pages I mentioned above) - but have some
reservations. Any compare/contrast comments would be greatly
appreciated.

Python is the way to go here. Don't tell anyone on cljp i said this, but
it's basically miles better than java.
Eventually would be interested in writing basic firewall apps and a few
other things along those lines - related to network security.

What I want, basically, is the best language for writing networking
apps, with an eye toward security. Hope this is all making sense.

Firewalls and 'networking apps' are completely different to websites and
systems administration. What do you actually want to do?
I'm looking at this over a "years" time line - really want to choose one
language and learn it well, but want to make sure I've picked one that's
suitable for what I'd like to do, long-term.

The standard advice is to learn several languages, for a wider view. But
sensible advice is to make python one of them.

tom
 
A

Arne Vajhøj

Kyle said:
Any examples of well-known apps written in Java (such as Vuze, for one)?
Particularly anything that involves networking and/or security.

There are plenty of web sites build on Java like Ebay, LinkedIn etc..

If you are looking for desktop apps then there are a few like:
* the database part of OpenOffice
* Azureus BitTorrent client.
For
instance, IIRC, the mozilla projects are written in C++ - although the
addons (again, IIRC) are generally done in Java. Why?

Addons are *not* always done in Java.

Reasons for C/C++ include:
* programmer preference.
* want to avoid dependency on Java being present.
I'm glancing around, trying to decide which language would be best to
pick up for several purposes -
Need to occasionally put together a web-app for the organization I
work for - so far have been cobbling things together using Javascript
and PHP. Security is an issue - would like to write secure code, of
course - would J2EE be suitable for these sort of apps? Basically, I
occasionally have to put together some kind of database-driven dynamic
page that's truly fairly simple/straightforward (use MySQL for database)
- the emphasis here is placed on function rather than aesthetics.

Java EE can certainly do it.

For a small simple app then Java EE is most likely not the most
cost effective (developer time wise) technology.
Need to do some System Administration work that requires occasional
scripting - I know Java isn't a scripting language, but would it work
for throwing together occasional apps to make changes to clients, or
check various features of their systems (whether new processes are
running, changing host files, checking size of a few directories, stuff
like that). I've been looking at python a bit for this,

I would suggest a real script language: Python, Perl, VBScript or
whatever you prefer and is supported on your platforms.
Eventually would be interested in writing basic firewall apps and a few
other things along those lines - related to network security.

What I want, basically, is the best language for writing networking
apps, with an eye toward security. Hope this is all making sense.

Java could definitely be used for this.

Arne
 
Ad

Advertisements

S

Stefan Ram

Kyle T. Jones said:
Need to do some System Administration work that requires occasional
scripting - I know Java isn't a scripting language, but would it work

You can use Java for »meta-scripting«.

Assume, for example, that you want to download:

http://www.example.invalid/page000.html
http://www.example.invalid/page001.html
....
http://www.example.invalid/page621.html

to »C:\directory« under Windows, but in this very moment you
cannot remember the wget option for this nor the syntax of the
FOR-loop command of the shell or use a version of Windows
without an appropriate shell FOR loop. Running the following
might sometimes do the job without any additional user action.
It runs up to 999, assuming that we do not yet know that the
last page number is 621. The poor man's shell loop:

public class Main
{ public static void main( final java.lang.String[] args )
throws java.lang.Throwable
{ final java.io.File outFile = new java.io.File( "generated.bat" );
final java.io.PrintWriter out =
new java.io.PrintWriter( new java.io.FileOutputStream( outFile ), true );
out.println( "C:" );
out.println( "cd \"\\directory\\\"" );
for( int i = 0; i < 999; ++i )out.println
( "wget http://www.example.invalid/" +
java.lang.String.format( "%03d", i )+ ".html" );
out.close();
if( java.awt.Desktop.isDesktopSupported() )
java.awt.Desktop.getDesktop().open( outFile ); }}

(People who would like to encourage me to keep posting source
code to newsgroups can do so, by not quoting the complete
source code above, but just parts they directly refer to.)
 
R

Roedy Green

Need to do some System Administration work that requires occasional
scripting - I know Java isn't a scripting language, but would it work
for throwing together occasional apps to make changes to clients, or
check various features of their systems (whether new processes are
running, changing host files, checking size of a few directories, stuff
like that). I've been looking at python a bit for this, (and Django as
a possible framework for the pages I mentioned above) - but have some
reservations. Any compare/contrast comments would be greatly appreciated.

See http://mindprod.com/products1.html#BATIK

I put together scripts to clean junk files from a set of standard
methods.

--
Roedy Green Canadian Mind Products
http://mindprod.com

"If people become accustomed to lying, they will unconsciously commit every possible wrong deed. Before they can act wickedly, they must lie, and once they begin to lie they will act wickedly without concern."
~ Gautama Buddha
 
R

Roedy Green

Any examples of well-known apps written in Java (such as Vuze, for one)?

The Java IDEs are written in Java. See
http://mindprod.com/jgloss/ide.html

The Transporter is written in Java. It can be used for transporting
small bundles of information by high security, such as credit card
purchase info.

See http://mindprod.com/jgloss/transporter.html

Open Office is in at least partly in Java.

See http://mindprod.com/jgloss/openoffice.html


--
Roedy Green Canadian Mind Products
http://mindprod.com

"If people become accustomed to lying, they will unconsciously commit every possible wrong deed. Before they can act wickedly, they must lie, and once they begin to lie they will act wickedly without concern."
~ Gautama Buddha
 
R

Roedy Green

Eventually would be interested in writing basic firewall apps and a few
other things along those lines - related to network security.

Java is not that well suited to that sort of work. The low level
OS-specific interfaces are written for C not Java. You need JNI to
access them. See http://mindprod.com/jgloss/jni.html

Further, Java apps, or rather the general purpose class libraries,
tend to be rather fat. You don't really want to have that sitting
around in RAM 24/7. It is not so much of a problem as RAM prices drop
though.
--
Roedy Green Canadian Mind Products
http://mindprod.com

"If people become accustomed to lying, they will unconsciously commit every possible wrong deed. Before they can act wickedly, they must lie, and once they begin to lie they will act wickedly without concern."
~ Gautama Buddha
 
Ad

Advertisements

L

Lew

Stefan said:
public class Main
{ public static void main( final java.lang.String[] args )
throws java.lang.Throwable
{ final java.io.File outFile = new java.io.File( "generated.bat" );
final java.io.PrintWriter out =
new java.io.PrintWriter( new java.io.FileOutputStream( outFile ), true );
...
for( int i = 0; i < 999; ++i )out.println
( "wget http://www.example.invalid/" +
java.lang.String.format( "%03d", i )+ ".html" );
out.close();
if( java.awt.Desktop.isDesktopSupported() )
java.awt.Desktop.getDesktop().open( outFile ); }}

(People who would like to encourage me to keep posting source
code to newsgroups can do so, by not quoting the complete
source code above, but just parts they directly refer to.)

And people would like to encourage you to use intelligible indentation and to
remember your curly braces.
 
M

Mike Amling

Roedy said:
The Java IDEs are written in Java. See
http://mindprod.com/jgloss/ide.html

The Transporter is written in Java. It can be used for transporting
small bundles of information by high security, such as credit card
purchase info.

See http://mindprod.com/jgloss/transporter.html

Not Found

The requested URL /jgloss/transporter.html was not found on this server.
Apache/2.2.6 (Unix) mod_ssl/2.2.6 DAV/2 mod_apreq2-20051231/2.6.0
mod_perl/2.0.3 Perl/v5.8.8 Server at www.mindprod.com Port 80
Open Office is in at least partly in Java.

See http://mindprod.com/jgloss/openoffice.html

--Mike Amling
 
K

Kyle T. Jones

Kyle T. Jones wrote:

<snip>

Hey, thanks for all the great responses. Learned a lot - so, maybe I
should clarify my position a bit:

Really, it's more like this - I got tagged (as "additional duties") to
take care of our organization's intranet (and also areas where our
intranet and our internet-facing website "intersect" so to speak - for
instance, we have several databases that are used on our public website
and are maintained by other staff using our intranet). It isn't
terribly complicated (in fact, pretty standard stuff) - but there are
about five MySQL databases that are in use.

Originally, I just put together new stuff using standard
HTML/CSS/Javascript on the client-side, and using PHP to do all the
server-side stuff - interacting with the databases, mainly.

But, I'm not a huge fan of PHP, to be honest. So, I thought - hey,
we're adding in a new thing, and I'll do the server-side stuff in
Python/Django, to see what that's all about. Well, it's ok - I also
considered Ruby on Rails as an alternative. Then I was going to go back
and redo the older PHP scripts using Python just for practice.

But, what I'd actually like to do is take all these different pages on
our intranet and put together a single page that allows our staff to
access the various databases, do all the stuff they want to do. I'm
familiar with AJAX and XMLHttpRequest/ActiveXObjects, so that part, the
client-side stuff shouldn't be any problem.

What I was thinking was - look, long-term outlook (over years), I'd like
to "graduate" from just doing webapp stuff in this manner to making...
larger?... apps (and also mobile apps) with a language like Java or
C/C++ - and, as I mentioned, I have some experience with C but it's been
years. So, I thought - hey, maybe I should check out J2EE to take over
all the server-side stuff on the redesign, just so I could start getting
some practice with Java - and, really, it's all pretty simple stuff, and
it's more just translating existing scripts than doing anything from
scratch.

So, I thought it might be good practice - and a good introduction to the
language.

But, based on comments, I'm guessing that Java doesn't work well for
this role? Specifically, it's Tom's reply that really hit me - y'all
know what I mean, generally you go to a newsgroup for a specific
language and ask a compare/contrast question, it's all going to be
positive for the language around which that newsgroup is centered - for
him to state specifically that python would be a better alternative
carries a lot of weight.

So, unless someone else wants to chime in with "No, the J2EE
implementation works great for handling all this server-side stuff" I
guess I'll break the Python books back out and go that route.
Certainly, Sun makes it sound like it'd be a great way to do it (using
Java) - they go so far as providing that "Petshop" example of AJAX and
J2EE in action together on their site (under the section on J2EE).

So, thanks again, all! Maybe you'll hear back from me in the future...
and I'll check this thread again to see if anyone came up with a
contrary position to Tom's advice (can you tell this is what I'm really
hoping for? haha.)

Cheers.

PS: The whole thing about building apps in the future, putting together
a basic firewall, etc - I wasn't planning on making a firewall to, you
know, use - just thought it'd be a good way to become more familiar with
what firewalls do, how they do it, etc - to build one myself. Anyhow.
 
L

Lew

Kyle said:
But, based on comments, I'm guessing that Java doesn't work well for
this role?  Specifically, it's Tom's reply that really hit me - y'all

Utter nonsense. Java EE is perfect for server-side stuff.
know what I mean, generally you go to a newsgroup for a specific
language and ask a compare/contrast question, it's all going to be
positive for the language around which that newsgroup is centered - for
him to state specifically that python would be a better alternative
carries a lot of weight.

I don't know why Tom particularly likes Python for server-side work,
but I for one have been using Java for server-side work for almost a
decade now and I find it easy, fast and stable for such use.
So, unless someone else wants to chime in with "No, the J2EE
implementation works great for handling all this server-side stuff" I
Duhh.

guess I'll break the Python books back out and go that route.

I'd go with Java.
Certainly, Sun makes it sound like it'd be a great way to do it (using
Java) - they go so far as providing that "Petshop" example of AJAX and
J2EE in action together on their site (under the section on J2EE).

Java EE servers like Tomcat, Glassfish, JBoss, Geronimo and such (just
to name free ones) work great - they have extensive libraries to tie
in databases, server-side logic, presentation "templating", excellent
separation of concerns, message queues - the list goes on.

Java EE ("J2EE" is an out-of-date acronym) is excellent for this.

I venture to say that certain features of Java will tend to make
applications easier to keep stable and error-free than Python, but of
course expertise in either platform will have the strongest impact
there.

The abundance of Java server platforms, many open source, and
extensive libraries tend to make it a stronger choice. I see a lot
more choices in the Java world, and Java is much more widely used for
this sort of work.

So, thanks again, all!  Maybe you'll hear back from me in the future...
and I'll check this thread again to see if anyone came up with a
contrary position to Tom's advice (can you tell this is what I'm really
hoping for? haha.)

Tom is a lone voice calling a controversial song. Don't let him lead
you astray.

Most people see Python as a particularly strong scripting language,
although it is arguably more than that. Java is a rubric for a range
of platforms, scripting languages and libraries that cooperate to give
you what you want.

Go with Java.
 
Ad

Advertisements

K

Kyle T. Jones

Lew said:
Utter nonsense. Java EE is perfect for server-side stuff.


I don't know why Tom particularly likes Python for server-side work,
but I for one have been using Java for server-side work for almost a
decade now and I find it easy, fast and stable for such use.


I'd go with Java.


Java EE servers like Tomcat, Glassfish, JBoss, Geronimo and such (just
to name free ones) work great - they have extensive libraries to tie
in databases, server-side logic, presentation "templating", excellent
separation of concerns, message queues - the list goes on.

Java EE ("J2EE" is an out-of-date acronym) is excellent for this.

I venture to say that certain features of Java will tend to make
applications easier to keep stable and error-free than Python, but of
course expertise in either platform will have the strongest impact
there.

The abundance of Java server platforms, many open source, and
extensive libraries tend to make it a stronger choice. I see a lot
more choices in the Java world, and Java is much more widely used for
this sort of work.



Tom is a lone voice calling a controversial song. Don't let him lead
you astray.

Most people see Python as a particularly strong scripting language,
although it is arguably more than that. Java is a rubric for a range
of platforms, scripting languages and libraries that cooperate to give
you what you want.

Go with Java.

Music to my ears, Lew! - thanks for clearing up the J2EE/Java EE mistake
I was making - this explains why all my Amazon "J2EE" searches were
turning up older books, eh?

Thanks again (and to everyone else)! I'm quite excited about the whole
thing. I was pretty into all this stuff (programming and networking in
particular) my whole life up through getting my BS - then I went to grad
school and kinda got away from it all for a long time... but there's a
particular aspect of programming (it's the problem solving, I suppose),
that I really love and miss - well, sometimes it's love/hate, but mostly
love - I'm sure y'all know what I mean (and I'm sure none of y'all will
break my balls about referring to the kiddy-stuff I want to do right now
as "programming", haha - y'all seem too nice for that, uh, and maybe for
Usenet in general? Kidding, of course - wow, not one flame in spite of
all the mistakes and general ignorance I displayed - quite a statement
about your newsgroup).

I'm sure you'll be hearing from me again in this newsgroup, but I'll be
much more specific with my questions (and take the time to do searches
so I'm not repeating noob questions that have been answered over and over!).

Danke! Cheers!
 
T

Tom Anderson

Utter nonsense. Java EE is perfect for server-side stuff.

Utter non sequitur. He wasn't asking about server-side stuff in general,
he was specifically asking about building small web apps as a one-man
effort. For that, as someone who makes a living doing server-side java and
has built a few small web-apps as a one-man effort in python, i can
guarantee that python is a better choice. Java is rich in features that
make programming in the large effective - little things like access
control modifiers (python doesn't have 'private'!) and big things like the
J2EE libraries. But it is a bit ungainly for knocking up small things.
Python, on the other hand, is tuned specifically for small things.
I don't know why Tom particularly likes Python for server-side work, but
I for one have been using Java for server-side work for almost a decade
now and I find it easy, fast and stable for such use.

Glad to hear it. How does it compare to python, in your experience?
Tom is a lone voice calling a controversial song. Don't let him lead
you astray.

Most people see Python as a particularly strong scripting language,
although it is arguably more than that.

'Most people'! Well, i'm glad we're evaluating languages based on what a
guy you saw at lunch told you about what he heard around the water cooler.
Go with Java.

But go to comp.lang.python first.

tom
 
A

Arne Vajhøj

Kyle said:
What I was thinking was - look, long-term outlook (over years), I'd like
to "graduate" from just doing webapp stuff in this manner to making...
larger?... apps (and also mobile apps) with a language like Java or
C/C++ - and, as I mentioned, I have some experience with C but it's been
years. So, I thought - hey, maybe I should check out J2EE to take over
all the server-side stuff on the redesign, just so I could start getting
some practice with Java - and, really, it's all pretty simple stuff, and
it's more just translating existing scripts than doing anything from
scratch.

So, I thought it might be good practice - and a good introduction to the
language.

But, based on comments, I'm guessing that Java doesn't work well for
this role? Specifically, it's Tom's reply that really hit me - y'all
know what I mean, generally you go to a newsgroup for a specific
language and ask a compare/contrast question, it's all going to be
positive for the language around which that newsgroup is centered - for
him to state specifically that python would be a better alternative
carries a lot of weight.

So, unless someone else wants to chime in with "No, the J2EE
implementation works great for handling all this server-side stuff" I
guess I'll break the Python books back out and go that route. Certainly,
Sun makes it sound like it'd be a great way to do it (using Java) - they
go so far as providing that "Petshop" example of AJAX and J2EE in action
together on their site (under the section on J2EE).

Java would do very nicely for serious server side computing.

Java may not be the right tool for the "Need to do some System
Administration work that requires occasional scripting" requirements
though.

Python or a similar language may be better for that part.

But it is two rather distinct types of work.

Arne
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top