HTML5 Canvas
Written by: Simon Sarris
Featured Refcardz: Top Refcardz:
  1. Apache Hadoop
  2. Web Driver
  3. MVVM
  4. REST
  5. ADO.NET
  1. HTML5
  2. Ajax
  3. jQuery Selectors
  4. CSS Part 1
  5. Git

Link Details

Link 16227 thumbnail
User 209130 avatar

By ace77
via informit.com
Published: Mar 19 2007 / 01:13

Good source code still requires smart programmers. Java expert Stephen Morris offers a few simple rules for programmers to follow to produce safer Java code.
  • 8
  • 0
  • 2143
  • 0

Comments

Add your comment
User 179375 avatar

Ricky Clarkson replied ago:

0 votes Vote down Vote up Reply

Heap is not automatically returned when a local variable referring to it is destroyed. It is just possible for it to be returned. The author talks about making things private for security, completely neglecting to mention that you can access private fields via reflection, unless you install a suitable security manager. Private isn't usually for security, but for simplicity and to allow code to evolve at a different speed to its clients.

As an aside, it's also not necessarily the best way, e.g.:

(let ((x 0))
(lambda () (incf x 1)))

Every time you run that code you get a new counter function that updates its own copy of x, but x isn't part of the function object. Java supports that via inner classes, but for locals, only for finals.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (8)



Voters Against This Link (0)