Most Popular

1500 questions
94
votes
17 answers

Is it a good idea to design an architecture thinking that the User Interface classes can be replaced by a command line interface?

In Code Complete page 25, it's said that it's a good idea to be able to easily replace the regular user interface classes by a command line one. Knowing its advantages for testing, what about the problems it may bring? Will this extra work really…
94
votes
14 answers

Learn programming backwards, or "so I failed the FizzBuzz test. Now what?"

A Little Background I'm 28 today, and I've never had any formal training in software development, but I do have two higher education degrees equivalent to a B.A in Public Relations and an Executive MBA focused on Project Management. I've worked on…
moraleida
  • 939
94
votes
5 answers

Naming classes, methods, functions and variables

There are 3 important naming conventions: with_underscores PascalCased camelCased Other variants are not important because they are not commonly used. For variables it seems that the one with underscores is the most used by developers so I'll…
Alexa
  • 1,281
94
votes
6 answers

What's the difference between stateful and stateless?

The books and documentation on the MVC just heap on using the Stateful and Stateless terms. To be honest, i am just unable to grab the idea of it, what the books are talking about. They don't give an example to understand any of the either state,…
Pankaj Upadhyay
  • 5,070
  • 12
  • 44
  • 60
93
votes
11 answers

Is static universally "evil" for unit testing and if so why does Resharper recommend it?

I have found that there are only 3 ways to unit test (mock/stub) dependencies that are static in C#.NET: Moles TypeMock JustMock Given that two of these are not free and one has not hit release 1.0, mocking static stuff is not too easy. Does that…
Vaccano
  • 4,048
93
votes
16 answers

How to market yourself as a software developer?

I have noticed that this is a frequent issue among younglings from technical areas such as ours. In the beginning of our careers we simply don't know how to sell ourselves to our employers, and random guy #57 (who is a programmer, but not as good as…
karlphillip
  • 1,548
93
votes
3 answers

Is there a term for unimplemented code that was written for someone else to fill in?

Sometimes in a programming exercise, boilerplate generation, putting guide rails around the tasks for a junior programmer to implement, etc., it happens that the programmer is presented unimplemented code and told to "fill in the blank." For…
93
votes
4 answers

Is it bad practice that a controller calls a repository instead of a service?

Is it bad practice that a controller calls a repository instead of a service? To explain more: I figure out that in good design controllers call services and services use repositories. But sometimes in controller I don't have/need any logic and just…
mohsenJsh
  • 1,305
93
votes
7 answers

Short circuit evaluation, is it bad practice?

Something that I've known for a while but never considered is that in most languages it is possible to give priority to operators in an if statement based on their order. I often use this as a way to prevent null reference exceptions, e.g.: if…
innova
  • 1,041
93
votes
15 answers

TDD Red-Green-Refactor and if/how to test methods that become private

as far as I understand it, most people seem to agree that private methods should not be tested directly, but rather through whatever public methods call them. I can see their point, but I have some problems with this when I try to follow the "Three…
Henrik Berg
  • 979
  • 7
  • 6
93
votes
8 answers

Using multiple Git repositories instead of a single one containing many apps from different teams?

I am migrating a 10-years-old big CVS repository to Git. It seemed obvious to split this multiple-projects repository into several Git ones. But the decision-makers are used to CVS, therefore their point of view is influenced by CVS philosophy. To…
oHo
  • 1,166
93
votes
12 answers

Is there a reason that tests aren't written inline with the code that they test?

I've been reading a bit about Literate Programming recently, and it got me thinking... Well-written tests, especially BDD-style specs can do a better job at explaining what code does than prose does, and have the big advantage of verifying their own…
Chris Devereux
  • 931
  • 2
  • 7
  • 9
93
votes
10 answers

How to motivate co-workers to write unit-tests?

We're working on a large product which has been in production for about 5 years. The codebase is.. erm.. working. Not really well but it is working. New features are thrown into production and tested with a small QA. Bugs are fixed, etc. But no one,…
lurkerbelow
  • 1,009
93
votes
108 answers

Do people in non-English-speaking countries code in English?

I've heard it said (by coworkers) that everyone "codes in English" regardless of where they're from. I find that difficult to believe, however I wouldn't be surprised if, for most programming languages, the supported character set is relatively…
Damovisa
  • 1,975
93
votes
4 answers

Is JavaScript interpreted by design?

I am cautious of asking this question because it might appear overly fastidious. I just opened up JavaScript: The Definitive Guide, and it states of the first page of chapter 1 "JavaScript is a high-level, dynamic, untyped interpreted programming …
Matt Esch
  • 1,183
  • 1
  • 8
  • 10