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


Groups > comp.lang.java.programmer > #26294

Re: static data for methods...

From Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at>
Newsgroups comp.lang.java.programmer
Subject Re: static data for methods...
Date 2013-10-10 17:26 +0000
Organization A noiseless patient Spider
Message-ID <slrnl5doqp.mol.avl@gamma.logic.tuwien.ac.at> (permalink)
References <slrnl5ape4.mol.avl@gamma.logic.tuwien.ac.at> <l367f1$iqm$1@dont-email.me> <slrnl5da03.mol.avl@gamma.logic.tuwien.ac.at> <l36avv$86i$1@dont-email.me>

Show all headers | View raw


Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> wrote:
> On 2013-10-10 15:13, Andreas Leitgeb allegedly wrote:
>> Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> wrote:
>>> Quick Q: is this you trying to be economical while doing a refactoring,
>>> or you designing a FUBAR'd mess?
>> The former is close enough. The latter is its inevitable result.
> *Shudder*

Indeed - although the pseudo-local-statics by far aren't the worst.
(At least no longer, thanks to Stefan's suggestion.)

<rant>
Some parts will be ugly as hell primarily for Java's lack of
- operator overloading,
- typedef (give some (e.g. generic) type a simple local name),
- multi-inheritence (for classes) or static methods in interfaces.
- "import static" into local scopes.
- a pre-processor (duck & run :)
</rant>

I'm not even trying to advocate them for Java (no chance, anyway),
but these things simply are, what makes the resulting Java code
highly repetitive, abundantly verbose, roundabout and ugly.

> Anyway, for my two cents, I'd consider two avenues: a static
> map where the methods pick their fields (perhaps IdentityHashMap)

Actually, I do appreciate the compiler being able to check
variable and method names at compiletime.

> or, if the performance hit is a concern, perhaps a custom annotation and an
> annotation parser that would inject the fields into the source code
> pre-compilation (I'm pretty sure that's possible, although I don't
> remember how exactly).

Annotations (well, beyond @Override and @SuppressWarnings) actually 
make me shudder even more. No idea, what I'm really missing with that.
It's not the defining or applying them, but the part, where they'd
actually have to trigger/do modifications at/on/to the bytecode.

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

static data for methods... Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2013-10-09 14:18 +0000
  Re: static data for methods... taqmcg@gmail.com - 2013-10-09 07:49 -0700
    Re: static data for methods... Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2013-10-09 15:42 +0000
  Re: static data for methods... Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2013-10-09 15:29 +0000
  Re: static data for methods... Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2013-10-10 14:44 +0200
    Re: static data for methods... Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2013-10-10 13:13 +0000
      Re: static data for methods... Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2013-10-10 15:44 +0200
        Re: static data for methods... Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2013-10-10 17:26 +0000
  Re: static data for methods... Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2013-10-11 22:03 -0700
    Re: static data for methods... Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2013-10-18 15:31 +0000

csiph-web