755 reputation
415
bio website assylias.wordpress.com
location London, United Kingdom
age 36
visits member for 2 years, 8 months
seen 3 hours ago

My work combines statistics and programming.

  • I am the author of jBloomberg, a high level wrapper around the Bloomberg Desktop Java API
  • my blog is a combination of those passions.

May
27
comment How to analyze a scenario where a bug didn't get caught and adjust development workflow to prevent similar errors
@RobertHarvey I would suggest the other way round: write a test that goes red then fix the code!
May
11
comment On naming conventions: would you recommend short names or longer, more descriptive names?
If he doesn't know how to use his ide to do something as simple as auto completion he should learn how to use it or maybe just use another one...
Apr
3
comment Are monads a viable (maybe preferable) alternative to inheritance hierarchies?
Not sure I understand how it works: a squirrel and a duck don't fly the same way - so the "fly action" needs to be implemented in those classes... And the flier needs a method to make the squirrel and the duck fly... Maybe in a common Flier interface... Oops wait a minute... Did I miss something?
Apr
1
comment Java's Boolean class - why not an enum?
It wouldn't have been very difficult to add a of or from method and appropriate javadoc.
Apr
1
comment Make methods that do not depend on instance fields, static?
There is an important distinction between static methods with and without side effects. The Google extract really addresses the former.
Mar
31
comment Why is CPU cache memory so fast?
What every programmer should know about memory
Mar
20
comment Java Method Returns Unbounded Type
To simplify, SO is for questions about specific issues with a specific piece of code. Programmers is for higher level question such as design and architecture, algorithms etc. So in this instance SO would probably be a better fit.
Mar
19
comment Java Method Returns Unbounded Type
@thlim Actually I think my answer is incorrect. You would probably get more and better answers on stackoverflow.
Mar
7
comment What exactly is the Garbage Collector in Java?
@back2dos See for example programmers.stackexchange.com/a/149569/47845 - I did not say GC is the only option, only that it has become very efficient (BTW object pooling can actually perform worse in some cases). As for the blocking of the GC - it may or may not be an issue depending on your use case (and even that issue has been reduced significantly by modern concurrent GC algos) - if you need pure real time then yes, GC will be an issue. So I do believe that a modern GC will perform way better than what 99% developers could do by managing memory manually. There is the 1% of course.
Mar
4
comment What exactly is the Garbage Collector in Java?
Your answer maybe understates the power and performance of algorithms. Java's gc (probably other languages too) is extremely good at managing short lived objects making object allocation an extremely cheap operation. Not only does it prevent bugs but it can also improve performance vs a naive manual approach.
Feb
11
comment Choosing value in SQL query vs (Java) code
If it is null final int id = rs.getInt("Id"); will throw an exception...
Feb
11
comment Thread safe GUI programming
weblogs.java.net/blog/kgh/archive/2004/10/multithreaded_t.html
Feb
10
comment equals and hashcode methods autogenerated, is it always a good practice?
Unless a class clearly documents what its equals and hashcode methods do, I would not assume anything about how instances of that class would behave in a hashset/hashmap.
Feb
9
comment Returning null or a empty value/throw exception?
See also stackoverflow.com/questions/271526/…
Feb
8
comment Whats the best way to parallel my problem using Java API
You would probably get more answer on stackoverflow or codereview.stackexchange.com
Jan
30
comment Why are the Java 8 java.time classes missing a getMillis() method?
@AllonGuralnek Yes definitely - however the milliseconds component was important in the Date API because everything was based on a number of millis since the epoch. In the new API it is less relevant IMO. In most use cases, you either need a second precision or the best precision available (nanos). I may be wrong.
Jan
28
comment Why are the Java 8 java.time classes missing a getMillis() method?
"they can't possibly exist there because LocalDateTime is not tied to the UTC timeline" => a LocalDateTime could certainly have a getMillis method that would basically return getNanos()/1e6 - the fact that it is not an instant in time does not prevent it from having a millisecond component.
Jan
25
comment Why are the Java 8 java.time classes missing a getMillis() method?
@RobertHarvey Most classes in the java.time package are immutable and can't be extended.
Dec
2
comment Why did Java make package access default?
stackoverflow.com/questions/6470556/…
Oct
16
comment Storing a value vs calling reference for repeated use in Java
@FaultyJuggler that toString() could be as simple as return someString; or it could be as terrible as String result = ""; for (String t: someHugeList) result += t;... Hence my answer: whether performance will be different or not depends. But using temporary local variables won't hurt performance - so if it is more readable too it is a no brainer.