Questions tagged [usage]

8 questions
63
votes
5 answers

When to use primitive vs class in Java?

I see that Java has Boolean (class) vs boolean (primitive). Likewise, there's an Integer (class) vs int (primitive). What's the best practice on when to use the primitive version vs the class? Should I basically always be using the class version…
Casey Patton
  • 5,211
  • 7
  • 33
  • 41
52
votes
11 answers

Why isn't Lisp more widespread?

I am starting to learn Scheme by the SICP videos, and I would like to move to Common Lisp next. The language seems very interesting, and most of the people writings books on it advocate that it has unequaled expressive power. CL seems to have a…
Andrea
  • 5,355
  • 4
  • 31
  • 36
43
votes
10 answers

Why should your code not use 100% CPU?

I'm speaking specifically about a C# .NET 4 program running on Windows XP or higher, but general answers are also acceptable. Assume an already optimized and efficient program. The problem here is entirely down to effects of high CPU usage on…
Nick Udell
  • 1,214
  • 2
  • 11
  • 17
16
votes
8 answers

When should I care about performance?

For the longest time in places like Java's IRC channel, SO, and other places I've been told something along the lines of "Worry about how the code looks and its readability/understandability now, and performance later if absolutely necessary". So…
TheLQ
  • 13,478
  • 7
  • 55
  • 87
4
votes
4 answers

Are `switch` statements generally used wrong?

I see most developers using switch statements with breaks in each and every case. Is this usage of switch statements inappropriate since a simple set of if-else statements would suffice? Is it OK for me to think that the only reason for you to use a…
AxiomaticNexus
  • 776
  • 2
  • 7
  • 11
2
votes
4 answers

Data Structures usage and motivational aspects

For long student life I was always wondering why there are so many of them yet there seems to be lack of usage at all in many of them. The opinion didn't really change when I got a job. We have brilliant books on what they are and their…
Aubergine
  • 137
  • 1
  • 5
0
votes
1 answer

Is the jRails Project something I should use?

The jRails project is a drop in replacement for the Prototype/scriptalicious helpers already a part of the Rails framework. Are your experiences with this project positive? Does it do what it says on the tin? Is it still being maintained or is this…
Drew
  • 175
  • 3
0
votes
2 answers

How to calculate how much of the CPU is used?

Say we have an interrupt that is generated once each time that 1024 bytes of network traffic arrives. Each interrupt takes 3.5 microseconds to process and the network speed is 100Mb.We want the amount of cpu used per second Is it correct that: 1…
user63210
  • 31
  • 1