Jump to content

  • Log In with Google      Sign In   
  • Create Account


brx

Member Since 28 Jan 2011
Offline Last Active Yesterday, 01:33 AM

Posts I've Made

In Topic: Branching in switch statement

24 January 2014 - 02:06 PM

 

 I pretty soon discoverd that switch is an instruction that has nothing exclusive to the rest of instructions so I realized I will never need it.

 

Ehmmm.... actually... that is not quite right... switch does have something exclusive. A switch statement can - quite often - be realized through a jump table or something similar (performance!). I don't know of any compiler that can do that for a nested if statement (which is the only alternative to a switch). I have implemented quite a lot of programming languages myself (high level languages... Java, C#, Smalltalk, Javascript, some custom scripting languages) and I can assure you: If it's possible, use "switch" instead of nested IFs. It is very likely to be faster. I only talked about "interpreted" languages (the quotes are due to the fact that, of course, nowadays those are not really interpreted anymore, but just-in-time-compiled), but if I remember correctly from some previous posts from you, you are using C++... the thing about the jump table does also apply to C++ (which, in general, is not interpreted nor JIT'ed)


In Topic: Project Management Tools

22 January 2014 - 05:46 PM

My vote goes to the tools from atlassian: https://www.atlassian.com

 

First of all Jira is (IMHO) the best bug tracking system there is. Not exactly project management, I know, so...

 

They have a great product called "JIRA Agile" which is (again IMHO) great for managing software development (depending on your development process of course... if it's all waterfall for you, this will not help...)

 

The nicest thing are all the other (some 3rd party) great add-ons and plug-ins. You can have gantt charts, time management, integration of your git/svn/hg/cvs/mercurial/whatever repositories (FishEye), direct integration to your CRM systems...

 

And even if the marketplace does not offer the right thing, it is fairly easy to create your own plug-ins (I've written two so far - one for integrating our in-house time tracking system and one for integrating our in-house bug-tracker (no... we do not use Jira for that - unfortunately - we use it for project and development managment only)).

 

It is not free, but the "small" license (up to 10 users) is close to free ($10).

 

I guess, I better stop now, before this sounds like an atlassian marketing post (disclaimer: I am not in any way affiliated with atlassian, I just like their products).


In Topic: What reference book on C++ should a beginner buy?

05 December 2013 - 07:10 AM

Since you're asking for a reference book I would suggest this: http://www.amazon.com/The-Programming-Language-4th-Edition/dp/0321563840


In Topic: "built-in loop" question

14 October 2013 - 06:54 AM


Anyways, peace out. You guys can have the last word.

 

I take it, this means you are not going to return to this thread. However, I still want to clear something up:

 

Yes, I did take your statement out of context, that's why I labeled it to be off topic. I also know, that you were not talking about int/Integer in Java but on a higher level of abstraction.

 

However, I think there still is a valid point in it regarding this thread:

You will actually find pages on the internet that tell you that comparing two objects of the class type Integer using '==' will behave the same as comparing two values of the primitive type 'int' (as opposed to using the class type Double where two objects of that class will never evaluate to equal using the operator). And at first glance (when dealing with small numbers) this is actually true.

 

I am not saying, that you will spread such false information unchecked, but if you do not understand all (or most of) the little details and quirks, something like this can happen very fast. So, in my opinion, when trying to teach others, the teacher should be way ahead of the students and not just ahead by one page of the text book. And this example wasn't about finding a quick fix (i.e. exchanging Integer with int), but finding an explanation - magic has nothing to do with it.

 

As a side note: Don't use the Integer class if you have no reason ;-). Using OR-Database mappers like hibernate would be a valid reason, for example.


In Topic: "built-in loop" question

14 October 2013 - 05:54 AM

Integers aren't that hard to figure out.

 

 

 

Kind of off topic, but to be honest, since you were talking about Java, Integers can be kind of hard to figure out. Try the following:


public class Main {
	public static void main(String[] args) {
		Integer a = new Integer(126);
		Integer b = new Integer(126);
		a += 1;
		b += 1;
		if (a == b) {
			System.out.println("equal");
		} else {
			System.out.println("not equal");
		}
		a += 1;
		b += 1;
		if (a == b) {
			System.out.println("equal");
		} else {
			System.out.println("not equal");
		}
	}
}

Run it and try to come up with an explanation.

 

I don't think this website turns in anything closely related to a cult; to me the thread looks like some good people trying to save you (and possible your future viewers) from a bad time.


PARTNERS