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.
37 questions
144
votes
31
answers
160k
views
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, ...
28
votes
5
answers
6k
views
Is code ownership a code smell?
This is something I've been thinking about ever since I read this answer in the controversial programming opinions thread:
Your job is to put yourself out of work.
When you're writing software ...
227
votes
11
answers
31k
views
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 ...
22
votes
11
answers
14k
views
Hand over source code to customer
I have made a couple iPhone applications for a customer and was asked today to hand over the source code so that they could do the maintenance if this should be required.
Until now, no code issues ...
22
votes
7
answers
20k
views
Is it necessary to write a javadoc comment for EVERY parameter in a method's signature?
One of the devs on my team believes that it is necessary to write a javadoc comment for EVERY parameter in a method's signature. I do not think this is necessary, and in fact I think it can even be ...
11
votes
2
answers
5k
views
Updating copyright headers each new year just because Jan 1st has passed? [duplicate]
I've seen some projects that - with each new year - start to change all files in their source-tree to update the copyright year.
Isn't this just pushing hot air on a level of magnitude? AFAIK:
...
8
votes
3
answers
638
views
How do you find your way in deeply nested, interfacey code? [duplicate]
I know most people hate flat and long functions, and hate when code is not full of ISomethings.
The problem is that I guess my mind works in different way, and I always have problems with that type ...
9
votes
4
answers
1k
views
Is integer used too much as a data type?
Do most application developers use signed integers in places where they really mean to use unsigned integers? I do it all the time, so do my co-workers. I haven't seen a lot of other extensive ...
89
votes
4
answers
71k
views
Classes naming: singular or plural? [closed]
It is always difficult for me to choose between singular and plural forms for classes names:
CustomerRepository vs. CustomersRepository
CustomerService vs. CustomersService
CustomerController vs. ...
67
votes
14
answers
18k
views
How to prevent code from leaking outside work? [duplicate]
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 ...
50
votes
14
answers
16k
views
Do you sign each of your source files with your name? [duplicate]
Possible Duplicate:
How do you keep track of the authors of code?
One of my colleagues is in the habit of putting his name and email address in the head of each source file he works on, as author ...
40
votes
10
answers
49k
views
Understanding already existing complex code base [duplicate]
Possible Duplicate:
What is the most effective way to add functionality to unfamiliar, structurally unsound code?
Till now, all I have worked on is with Java projects that I build from scratch (...
37
votes
5
answers
5k
views
Are there any actual case studies on rewrites of software success/failure rates?
I've seen multiple posts about rewrites of applications being bad, people's experiences about it here on Programmers, and an article I've ready by Joel Spolsky on the subject, but no hard evidence or ...
26
votes
12
answers
5k
views
How do people manage to write and maintain extremely complex and hard to read code? [closed]
Reading SQLite source code is IMO mission impossible. Yet it is a usable piece of quite complex software (it's a full-blown embedded database after all) that can be downloaded, compiled and used from ...
25
votes
16
answers
5k
views
How do you go about understanding others' code? [duplicate]
What do you do to understand some code that you didn't write? Or code that you wrote long time ago and don't remember what it does anymore.
Do you have some technique that you go about? Do you ...
12
votes
5
answers
1k
views
Time required to start coding at a new company [closed]
I am a software engineer for 4 years, and I just changed my company for the first time.
Company works with pair programming, and it's been 3 days, I couldn't even write a single line of code.
It's so ...
12
votes
11
answers
6k
views
Version control comments - past or present tense [closed]
For version control comments what do other users do/recommend - past or present tense?
I.e.
Changed x to be y.
or
Changing x to be y.
4
votes
3
answers
9k
views
How to show code samples in an interview? [closed]
There have been questions similar to this, but my question is HOW exactly do you showcase your code when going to an interview? Do you show screenshots, or do you bring the actual code? Do you take ...
149
votes
13
answers
26k
views
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 ...
91
votes
17
answers
7k
views
How do you cope with ugly code that you wrote? [closed]
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 ...
64
votes
10
answers
23k
views
When is code "legacy"? [closed]
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? ...
33
votes
14
answers
17k
views
Dealing with profanity in source code [closed]
How do people deal with profanity in source code and VCS comments. Keep or delete?
What about soft-expletives like WTF or Arrgggh?
Is unprofessional, offensive or something to be shrugged off?
24
votes
7
answers
7k
views
How do you read other's code? [closed]
Almost every advanced programmer says that it's very useful to read the code of other professionals. Usually they advice open source.
Do you read it or not? If you do, how often and what's the ...
24
votes
3
answers
5k
views
Must source code released under GPL be human-readable?
In a response to another question, a poster suggested that under the GPL:
...you need to provide the human readable [code], not a whitespace stripped version...
Readability would seem to me to be ...
22
votes
10
answers
6k
views
"// ..." comments at end of code block after } - good or bad? [closed]
I've often seen such comments be used:
function foo() {
...
} // foo
while (...) {
...
} // while
if (...) {
...
} // if
and sometimes even as far as
if (condition) {
...
} // if (...
22
votes
5
answers
2k
views
How-to convince company to start documenting for legacy software [duplicate]
It has been less than a year since I joined my current company. Their majority of sales have come from a single product that has been alive since the last 10 years. However, there is minimal (if at ...
14
votes
7
answers
2k
views
Development Approach: User Interface In or Domain Model Out?
While I've never delivered anything using Smalltalk, my brief time playing with it has definitely left its mark. The only way to describe the experience is MVC the way it was meant to be. ...
11
votes
9
answers
3k
views
Did Dijkstra intend for code modularization, when he wrote about separation of concerns?
First, I read an excerpt Edsger W. Dijkstra's 1974 paper "On the role of scientific thought":
Let me try to explain to you, what to my taste is characteristic for all intelligent thinking. It is, ...
11
votes
7
answers
10k
views
Freelancing - Share the source code? [duplicate]
Possible Duplicate:
Hand over source code to customer
I have developed a couple of form based windows application in vb.net for a client and they all work well and he paid me through a freelance site. ...
10
votes
4
answers
9k
views
Do I have to make source code open, if I use GPLv2 licensed software to derive data
I'm working on a calendar project, on my own. In this project I've to use Swiss Ephemeris. It is licensed under GPLv2 and commercial. With commercial version of license, developers entitled to ...
9
votes
3
answers
3k
views
Quantifying the price for source code and software product
I'm about to undertake a project. This requires me to write code, and tons of it. The client's requirement is to hand in all source code at the end of the project.
My question is: How do I quantify ...
5
votes
4
answers
8k
views
GPL Confusion! Can I sell a product with GPL covered components without making the source available?
I'm really confused..
I'm looking into making a commercial program and there are a few open source, GPL covered components i'd like to use..
Am I allowed to sell my product with the components in ...
5
votes
5
answers
3k
views
How to make sure the application source code has a proper documentation for new programmers? [duplicate]
Possible Duplicate:
How much documentation is enough?
Do you know how the big IT company like IBM, Microsoft, or google make sure their application source code has proper documentation for future ...
3
votes
3
answers
828
views
Is there a way to have four possible outcomes without repeating the two conditions? [duplicate]
In a generic sense, my question goes something like this:
if (p) {
if (q) {
a();
} else {
b();
}
} else {
if (q) {
c();
} else {
d();
}
}
There ...
3
votes
2
answers
330
views
Does removing unused features from libraries through compiler flags increase or reduce security risks?
Software libraries targetting resource constrained environments like embedded systems use conditional compilation to allow consumers to shave space and thus increase performance by removing unused ...
3
votes
2
answers
377
views
Is there a name for being able to quickly find the relevant code? [closed]
I notice that a property of codebases that I like hacking on is that it's quick to find the relevant code for some feature, without knowing much about the code base at all. For example, searching for ...
0
votes
2
answers
524
views
Writing/discussions about the aesthetics of code? [closed]
I'm looking for considerations of the questions "Can code be beautiful?" and "What makes code beautiful?"
Examples would include:
This academic paper: Obfuscation, Weird Languages, and Code ...