Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #28288 > unrolled thread
| Started by | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| First post | 2014-04-27 17:18 -0700 |
| Last post | 2014-05-01 13:50 -0700 |
| Articles | 15 — 6 participants |
Back to article view | Back to comp.lang.java.programmer
new stuff in 1.8 Roedy Green <see_website@mindprod.com.invalid> - 2014-04-27 17:18 -0700
Re: new stuff in 1.8 Joerg Meier <joergmmeier@arcor.de> - 2014-04-28 09:58 +0200
Re: new stuff in 1.8 Roedy Green <see_website@mindprod.com.invalid> - 2014-05-01 05:31 -0700
Re: new stuff in 1.8 Sarah Connor <s.connor@gmail.invalid> - 2014-05-01 12:39 +0000
Re: new stuff in 1.8 Roedy Green <see_website@mindprod.com.invalid> - 2014-05-01 06:03 -0700
Re: new stuff in 1.8 Simon Lewis <simonlewis2001@gmail.com> - 2014-05-01 15:24 +0200
Re: new stuff in 1.8 Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-05-05 07:54 +0000
Re: new stuff in 1.8 Sarah Connor <s.connor@gmail.invalid> - 2014-05-05 08:44 +0000
Re: new stuff in 1.8 Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-05-05 10:30 +0000
Re: new stuff in 1.8 Simon Lewis <simonlewis2001@gmail.com> - 2014-05-05 18:21 +0200
Re: new stuff in 1.8 Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-05-06 12:48 +0000
Re: new stuff in 1.8 Simon Lewis <simonlewis2001@gmail.com> - 2014-05-05 18:20 +0200
Re: new stuff in 1.8 Joerg Meier <joergmmeier@arcor.de> - 2014-05-01 16:44 +0200
Re: new stuff in 1.8 Jeff Higgins <jeff@invalid.invalid> - 2014-05-01 11:17 -0400
Re: new stuff in 1.8 Roedy Green <see_website@mindprod.com.invalid> - 2014-05-01 13:50 -0700
| From | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| Date | 2014-04-27 17:18 -0700 |
| Subject | new stuff in 1.8 |
| Message-ID | <m27rl9dnjnjh18nuqgcq2rpal1hl35mb8l@4ax.com> |
There are some little surprises in 1.8. Regex checking at compile time, fake enums, lightweight, that can be retrofitted to magic int code. I was asking for those back in the Java 1.0 days. Now they come out is the wash as a side effect of annotations. Units of measure consistency (without unit conversion). A nullness checker incompatible with Intellij/FindBug's. Checks that you remembered to initialise everything. making sure you don't use == unless you used intern. Checking GUI thread use. -- Roedy Green Canadian Mind Products http://mindprod.com Computers are like Old Testament gods; lots of rules and no mercy. ~ Joseph Campbell (born: 1904-03-26 died: 1987-10-31 at age: 83)
[toc] | [next] | [standalone]
| From | Joerg Meier <joergmmeier@arcor.de> |
|---|---|
| Date | 2014-04-28 09:58 +0200 |
| Message-ID | <jju6rc6vryat.1nqcg8e7a202t$.dlg@40tude.net> |
| In reply to | #28288 |
On Sun, 27 Apr 2014 17:18:47 -0700, Roedy Green wrote: > fake enums, lightweight, that can be retrofitted to magic int > code I could not find anything about that. Care to elaborate ? Liebe Gruesse, Joerg -- Ich lese meine Emails nicht, replies to Email bleiben also leider ungelesen.
[toc] | [prev] | [next] | [standalone]
| From | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| Date | 2014-05-01 05:31 -0700 |
| Message-ID | <tfd4m91gcmfbggtq1ph9lempujbrqhqsig@4ax.com> |
| In reply to | #28295 |
On Mon, 28 Apr 2014 09:58:37 +0200, Joerg Meier <joergmmeier@arcor.de> wrote, quoted or indirectly quoted someone who said : >I could not find anything about that. Care to elaborate ? These are not quite as built-in as I thought. You have to install them with a rather grim process. See http://mindprod.com/jgloss/annotations.html#CHECKER for links to the bits you will need to try them out. They are called Checker-Framework from the University of Washington. It is just astounding what they are doing with annotations at compile time. Before Java, I mainly coded in Forth and Abundance (a Forth extension). There you can use the same coding language for compile time as run time. Java seemed so hobbled by its complete lack of compile time computation. You could not even embed a compile date or use alternate libraries. Java seems to be evolving nicely. -- Roedy Green Canadian Mind Products http://mindprod.com Computers are like Old Testament gods; lots of rules and no mercy. ~ Joseph Campbell (born: 1904-03-26 died: 1987-10-31 at age: 83)
[toc] | [prev] | [next] | [standalone]
| From | Sarah Connor <s.connor@gmail.invalid> |
|---|---|
| Date | 2014-05-01 12:39 +0000 |
| Message-ID | <ljtfa8$asd$1@speranza.aioe.org> |
| In reply to | #28326 |
On Thu, 01 May 2014 05:31:15 -0700, Roedy Green wrote: > Before Java, I mainly coded in Forth and Abundance (a Forth extension). > There you can use the same coding language for compile time as run time. > > Java seemed so hobbled by its complete lack of compile time computation. > You could not even embed a compile date or use alternate libraries. Java > seems to be evolving nicely. And Lisp did it even earlier and much better.
[toc] | [prev] | [next] | [standalone]
| From | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| Date | 2014-05-01 06:03 -0700 |
| Message-ID | <jug4m99jest342aa48qfq64mqpvqcjl95l@4ax.com> |
| In reply to | #28328 |
On Thu, 1 May 2014 12:39:36 +0000 (UTC), Sarah Connor
<s.connor@gmail.invalid> wrote, quoted or indirectly quoted someone
who said :
>And Lisp did it even earlier and much better.
Even Java drives me crazy counting () and {} nesting depths. Can you
imagine the effect of Lisp?
In Forth, everything is the same precedence. It takes some getting
used to, but eventually is becomes easier to read than precedence
languages. There are no subtle rules to trip you up.
Java trips me up frequently with + meaning either addition or
concatenation depending on the phases of the moon. They really should
have sprung for a separate concatenation operator, or at least have
IDEs display the + in a different colour or font depending on which it
means.
I also choke every time see a cast. Just what in the chain is it
casting?
--
Roedy Green Canadian Mind Products http://mindprod.com
Computers are like Old Testament gods; lots of rules and no mercy.
~ Joseph Campbell (born: 1904-03-26 died: 1987-10-31 at age: 83)
[toc] | [prev] | [next] | [standalone]
| From | Simon Lewis <simonlewis2001@gmail.com> |
|---|---|
| Date | 2014-05-01 15:24 +0200 |
| Message-ID | <877g658we7.fsf@gmail.com> |
| In reply to | #28329 |
Roedy Green <see_website@mindprod.com.invalid> writes:
> On Thu, 1 May 2014 12:39:36 +0000 (UTC), Sarah Connor
> <s.connor@gmail.invalid> wrote, quoted or indirectly quoted someone
> who said :
>
>>And Lisp did it even earlier and much better.
>
> Even Java drives me crazy counting () and {} nesting depths. Can you
> imagine the effect of Lisp?
Seriously, if you are "counting" brackets there is something very very
broken in your approach and knowledge of editors and IDEs.
>
> In Forth, everything is the same precedence. It takes some getting
> used to, but eventually is becomes easier to read than precedence
> languages. There are no subtle rules to trip you up.
>
> Java trips me up frequently with + meaning either addition or
> concatenation depending on the phases of the moon. They really should
> have sprung for a separate concatenation operator, or at least have
WHAT? a separate concatenation operator? You may as well suggest they
dump java and go back to C.
> IDEs display the + in a different colour or font depending on which it
> means.
Some might.
>
> I also choke every time see a cast. Just what in the chain is it
> casting?
the type of the variable.... no other.
[toc] | [prev] | [next] | [standalone]
| From | Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> |
|---|---|
| Date | 2014-05-05 07:54 +0000 |
| Message-ID | <slrnlmegsr.bi9.avl@login.logic.tuwien.ac.at> |
| In reply to | #28330 |
Simon Lewis <simonlewis2001@gmail.com> wrote:
> Roedy Green <see_website@mindprod.com.invalid> writes:
>> On Thu, 1 May 2014 12:39:36 +0000 (UTC), Sarah Connor
>> <s.connor@gmail.invalid> wrote, quoted or indirectly quoted someone
>> who said :
>>>And Lisp did it even earlier and much better.
>> Even Java drives me crazy counting () and {} nesting depths. Can you
>> imagine the effect of Lisp?
> Seriously, if you are "counting" brackets there is something very very
> broken in your approach and knowledge of editors and IDEs.
In Java, there's at least that distinction between braced structural blocks
and parentheses in expressions. And if expressional parentheses do not
properly pair up inside a structural block, then I can be pretty damn sure
that the compiler will tell me near to the spot and not just at the end
of the source file.
Structural blocks *should* be consistent with indentation, and thus not
necessary to count. (if not consistent, then who's to blame?)
Lisps parentheses are indeed horror.
>> Java trips me up frequently with + meaning either addition or
>> concatenation depending on the phases of the moon. They really should
>> have sprung for a separate concatenation operator, or at least have
> WHAT? a separate concatenation operator? You may as well suggest they
> dump java and go back to C.
I cannot follow *that* logic. Java, while refusing operator overloading
to the programmer, is burdened with one instance of exactly the kind of
overloading that they didn't want programmers to be able to do. Otoh.,
where "+" would really make sense (namely for BigInteger and BigDecimal)
it cannot be used.
How would having e.g. the "#" character for String concatenation
brought anything nearer to C (or C++) ?
Not that I had any false hopes of something changing here, of course.
>> IDEs display the + in a different colour or font depending on which it
>> means.
> Some might.
I think the main ones (eclipse and netbeans) don't, but it's been a while
since I last used netbeans, so I don't know if anything changed since back
then.
>> I also choke every time see a cast. Just what in the chain is it
>> casting?
> the type of the variable.... no other.
Are you serious about your interpretation of the question?
I share Roedy's point, when I have to write or read stuff like
(Type2)((Type1)var1.var2.method(foo("xyyz"))).abc.whatever(blah);
ok, it's not all that frequent and somewhat exaggerated, but what I come
across in real code is already more than it would be in an ideal world.
[toc] | [prev] | [next] | [standalone]
| From | Sarah Connor <s.connor@gmail.invalid> |
|---|---|
| Date | 2014-05-05 08:44 +0000 |
| Message-ID | <lk7j1a$lqh$1@speranza.aioe.org> |
| In reply to | #28368 |
On Mon, 05 May 2014 07:54:02 +0000, Andreas Leitgeb wrote: > Lisps parentheses are indeed horror. To someone who isn't using the appropriate tools (in particular, paredit), it might seem that way, I suppose.
[toc] | [prev] | [next] | [standalone]
| From | Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> |
|---|---|
| Date | 2014-05-05 10:30 +0000 |
| Message-ID | <slrnlmeq33.bi9.avl@login.logic.tuwien.ac.at> |
| In reply to | #28370 |
Sarah Connor <s.connor@gmail.invalid> wrote: > On Mon, 05 May 2014 07:54:02 +0000, Andreas Leitgeb wrote: >> Lisps parentheses are indeed horror. > To someone who isn't using the appropriate tools (in particular, > paredit), it might seem that way, I suppose. Probably the best tool in the sad context of having to produce lisp (or for slightly less-OT: clojure) code would be a source-level translator from any decent language to lisp/clojure. (And "cat" surely doesn't qualify. ;) PS: googled for paredit and found something related to emacs, but the layout of those samples still qualifies as "horror" to me. What's worse, I once had a colleague who used that lisp style for C++ }}}}}}}}}
[toc] | [prev] | [next] | [standalone]
| From | Simon Lewis <simonlewis2001@gmail.com> |
|---|---|
| Date | 2014-05-05 18:21 +0200 |
| Message-ID | <87r448tcwd.fsf@gmail.com> |
| In reply to | #28370 |
Sarah Connor <s.connor@gmail.invalid> writes: > On Mon, 05 May 2014 07:54:02 +0000, Andreas Leitgeb wrote: > >> Lisps parentheses are indeed horror. > > To someone who isn't using the appropriate tools (in particular, > paredit), it might seem that way, I suppose. Or doesn't understand lisp. It's no worse than anything else in other languages.
[toc] | [prev] | [next] | [standalone]
| From | Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> |
|---|---|
| Date | 2014-05-06 12:48 +0000 |
| Message-ID | <slrnlmhmgg.bi9.avl@login.logic.tuwien.ac.at> |
| In reply to | #28378 |
Simon Lewis <simonlewis2001@gmail.com> wrote: > Sarah Connor <s.connor@gmail.invalid> writes: >> On Mon, 05 May 2014 07:54:02 +0000, Andreas Leitgeb wrote: >>> Lisps parentheses are indeed horror. >> To someone who isn't using the appropriate tools (in particular, >> paredit), it might seem that way, I suppose. > Or doesn't understand lisp. > It's no worse than anything else in other languages. Ok, I admit I'd even prefer lisp to certain other computer languages, like e.g. Malbolge. ;-) And now for something completely different... back to Java.
[toc] | [prev] | [next] | [standalone]
| From | Simon Lewis <simonlewis2001@gmail.com> |
|---|---|
| Date | 2014-05-05 18:20 +0200 |
| Message-ID | <87vbtktcx6.fsf@gmail.com> |
| In reply to | #28368 |
Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> writes:
> Simon Lewis <simonlewis2001@gmail.com> wrote:
>> Roedy Green <see_website@mindprod.com.invalid> writes:
>>> On Thu, 1 May 2014 12:39:36 +0000 (UTC), Sarah Connor
>>> <s.connor@gmail.invalid> wrote, quoted or indirectly quoted someone
>>> who said :
>>>>And Lisp did it even earlier and much better.
>>> Even Java drives me crazy counting () and {} nesting depths. Can you
>>> imagine the effect of Lisp?
>> Seriously, if you are "counting" brackets there is something very very
>> broken in your approach and knowledge of editors and IDEs.
>
> In Java, there's at least that distinction between braced structural blocks
> and parentheses in expressions. And if expressional parentheses do not
Like a lot of other languages.
This is basic stuff. IDEs cope with them well. Good editors like Emacs
cope with them well. Complaining here is the equivalent of saying "I
cant google" IMO.
> properly pair up inside a structural block, then I can be pretty damn sure
> that the compiler will tell me near to the spot and not just at the end
> of the source file.
or you keep an eye on things as you type/edit. Amazing idea I
know. There's this wonderful rocket science thing called "syntax hiliting".
>
> Structural blocks *should* be consistent with indentation, and thus not
> necessary to count. (if not consistent, then who's to blame?)
>
> Lisps parentheses are indeed horror.
Not really. With a good editor. Like Emacs.
[toc] | [prev] | [next] | [standalone]
| From | Joerg Meier <joergmmeier@arcor.de> |
|---|---|
| Date | 2014-05-01 16:44 +0200 |
| Message-ID | <v40v2ggpkmfi.11n98urnojgft$.dlg@40tude.net> |
| In reply to | #28326 |
On Thu, 01 May 2014 05:31:15 -0700, Roedy Green wrote: > These are not quite as built-in as I thought. You have to install > them with a rather grim process. > See http://mindprod.com/jgloss/annotations.html#CHECKER > for links to the bits you will need to try them out. I'm confused as to what this has to do with Java 1.8. As far as I can tell, that's a third party library completely unrelated to Oracle or Java 1.8. Liebe Gruesse, Joerg -- Ich lese meine Emails nicht, replies to Email bleiben also leider ungelesen.
[toc] | [prev] | [next] | [standalone]
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Date | 2014-05-01 11:17 -0400 |
| Message-ID | <ljtoke$bit$1@dont-email.me> |
| In reply to | #28331 |
On 05/01/2014 10:44 AM, Joerg Meier wrote: > On Thu, 01 May 2014 05:31:15 -0700, Roedy Green wrote: > >> These are not quite as built-in as I thought. You have to install >> them with a rather grim process. > >> See http://mindprod.com/jgloss/annotations.html#CHECKER >> for links to the bits you will need to try them out. The Checker Framework project may be found here: <http://types.cs.washington.edu/checker-framework/>. > I'm confused as to what this has to do with Java 1.8. As far as I can tell, > that's a third party library completely unrelated to Oracle or Java 1.8. The Checker Framework is a Java annotation processor capable of processing the new to Java 1.8 type annotations. It is not "new stuff 'in' Java 1.8".
[toc] | [prev] | [next] | [standalone]
| From | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| Date | 2014-05-01 13:50 -0700 |
| Message-ID | <2oc5m9lm2mb16dio3t70bolh423skqhsj5@4ax.com> |
| In reply to | #28332 |
On Thu, 01 May 2014 11:17:12 -0400, Jeff Higgins <jeff@invalid.invalid> wrote, quoted or indirectly quoted someone who said : >It is not "new stuff 'in' Java 1.8". Yes. I wasted a lot of time thinking it was. I got the wrong impression because I learned of it from this announcement https://blogs.oracle.com/java-platform-group/entry/java_8_s_new_type headed "Java 8's new Type Annotations" -- Roedy Green Canadian Mind Products http://mindprod.com Computers are like Old Testament gods; lots of rules and no mercy. ~ Joseph Campbell (born: 1904-03-26 died: 1987-10-31 at age: 83)
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.java.programmer
csiph-web