Questions tagged [source-code]

Source code is any collection of computer instructions (possibly with comments) written using some human-readable computer language, usually as text.

Source code is any collection of computer instructions (possibly with comments) written using some human-readable computer language, usually as text.

271 questions
225
votes
11 answers

Why do we need so many classes in design patterns?

I am junior developer among seniors and am struggling a lot with understanding their thinking, reasoning. I am reading Domain-Driven Design (DDD) and can't understand why we need to create so many classes. If we follow that method of designing…
user1318496
  • 1,767
  • 4
  • 9
  • 11
149
votes
13 answers

Should I refactor the code that is marked as "don't change"?

I am dealing with a pretty big codebase and I was given a few months to refactor existing code. The refactor process is needed because soon we will need to add many new features to our product and as for now we are no longer able to add any feature…
kukis
  • 1,352
  • 2
  • 10
  • 11
144
votes
31 answers

How do you dive into large code bases?

What tools and techniques do you use for exploring and learning an unknown code base? I am thinking of tools like grep, ctags, unit-tests, functional test, class-diagram generators, call graphs, code metrics like sloccount, and so on. I'd be…
miku
  • 1,508
  • 4
  • 18
  • 26
102
votes
9 answers

Why did BASIC use line numbers?

Why did old BASICs (and maybe other languages) use line numbers as part of the source code? I mean, what problems did it (try to) solve?
DerMike
  • 1,053
  • 2
  • 7
  • 9
96
votes
6 answers

Why are some C programs written in one huge source file?

For example, the SysInternals tool "FileMon" from the past has a kernel-mode driver whose source code is entirely in one 4,000-line file. The same for the first ever ping program ever written (~2,000 LOC).
Bran
  • 843
  • 1
  • 6
  • 7
91
votes
17 answers

How do you cope with ugly code that you wrote?

So your client asks you to write some code, so you do. He then changes the specs on you, as expected, and you diligently implement his new features like a good little lad. Except... the new features kind of conflict with the old features, so now…
mpen
  • 1,889
  • 19
  • 29
89
votes
29 answers

Can my company give IP rights away for an application I wrote off hours to another startup?

I am an intern for a health company (unpaid), let's call it Company A and I noticed that they are using a lot of paper form for things that can be done on the computer. Excel files for things that shouldn't be in Excel. So I wanted to improve on my…
Mike Diaz
  • 169
  • 1
  • 2
  • 7
83
votes
4 answers

Classes naming: singular or plural?

It is always difficult for me to choose between singular and plural forms for classes names: CustomerRepository vs. CustomersRepository CustomerService vs. CustomersService CustomerController vs. CustomersController And for composite names it is…
SiberianGuy
  • 4,753
  • 6
  • 34
  • 46
81
votes
5 answers

How do you put a price on your source code?

I was asked to sell the source code (along with existing users) of small utility app I created years ago. I've investigated how to put a price on the source code but so far haven't come up with a good solution. I've searched the net, but haven't…
deviDave
  • 2,933
  • 5
  • 26
  • 30
67
votes
14 answers

How to prevent code from leaking outside work?

Possible Duplicate: How to manage a Closed Source High-Risk Project? I'm working on an institution that has a really strong sense of "possession" - each line of software we write should be only ours. Ironically, I'm the only programmer (ATM), but…
AeroCross
  • 871
  • 1
  • 7
  • 11
64
votes
10 answers

When is code "legacy"?

We've all done it, we've labelled some code (often stuff we've inherited) as "legacy"? But it's still used in the production systems - so is it really legacy? And what makes it legacy? Should we shy away from this unwarranted labelling of perfectly…
Nim
  • 1,363
  • 1
  • 11
  • 17
59
votes
6 answers

Why aren't there code overviews for open-source projects?

There are very complex open source projects out there, and to some of them I think I could make some contributions, and I wish I could, but the barrier to entry is too high for a single reason: for changing one line of code at a big project you have…
56
votes
5 answers

Where do you go to read good examples of source code?

I have heard a few people say that one of the best ways to improve your coding ability is to read others code and understand it. My question, as a relatively new programmer, where do I go to find good source code examples that are not too far over…
Jesse McCulloch
  • 1,124
  • 1
  • 11
  • 13
54
votes
7 answers

Is there something wrong with how we're doing version control?

I work with a team of programmers as the business analyst. We just released version 2.0 of our product and are working on the next version to be released in 3 months (it's an internal software product). Unfortunately version 2.0 has some issues…
Ryan
  • 1,105
  • 1
  • 10
  • 17
52
votes
9 answers

Bad sign if nobody can comprehend one's code?

If a coder writes code that nobody other than he can understand, and code reviews always end with the reviewer scratching his head or holding their head in their hands, is this a clear sign that the coder is simply not cut-out for professional…
Coder Guy
  • 727
  • 1
  • 5
  • 7
1
2 3
18 19