513 reputation
212
bio website
location
age
visits member for 3 years, 7 months
seen Oct 18 at 10:40

Hello world,

My name is not Monster Truck II and I was not born in 1920. But here is something about me that I feel comfortable sharing. I studied physics and computer science at college and enjoy reading (history, politics, and economics) and listening to music.

Here is my bookshelf:

https://www.goodreads.com/review/list/20250758-monster?order=a&shelf=non-fiction&sort=position


Jun
14
comment C# foreach improvements?
@DocBrown This is not as simple as premature optimisation. I have myself identified bottlenecks in the past and fixed them using this approach (but I'll admit I was dealing with thousands of objects in the collection). Hope to post a working example soon. Meanwhile, here is Jon Skeet. [He says performance improvement won't be significant but that depends much on the collection and the number of objects].
Jun
14
comment Warn about 3rd party methods that are forbidden
This sounds promising. I am going to try this tomorrow and let you know. Thanks Matt.
Jun
14
comment Warn about 3rd party methods that are forbidden
@MasonWheeler Sadly, we actually cannot. It is a compiled binary (.dll, .jar) that we use. Plus, there are pitfalls to that approach as we can go off latest, miss out on support (which is very critical to us), etc..
Jun
14
comment C# foreach improvements?
@Jalayn Please post that as an answer. It is one of the best approaches.
Jun
14
comment Warn about 3rd party methods that are forbidden
Yeah. It is a huge library. But even worse, we have lots of such libraries (across C#, Java projects). I am also thinking of a post compilation ant checks.
Jun
14
comment C# foreach improvements?
-1: Bill Wagner in More Effective C# describes why one should always stick to foreach over for (int i = 0…). He has written a couple of pages but I can summarise in two words --compiler optimisation on iteration. Ok that wasn't two words.
Jun
10
comment Sharing object between 2 classes
@justin glad I could help.
Jun
10
comment Sharing object between 2 classes
@Justin Added two example code stubs that you can re-use. I don't know PHP so there may be a few syntax errors here and there, hope you will recognize them and avoid them.
Jun
9
comment Sharing object between 2 classes
It will solve the problem but I won't recommend it though. You should use the singleton pattern only when the design of the object itself mandates that it be singleton.
Jun
9
comment Sharing object between 2 classes
@Justin yes (in essence). Sorry, I am on a mobile device and cannot post code. Will post it shortly when I get to a PC.
Jun
9
comment How should my local git workflow work?
@Kos I think it would be best if you post that as a question. I myself would like to know an answer to that question.
Jun
9
comment Can you program Android Apps in a functional language?
+1 to neutralise the down vote. I do think this is a good and specific question.
Jun
9
comment null pointers vs. Null Object Pattern
Fair point DXM.
Jun
9
comment null pointers vs. Null Object Pattern
I now understand what you meant by catastrophic error --something that causes the object allocation itself to fail. Right? Edit: Cannot do @ DXM because your nickname is just 3 chars long.
Jun
9
comment null pointers vs. Null Object Pattern
In Pros section: Agree with the first point. The second point is the designers fault because even null can be used where it shouldn't be. Does not say anything bad about the pattern just reflects on the developer who used the pattern incorrectly.
Jun
9
comment null pointers vs. Null Object Pattern
Agree with the use case for null object patterns. But why return null when encountering catastrophic failures? Why not throw exceptions?
Jun
9
comment As a programmer how do I plan to learn new things in my spare time
@SilviuStraliciuc We have closed them in the past. See these questions: programmers.stackexchange.com/questions/147185/… programmers.stackexchange.com/questions/147562/… programmers.stackexchange.com/questions/147185/… programmers.stackexchange.com/questions/146420/… programmers.stackexchange.com/questions/151531/…
Jun
8
comment As a programmer how do I plan to learn new things in my spare time
Please see faq. This question is off topic.
Jun
7
comment How does the Java Virtual Machine execute code written in other languages?
@Pomario Jython has been around for a while now. And this page seems to suggest that Jython scripts could run on 1.4.2.
Jun
7
comment How does the Java Virtual Machine execute code written in other languages?
@Pomario "What has changed"? The compilers available for those languages have changed --in the sense, that they were invented after JVM became popular.