473,386 Members | 1,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Dive Into Java?

DiveIntoPython.org was the first book I read on python, and I really
got a lot out of it. I need to start learning Java (to maintain a
project I've inherited), and was wondering if anyone knew of any
similar books for Java?

Maybe once I know my way around the language, I can sneak Jython in...
:-)

Thanks!
Erik

Oct 8 '06
51 3648
Bjoern Schliessmann schrieb:
Diez B. Roggisch wrote:
>Yes. You can for example create a constructor for object Foo,
which then is implicitly chosen when assigning an int to a
variable of that kind. So it acts as a casting operator. I call
that wicked, and subtle.

class Foo {
int _arg;
public:
Foo(int arg) {
_arg = arg;
}
};

int main() {
Foo f = 10;
}

Just looks like Java's

String spam = "eggs";
You don't seem to understand what is happening here. The fact that
string literals in java exist has nothing to do with an implicit type
casting as above example shows.

>Who cares for the reason - it is there, isn't it? You are the one
claiming that a new language should get rid of old concepts, btw.

Is C++ new? :) IIRC it's well 10 years older than Java, and that's
quite a lot in IT. Apart from this, Java is constantly evolving
(through Sun), where C++ is quite a standard since <= 1998.
C++ was new, nobody forced them to keep pointers around.
If I'd like to write a class that is interface compatible to Java's
String, so e.g. that I can use it with "+" operator or the
simplified construction (String a = "b";).
That isn't possible with python, too. It _is_ possible with C++, yes, as
my own example above shows, but at the cost of complex semantics.

And the +-operator can be used when you have a toString-method.
I don't offense compiler optimization, but the clunkiness of
those "special rules for String only" additions.
Python has those clunky rules as well as C++ - or don't you write
character literals like

"abcd"

in C++ as well? Where exactly is that clunky?

>The way is not awkward, it is called auto-boxing/unboxing and
works very well.

But it looks weird. Why not use classes for basic types? Is
performance really the reason? It kind of splits the language
style.
For the same reason ints and floats aren't objects _internally_ in C++
as well - optimization. C++ did go a better way here by treating ints as
objects syntactically, but the distinction is most of the times removed
from java as well since 1.5.
And this is more than matched by the subtle differences between
>>
Foo a;
Foo &a;
Foo *a;

I don't think that's too subtle. But, perhaps, just because I'm used
to C++. It has a little bit too many compatibility features.

But I'd rather like to have several options than being forced in one
way.
But choices let you make more errors - which was my point from the
beginning: java is a limited language, and I don't like it too much. But
it makes it hard to do things wrong. C++ makes it hard to make them right.

Diez
Oct 11 '06 #51
Diez B. Roggisch wrote:
You don't seem to understand what is happening here. The fact that
string literals in java exist has nothing to do with an implicit
type casting as above example shows.
Whoops. "10", arg and _arg /are/ integers, right?
C++ was new, nobody forced them to keep pointers around.
For compatibility reasons to C it seems quite necessary.

[interface compatibility to String]
That isn't possible with python, too.
No? Mh, perhaps it's too late for my brain tonight ;)
Python has those clunky rules as well as C++ - or don't you write
character literals like

"abcd"

in C++ as well? Where exactly is that clunky?
IMHO, that only for String class

String spam = "eggs";

works (in Java).
But choices let you make more errors - which was my point from the
beginning: java is a limited language, and I don't like it too
much. But it makes it hard to do things wrong. C++ makes it hard
to make them right.
I agree. *If* one is an absolute beginner with programming. C++ may
have too many weird options in places where Java has one possible
solution.

Regards,
Björn

--
BOFH excuse #364:

Sand fleas eating the Internet cables

Oct 11 '06 #52

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Luis P. Mendes | last post by:
Hi, do you know if is there any 'Dive into Python' equivalent for the java language? DiP is the best I've seen and I would need to learn some basics of Java and also ways to interact between...
6
by: Franz Mueller | last post by:
Hi, which of the following books would you recommend: "Dive into Python" or "Beginning Python: From Novice to Professional"? I'm an experienced C++-programmer who wants to take a look at...
2
by: Franz Mueller | last post by:
Hi there, is there a nicer looking version of the "Dive into Python" PDF? The one from diveintopython.org looks horrible, much worse than the web-version; also the images aren't where they...
5
by: Casey Hawthorne | last post by:
Since there was talk of if-then-else not being allowed in lambda expressions, the following is from "Dive into Python" The and-or conditional expression trick from page 41 of "Dive into Python"...
3
by: hanumizzle | last post by:
I find Dive Into Python generally an excellent text, and I am not surprised to see people recommending it...but I have noticed a few errors already: ...
0
by: Ben Edwards (lists) | last post by:
Have been working through Dive Into Python which is excellent. My only problem is that there are not exercises. I find exercises are a great way of helping stuff sink in and verifying my...
1
by: Ben Edwards (lists) | last post by:
I have been going through Dive into Python which up to now has been excellent. I am now working through Chapter 9, XML Processing. I am 9 pages in (p182) in the 'Parsing XML section. The...
0
by: Ben Edwards | last post by:
Am going through Chapter 9 - HTTP Web Services in dive into Python. It uses the following: data = urllib.urlopen('http://diveintomark.org/xml/atom.xml').read() The page no longer exists, can...
3
by: webandwe | last post by:
Hi, Does anyone know where I can get a free scuba dive log book module, I want user to be able login and then the module must display all of their dive. Otherwise how/what do I need to do to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.