Most Popular

1500 questions
79
votes
20 answers

How do you handle your Project Manager

I currently work for a company that has recently downsized. I do all in-house work, client installs, builds, QA, and, well, basically all the in-house work. My direct boss is VERY nontechnical and lately I have found it VERY hard to deal with his…
79
votes
10 answers

How functional programming achieves "No runtime exceptions"

How does a functional programming language, such as Elm, achieve "No runtime exceptions"? Coming from an OOP background, runtime exceptions have been part of whatever framework that is based on OOP, both browser-based frameworks based on JavaScript…
Fireburn
  • 889
79
votes
11 answers

Why aren't Java objects deleted immediately after they are no longer referenced?

In Java, as soon as an object no longer has any references, it becomes eligible for deletion, but the JVM decides when the object is actually deleted. To use Objective-C terminology, all Java references are inherently "strong". However, in…
moonman239
  • 2,053
79
votes
3 answers

Naming of bool methods: Is vs. Can vs.?

Which is the better name for a method that returns a boolean? IsSupportContentType or CanSupportContentType
Mediator
  • 859
79
votes
6 answers

Are all magic numbers created the same?

On a recent project, I needed to convert from bytes to kilobytes kibibyte. The code was straightforward enough: var kBval = byteVal / 1024; After writing that, I got the rest of the function working & moved on. But later on, I started to wonder if…
user53019
79
votes
5 answers

Is there a correlation between the scale of the project and the strictness of the language?

Explaining the difference between strictness of languages and paradigms to a colleague of mine, I ended up asserting that: Tolerant languages, such as dynamic and interpreted languages, are used best for prototypes and small projects or medium-size…
79
votes
13 answers

What are examples of comments that tell you why instead of how or what?

First of all, in this question I'd like to stay away from the polemic on whether source code commenting is good or bad. I'm just trying to understand more clearly what people mean when they talk about comments that tell you WHY, WHAT or HOW. We…
rick
  • 1,965
79
votes
3 answers

Trailing slash in RESTful API

I have been having a debate about what to do with a trailing slash in a RESTful API. Lets say I have a resource called dogs and subordinate resources for individual dogs. We can therefore do the following: GET/PUT/POST/DELETE…
GWed
  • 3,125
79
votes
5 answers

Why put the business logic in the model? What happens when I have multiple types of storage?

I always thought that the business logic has to be in the controller and that the controller, since it is the 'middle' part, stays static and that the model/view have to be capsuled via interfaces. That way you could change the business logic…
79
votes
15 answers

Is it ever ok to have an empty catch statement?

I thought about it and could not come up with an example. Why would somebody want to catch an exception and do nothing about it? Can you give an example? Maybe it is just something that should never be done.
ysolik
  • 6,330
79
votes
15 answers

Should developers enter bugs into the bug tracking system?

While developing (either features or bug fixes) I sometimes happen to discover bugs that are not directly related to what I'm working on. What should I do in that situation. Just fix it? Try to remember to fix it later? Write it down somewhere? …
JoelFan
  • 7,091
79
votes
8 answers

Is it a good practice to use branches to maintain different editions of the same software?

We have a product that has a few different editions. The differences are minor: different strings here and there, very little additional logic in one, very little difference in logic in the other. When the software is being developed, most changes…
79
votes
10 answers

Should we test all our methods?

So today I had a talk with my teammate about unit testing. The whole thing started when he asked me "hey, where are the tests for that class, I see only one?". The whole class was a manager (or a service if you prefer to call it like that) and…
Zenzen
  • 996
79
votes
22 answers

How do I convince my fellow devs to WANT to add comments to source code commits?

I know that Subversion (what we're using at work) can be configured to require comments on commits, however I'm not in a position of power to simply turn this on. I know that my reason for commenting my commits is because it is useful, if only as a…
78
votes
8 answers

A practical use of "yield" keyword in C#

After almost 4 years of experience, I haven't seen a code where yield keyword is used. Can somebody show me a practical usage (along explanation) of this keyword, and if so, aren't there other ways easier to fullfill what it can do?
Saeed Neamati
  • 18,210