RSS

Tag Archives: variables

Variable Names & Key Values

Constructing JSON in Java can be a bother.  The most standard JSON library requires objects to be created, and then called to put the members on there.  So much easier in JavaScript, but it is not Java script.  Still, one technique to improve the readability is to name the variable in java to match the key in JSON.   Simple concept, easy to do, I sometimes wonder why it is not obvious to all. Read the rest of this entry »

Advertisements
 
Leave a comment

Posted by on May 7, 2019 in Coding, Example Code

 

Tags: , , ,

#31 Factor Expensive Expressions out of Loops

If you are are calling a method on an object, it is not always clear whether it is an expensive operation (takes a long time, lots of CPU power) or an inexpensive operation.  If you have a loop, and you are calling the same method with the same parameters multiple times, you run the risk of making a very expensive mistake. Read the rest of this entry »

 
Leave a comment

Posted by on October 14, 2012 in Coding

 

Tags: , ,