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

learn more… | top users | synonyms (1)

-6
votes
0answers
48 views

I have problem with code [on hold]

I should do massiv and The input of information from a text file into an array of records ; The addition of new elements to the end of the array ; To see all the elements of the array ; The ...
-1
votes
0answers
61 views

Removing optional braces in code [on hold]

Is there any regex I can use to strip optional braces from code written in curly-brace programming languages? I'd like to follow the K&R style, where braces only appear where necessary. ...
1
vote
2answers
63 views

Linux source reading without #ifdef [closed]

I want to read Linux source code. Problem here is: source tree contains many files that are needed by different architectures. #ifdef conditionals distracts while reading code. I think, if somehow ...
22
votes
14answers
3k views

How often do experienced programmers have trouble getting their code to perform its intended purpose?

I'm kind of inexperienced with programming (ie less than a year) and I have recently been getting discouraged, mostly from not being able to solve problems with my own code (Not forgetting parentheses ...
0
votes
2answers
72 views

Can I release software under the GPL if it must be built with a proprietary compiler?

The compiler doesn't leave its own code in the software or link proprietary libraries with it, the source code is exactly the same one I used throughout the development process, everyone is free to ...
-2
votes
2answers
117 views

Are there coding standards for whether procedural programs should have source code listed top-down or bottom-up? [closed]

Let's say I have a basic procedural program which is well structured into decomposed functions. For example, a main() function which calls functions a and b, which in turn each call functions c and d, ...
0
votes
0answers
38 views

How to study a big project source code? [duplicate]

I am newly hired in a company department which uses Meteor and React in building projects. As expected, I am required to study the source code regardless of the project size and progress. This ...
2
votes
2answers
134 views

Distributing GPL-ed software with lost source code

Thought experiment. Tom is a software developer. He releases his relatively simple software under GPL. Jerry forks his source code and creates a world savior software with months or years of hard ...
4
votes
3answers
140 views

How to display/clarify the licence for code in a blog

Let's say I have a blog available under one of the Creative Commons licences. Such type of licence would be displayed at the bottom of each page with a link to the actual licence, etc.. However, ...
-4
votes
2answers
142 views

How to find all occurrences of a variable within a source code?

The title is pretty self-explanatory. I have a minified JavaScript code (100k+ lines) and would like to find all occurrences of a particular variable so I could rename it to better understand code. Is ...
18
votes
7answers
5k 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 ...
2
votes
3answers
1k views

Are CK Metrics still considered useful? Is there an open source tool to help?

Chidamber & Kemerer proposed several metrics for object oriented code. Among them, depth of inheritance tree, weighted number of methods, number of member functions, number of children, and ...
88
votes
8answers
13k views

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?
3
votes
1answer
157 views

Architecture: API with slightly different behavior depending on the logged-in user roles

How should I structure a piece of code that executes an operation, but may have slightly different behavior depending on, let's say, user roles? Example: My app has a 'manager' and a 'employee' ...
0
votes
2answers
172 views

How to analyze a code of a web application which is running? [closed]

Joshua Bloch said in an interview that the best way to know and understand code written by others is to read it, mentally or through a debugger. Well, my question is this: is it possible, through a ...
3
votes
1answer
112 views

Do I update the copyright header when i modify the source?

Suppose I were to modify a said piece of code and put it back on github, would I have to update the license header. This is the code(Licensed under the Apache License, Version 2.0): ...
9
votes
5answers
2k views

Semi-intelligent “diff” utility

Part of the QA steps required for a project I am tangentially involved with require the person who is responsible to integrate new version of source file to first calculate how many lines have been ...
0
votes
2answers
144 views

What are good ways to measure project size? How do I compare the size of my project to other projects? [closed]

Background I am currently working for a quite large (relative to what I have done before) hobby project. I would like to compare the size of this project to other open-sourced projects but I cannot ...
1
vote
3answers
208 views

What does it mean to build from source?

I'm trying to install numpy using this. This link opens with these instructions: These instructions describe how to build NumPy and SciPy libraries from source. If you just want to use NumPy ...
6
votes
6answers
372 views

Hyperlinked, externalized source code documentation [closed]

Why do we still embed natural language descriptions of source code (i.e., the reason why a line of code was written) within the source code, rather than as a separate document? Given the expansive ...
2
votes
3answers
217 views

What is the most readable way of passing arguments to the function? [closed]

I'm using JavaScript but the question can be generalized to all the languages. In a nutshell - I'm checking if a browser connecting to my site is a microwave and cater for that accordingly. What ...
63
votes
14answers
11k 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 ...
-2
votes
4answers
118 views

Best possible way to comment? [closed]

My question is simple, how should I comment during development so that it can be beneficial in the following cases: Understandable for my seniors while code reviewing. Should be able to search my ...
1
vote
4answers
170 views

How to keep documentation up to date and accessible [duplicate]

The problem: Documentation is in code in the form of docs, its in wiki websites, its written down on notes, in diagrams and issue management systems. When documentation is so spread out, how does ...
0
votes
1answer
46 views

Snippets (based on MIT licence) from snippets services

I have question about MIT licence code sources Can I publish code snippets [MIT licence] from site like bootsnipp to my blog? Do I have to include source link to site where I have found that snippet ...
0
votes
2answers
141 views

Process of handing over source code to a customer [closed]

Should I just copy the project files to him? Should I sit and explain the code to him ? If so, up to which level of details? Or do I just tell him where everything is within the solution and not how ...
2
votes
2answers
101 views

Delivering source code - refactor for clean up? [closed]

I'm in the middle of developing an asp.net webforms application to a customer, i've been using DataAccess and BusinessLogic layers in a folder structure within my application, in which my DataAccess ...
5
votes
3answers
2k views

Should my source code be in UTF-8?

I feel that often you don't really choose what format your code is in. I mean most of my tools in the past have decided for me. Or I haven't really even thought about it. I was using TextPad on ...
13
votes
8answers
2k views

When does one hard-code actual data values into the code as opposed to using a DB?

A long-standing question for me has been: when do I store data (actual values) in a database table, and when do I store them right in the code? The untold consensus has typically been as such(*): If ...
2
votes
2answers
475 views

How small is the footprint of a small C compiler?

This week I could optimize using a reduced C library that allowed a drastic shrinkage in code size - from about 60 K to about 6 K and then we could load the code in the 8 K on-chip memory of an FPGA ...
14
votes
14answers
3k views

how to find out if spelling mistakes in source code are a serious issue or not? [closed]

I find very troubling amount of spelling mistakes I see everyday in our codebase, from which I will reproduce a very short but representative example: ArgumnetCount Timeount Gor message from queue ...
5
votes
3answers
4k views

Java's Boolean class - why not an enum?

It seems to me that the Boolean class is an ideal candidate to be implemented as an enum. Looking at the source code, most of the class is static methods which could be moved unchanged to an enum, ...
39
votes
13answers
6k views

How safe is it to compile a piece of source code from a random stranger? [closed]

Suppose I'm reviewing code that job applicants send to prove their skills. Clearly I don't want to run executables they send. Not so clearly I'd rather not run the result of compilation of their code ...
0
votes
1answer
78 views

Licensing - Restrictive Open Source License OR Custom License [closed]

I have some source code I want to release but I'm unsure of the best license to put on it. From my research such licenses as MIT and GNU are horrible as they offer little to no protection towards ...
22
votes
12answers
3k views

Should developers be forced to check-in before leaving work each day, even if the code does not compile? [closed]

During a previous consulting position, the developers where told to check-in code on a nightly basis, regardless if it complied or was complete. Managers were afraid of losing any code and said now we ...
54
votes
9answers
10k views

Bad sign if nobody can comprehend one's code? [duplicate]

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 ...
2
votes
4answers
1k views

What are standard directory layouts for source code, other libraries, build scripts, etc.? [closed]

I'm in the process of proposing a new standard directory layout that will be used across all the projects in our organization. Projects can have compiled source code, setup scripts, build scripts, ...
4
votes
1answer
438 views

Code licensing / software licensing [closed]

I’ve been working on something outside of my day job and they have asked me if they can use it. It is a closed source project, but I don’t mind giving them the source code; but I definitely want to ...
1
vote
2answers
196 views

In need of a divide and conquer approach for re-writing small open-source utilities [duplicate]

Preamble (Skip if you don't like to read) I've been learning C/C++ in school for a year now and all the assignments in the book, after reading through the chapters, were not too difficult to ...
6
votes
2answers
474 views

Sharing source code of my online game? [closed]

So one of my long-standing projects is an online fan-game that's been running for a good four years now, and is at least somewhat well-known among the related community. To give you an idea, Alexa ...
0
votes
1answer
497 views

How to present code in academic work?

Actually, I'm writing my undergrad thesis, that consists in analysing the BitTorrent algorithm and see its application on Transmission client as an example of implementation. Reading through its ...
3
votes
1answer
580 views

Licensing code submitted after job interview [duplicate]

I applied for a job in a small company (~25 employees) on December and after a month the CEO of the company wrote to me that he is interested to interview me. During the interview I got a bad ...
21
votes
16answers
3k 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 ...
1
vote
1answer
85 views

Should my program be flawless at release [duplicate]

I'm building a big, very complex piece of open-source software, and it's killing me trying to make what I have as "clean" as it needs to be. What I want to know is: If there is an undetected flaw in ...
0
votes
1answer
56 views

Upgrading inherited 3rd party code with changes [closed]

I inherited a php project of 3rd party code with a good deal of company-specific customization lumped on top of it. Now I've got to upgrade it and the person who owned the project is the one I've ...
0
votes
1answer
88 views

Return values and exceptions [closed]

I wrote simple function that returns a string depending on which condition is TRUE. Here is my code: private String getMyString() { if(!mStrigMember.isEmpty()) { return mStrigMember; ...
8
votes
3answers
1k views

Is reading javadoc preferable to reading source code to familiarise yourself with a library?

I just came across the following in a lab manual at university: You do need to study the interfaces of the classes by generating the javadoc for them so you know what operations are provided (feel ...
0
votes
1answer
60 views

Where should I put (wrapper) scripts in my source tree? [closed]

I have this software package which installs itself to /usr/local/mypackge, with a bunch of subdirs. In bin/ I have linked code, as ELF executables, in /share/doc I have documents, etc. Now suppose ...
17
votes
2answers
17k views

What is programming like in the Japanese language? [closed]

Is the code written in Japanese? Are filenames in English? What about like a C preprocessor? Is that still in English? Are comments in Japanese? Examples would be nice too.
2
votes
1answer
316 views

How can I encrypt or remove readability of source code before publishing it?

I am working on a collaborative project, for which I have to submit source code, which will be used/embedded in the main repository for re-compilation. Is there any way, I can encrypt the source code ...