Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #27403
| From | markspace <markspace@nospam.nospam> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: The Assignment Principle |
| Date | 2014-01-26 14:27 -0800 |
| Organization | A noiseless patient Spider |
| Message-ID | <lc4243$fqg$1@dont-email.me> (permalink) |
| References | <assignment-principle-20140126210852@ram.dialup.fu-berlin.de> |
On 1/26/2014 12:17 PM, Stefan Ram wrote: > Also, it is > about values and not expressions, so that > > v = java.lang.Math.random(); Well, most often it is about expressions: a = 2; b = 1; v = a * a + b; System.out.println( v == 5 ); Had darn well better print 'true'; Math.random() is kind of an exception, as well as NaN, which has its own semantics for comparisons. It's fair to point out that objects have states, and method invocation often returns different values based on their internal state. InputStream in = ... v = in.read(); Is going to return a different value for each invocation, generally speaking. We're getting into the difference between traditional languages, which do have state, and functional languages, which try to avoid mutable state whenever possible. Functional languages try to mimic the behavior of algebra and mathematics, so that's why they look a lot closer the mathematical formulas and properties you are used to from that field. But Java isn't functional programming, and those properties you learned for algebra aren't going to always work here. Thus, learning Java involves learning a new set of rules, not trying to make Java work like the other set of rules.
Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread
Re: The Assignment Principle markspace <markspace@nospam.nospam> - 2014-01-26 14:27 -0800
Re: The Assignment Principle Robert Klemme <shortcutter@googlemail.com> - 2014-01-27 18:50 +0100
Re: The Assignment Principle markspace <markspace@nospam.nospam> - 2014-01-27 13:33 -0800
Re: The Assignment Principle Robert Klemme <shortcutter@googlemail.com> - 2014-01-29 06:10 -0800
Re: The Assignment Principle Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2014-01-29 16:24 +0200
Re: The Assignment Principle FredK <fred.l.kleinschmidt@gmail.com> - 2014-01-27 12:04 -0800
csiph-web