A
Arne Vajhøj
John said:1962, actually. Logical operators first appeared in FORTRAN IV.
This is before I was born, but I find it difficult to see how
they could use Fortran for much without .eq., .ne. etc..
Arne
John said:1962, actually. Logical operators first appeared in FORTRAN IV.
Stefan said:Another possibility would be an IDE that can display certain
Java prefix expression as an infix expression in an edit box.
It knows about BigDecimal and can learn about the operators
and precedence rules for other classes from annotations.
This has been done before: Some word processors have an
internal language for mathematical terms and contain WYSIWYG
formula editors for them.
Arne said:This is before I was born, but I find it difficult to see how
they could use Fortran for much without .eq., .ne. etc..
Arne
Mark Space said:I'm thinking "lazy people." People who think that typing is a lot of
work and anything at all that can be done to cut down on programmer
typing (as opposed to the maintainer's effort) is a good thing. Or at
least it's kewl.
Patricia Shanahan said:http://en.wikipedia.org/wiki/Arithmetic_progression#Sum_.28arithmetic_series.29
Infix arithmetic operator version: (n * (2*a1 + (n-1)*d))/2.
^ ^
This might break down if the methods mutate n; not if if they create new
objects for the results.
1962, actually. Logical operators first appeared in FORTRAN IV.
I'm thinking "lazy people." People who think that typing is a lot of work
and anything at all that can be done to cut down on programmer typing (as
opposed to the maintainer's effort) is a good thing. Or at least it's kewl.
So any class that has an "add" method will get overloaded versions of + just
in the name of kewl.
List myList = new List();
myList + "List Item 1";
instead of
myList.add( "List Item 1" );
Then they'll overload - for remove() because if one is kewl then two are even
kewler. And they'll overload ^ for contains() and % for toArray() and
that'll be sooperkewl. And then someone will overload << for toString()
because some *other* language they saw on the *internet* has it and then
it'll all have gone to s--t.
And I mean individual programmers will sub-class existing (API) classes, and
writing their own classes. I'm sure Sun would never stoop to this. But
there's a lot of really, really lazy programmers out there, and I don't mean
that in a good "laziness is a virtue" way.
Some one else on this thread said that the Java community was composed
of traumatized C++ programmers. And say that's a good thing. I like to
learn from my mistakes, not repeat them.
Stefan said:The transcription of such term sometimes matters:
»July 28, 1962 -- Mariner I space probe. A bug in the
flight software for the Mariner 1 causes the rocket to
divert from its intended path on launch. Mission control
destroys the rocket over the Atlantic Ocean. The
investigation into the accident discovers that a formula
written on paper in pencil was improperly transcribed into
computer code« ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
http://www.wired.com/software/coolapps/news/2005/11/69355
Tom said:As i said before, and will keep on saying: THIS HAS NOT HAPPENED IN ANY
LANGUAGE WITH OPERATOR OVERLOADING OTHER THAN C++. Not in python, not in
smalltalk, not in ada (that i've heard), not anywhere. Why do you think
it'll happen in java when it hasn't happened in those languages?
Actually, i could believe that. Java being the big industrial language
that every idiot who doesn't fancy a career in McDonald's or Iraq is
learning, and the others being a bit more niche and sophisticated.
Agreed. So let's learn from our mistakes and use operator overloading
without abusing it. Not having operator overloading is like giving up
cake because you once ate so much you were sick - don't give up cake,
I think "disaster hasn't struck yet" is a poor counter argument.
I suppose the engineer in me wants to make certain that disaster doesn't
strike, with a comfortable margin of error.
I like to design things that can't fail, not things that rely on above
average execution by the user.
Bingo. Java is far more popular than Smalltalk, Python, etc. Masses = lower
average IQ, even if it's just from time pressure to get projects done.
I'm actually excited to try things besides operator overloading. Why *just*
repeat the past? Why not invent something better? Think outside the box!
The idea of embedding some form of scriptlet, or linking with .class files
that were generated by a specialized parser, strikes me as potentially much
more powerful than operator overloading.
....
Just stuffing Java with every misfeature from past languages does not
have me excited. I'd like to try a new misfeature. At least it won't be
the same old boring misfeature we had be for, it'll be an interesting
new one.![]()
....Mark said:I think "disaster hasn't struck yet" is a poor counter argument. I
suppose the engineer in me wants to make certain that disaster doesn't
strike, with a comfortable margin of error.
Wikipedia cites a suggestion from Conrad Wilson that the actual comment was
"an extraordinary number of notes".
Mark Space said:I think "disaster hasn't struck yet" is a poor counter argument. I
suppose the engineer in me wants to make certain that disaster doesn't
strike, with a comfortable margin of error.
I like to design things that can't fail, not things that rely
on above average execution by the user.
I'm actually excited to try things besides operator overloading.
Why *just* repeat the past?
Why not invent something better? Think outside
the box! The idea of embedding some form of scriptlet, or linking with
.class files that were generated by a specialized parser, strikes me as
potentially much more powerful than operator overloading.
Just stuffing Java with every misfeature from past languages does not
have me excited. I'd like to try a new misfeature. At least it won't be
the same old boring misfeature we had be for, it'll be an interesting
new one.![]()
Tom Anderson said:I see. Do tell me about the preparations you've made in case the sun
doesn't come up tomorrow morning, won't you?
Lew said:Also true for having just fewer characters than are needed. The dicey
part is knowing what is "needed".
I've seen code where the use of cryptic, extremely short variable names
hurt readability. I bet you have to (plural "you"). That shows that it
is possible to have too few characters in a source line to help
maintainers.
Arved said:A classic case of short variable names is "Numerical Recipes in C" (or
FORTRAN for that matter). I have a copy, and consider it valuable, but the
code sucks pretty bad...what's valuable is the discussion. While the choice
to use short variable names in this book was clearly driven by printing
space requirements it hurts the readability badly. I understand the code in
"Numerical Recipes in C++" is even worse. It's so bad that it's quite
difficult to type out a code snippet from these books without making
multiple errors (i.e. valid variables, just not the right ones).
Among the few super-short variable names that make sense to me are i, j, k
for loop indices and m, n for dimensions. Contextually these are easy to
understand and help readability (I also frequently use nr and nc instead of
m and n).
For pretty much anything else I ensure that variable names are descriptive.
I also find that I finetune variable name lengths according to their
placement in code and what they are...are they object references, do they
show up as arguments a lot, are they part of array index computations (*),
etc.
Mark Thornton said:There are plenty of cases on mathematics where the traditional
identifier is very short --- usually a single Greek letter. In languages
that permit such identifiers there is little to be gained by using
epsilon instead of ϵ.
Lew said:Mark Space said:I like to design things that can't fail, not things that rely
First of all, I admit, that I missed the "above" in the quote.
With that word, Mark's comment makes more sense, than what I
read it as.
I am incredulous that anyone could even think to assert that "uch a design
is usually in itself a failure". How could anyone think that to design
against failure is "itself a failure"? That's nonsense.
I read it (wrongly) that he didn't even trust an average user. Also,
things that can't fail must be so simple that they're not really
interesting...
In this group, one should probably say explicitly, that "sun" refers
to that shiny yellow ball in the sky usually visible on non-cloudy
days, and not just the nickname of some company somehow related to
Java language.
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.