Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Make your voice heard. Take the 2019 Developer Survey now

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.

0
votes
2answers
105 views

How can I figure out where the code starts for a complex software project?

Say I want to (try to) read through and understand a fairly complex piece of code (for example the free software Coreboot firmware code, which can be found here). How can I figure out where the code ...
0
votes
2answers
152 views

What to name a class that acts as a container for a collection but isn't a collection itself?

I have an object that acts as nothing more complicated than a data store for a collection of items. I do this because it lets me bind the data to a single object, which I can store in the Unity (game ...
-2
votes
0answers
19 views

Adjusting table columns width linked to a sqlite database and created using java eclipse

I want to adjust the column widths seperately. Not all having same width. here's my code: //columnModel.getColumn(0).setPreferredWidth(100); table = new JTable(); table.setAutoResizeMode(...
0
votes
1answer
112 views

Is there a way to use and ignore blocks of code, caused by events during runtime?

I'm working in C++14 and trying to figure out a way to put two classes (with the same name) inside the same header file. In this scenario one class would always be ignored as a result of something ...
0
votes
2answers
75 views

SVN / Git How to administer branches

I'm the technical lead for a small company (6 developers). We currently use SVN and we're slowly porting over to Git, after everyone gets their training. Currently our clients are the ones who "pull ...
1
vote
2answers
178 views

Unit testing similar wrappers - or single unit test is enough?

I'm working on a service which has a lots of dependencies. The way how I call them is I'm wrapping each service client around an Adapter. Like this (I'm using Java): public abstract class AdapterBase&...
0
votes
1answer
39 views

External source package - download it into the source directoy or the build directory?

I'm working on a software project, Foo, which uses the code of another project, Bar - through the use of CMake's ExternalProject mechanism. Now, if I build Foo out of its source location - should I ...
9
votes
6answers
2k 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, ...
-3
votes
1answer
66 views

I want to sell web app and share source code but not to be redistributed. How do I do that?

I want to sell web app to be hosted internally and share source code with that specific client but not to be redistributed(commercially or non-commercially) to outside the office. They can edit and ...
4
votes
2answers
1k views

Monorepo vs multi repo for large project with multiple partial deliveries

I am looking into options for smoothing out our deliver and release pipeline, and would appreciate some advice on the best way to structure the source code. This is a pretty large project, which ...
3
votes
1answer
469 views

How to deal with large source codes?

Maybe this answer already exists here, but I do not know if there is any technical term for that. I'm starting to develop in C ++ and as the program grows in size, it gets harder to move through the ...
2
votes
0answers
140 views

Best practices for understanding/resurrecting old technical code?

Recently, I've been in a few situations where I needed to quickly come up to speed on old code and fix it sufficiently for people to be able to use it again. The code I've worked on tends to have the ...
0
votes
0answers
36 views

How does 'digiCamControl' comunicate with cameras?

I'm planning a small project where a device (raspi) reads information from a camera device (ISO, Shutter speed, F, white balance, mode type, etc...) and write these values in a screen, console or ...
204
votes
10answers
24k 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 ...
-2
votes
1answer
75 views

Which data structure should I use for implementing a code indexer

I need to write a basic code indexer, which needs to be fast. Should I use an embedded SQLite database for this or should rather rely on a custom data structure, or even flat files as used by ctags? ...
0
votes
1answer
215 views

Database migrations and Code deployment

Should Database migrations be in included in the same deployment project as the code? If they are not included in the same deployment, the Database deployment package and the Code deployment package ...
1
vote
0answers
73 views

Allow Third Party Access to Source Code without right to redistribute or sell [closed]

I am in a situation where a client is asking that I develop a custom software product for them. They've asked that I subcontract under another party that they have worked with before. In reading the ...
1
vote
2answers
265 views

Solution to growing code footprint

I have this conondrum I have to deal with. We have this already pretty big application which main purpose can be classified into 2 main functions: Core data (deals with a pretty complex data ...
1
vote
2answers
197 views

Overhead of using big singleton with all files includes

I have several subsystem managers for various uses, for example: AudioManager CollisionManager InputManager etc. At first I wanted them to be all singletons, however now want to make the ...
1
vote
3answers
187 views

Difference between 'system code' and 'application code'

I'm reading Code Complete (2nd Edition) and in Chapter 21 the author mentions the terms system code and application code in the context of formal inspections, saying that system code has to be handled ...
0
votes
2answers
131 views

Should I use unknown code from a third party? [closed]

I am looking to build and host a website for a client. Their existing site has a facility that allows customers to make donations and they want the new site to have it too. My manager has told them ...
2
votes
3answers
355 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(); } } ...
0
votes
1answer
162 views

Source Control - ASP.NET WebForms - Inexperienced team

I am currently working at a company that has a small(2) development team for our ASP.NET WebForms project. This was something we picked up from a previous team. The current team is made up of recent ...
5
votes
5answers
402 views

Check if variable is not null before setting to null

One of our team likes to write code like this (C#): if (_someVar != null) { _someVar = null; } Rather than simply: _someVar = null; I've never used the former as I always assumed it was ...
1
vote
2answers
410 views

How useful is line-by-line code re-use?

In my workplace, the client is obsessed with line-by-line code reuse. And they use a tool that uses LoC as measure of code re-usability. Often for two modules, if the logic is same as of now, those ...
4
votes
1answer
150 views

GitHub - Should I unassign an issue once closed?

Whenever I am using issue tracking on GitHub with my team, should we unassign people from the issue once we close it? I don't know which way should be done, and if there is any advantage to ...
0
votes
1answer
41 views

Should requirement/issue number/code be included in the comments of the source code? [duplicate]

I am working on a number of maintenance projects and I always include requirement/issue number/code in the the comments whenever I am adding or changing code. In such way I provide traceability from ...
-3
votes
2answers
996 views

What is the difference between Code Smells and Anti Patterns?

I am trying to understand the difference between these two terms. In some contexts that these two terms have been used interchangeably. What is the exact difference between these two terms ?
4
votes
4answers
283 views

If taking over code of a third party, what are the delivarables?

My team has to take over a project from an external company. They've provided the last state of trunk to us as a zip file and are trying to convince us, to accept this as a complete delivery of their ...
7
votes
4answers
570 views

Where to archive code

Say for example I have some unused code that I want to use in the future and does not work with the rest program,or say that I come across some interesting code online. Is there any good program that ...
145
votes
13answers
24k 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 ...
-2
votes
1answer
95 views

Is it a good practice to separate one function into one file ? [closed]

For example, lodash library here separate each function into each file ? Since this is a popular library and this library organize their files into this way. there must be based on some good practice ...
88
votes
6answers
17k views

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 ...
-5
votes
1answer
164 views

Is it true that Linux and Mac OS programs' source are interchangeable? [closed]

Is it true that most of the times source code for Linux programs can be compiled into Mac OS programs and vice versa?
6
votes
1answer
233 views

What is the difference between predicate and branch

I am confused about the difference between the branch and the predicate in a code. Can someone explain the difference with an example?
-2
votes
1answer
304 views

Why does Java source code contain so many single-letter variables? [closed]

I have been reading the source code of some Java library classes, specifically CompletableFuture. I noticed that the authors are making extensive use of cryptic (single-letter) variables in the code, ...
-1
votes
1answer
90 views

Is the following method to compare source codes or work effort reliable? [duplicate]

I want a feasible way to compare my project with my friend's project. I first thought it was enough to compare based on the number of code lines. But for some reason, people kept saying "LOC is not a ...
10
votes
5answers
1k views

Terminology - is source code a program? [closed]

I'm a beginner in programming and I don't have a good grasp on terminology. I'd like to know if source code written in a compiled language like C or C++ is considered a program? If not, can anyone ...
1
vote
1answer
76 views

How to find out the source code of the earliest release/version?

Reading source code of the early release/version is very helpful for beginner to digest complex project. There is less line of code and learner can see the progression of the project. However, ...
3
votes
1answer
168 views

What data structures are used to represent source code by programs that do source-to-source transformations?

For programs that read in source code, transform that source code, and then write back out the transformed source code so that it can be read and edited by humans, what sorts of data structures are ...
-1
votes
1answer
117 views

How to understand an OS's source? [closed]

I usually understand code by fiddling around, or by inserting printfs here and there, but this time around, that isn't possible, since the end product is an OS, so any suggestions on how to tackle ...
-1
votes
1answer
449 views

Maintain two different versions of similar code [duplicate]

I'm working on a special project where I need to create a new application with a similar but restricted functionality of an original application (basically a type of free application with limited ...
3
votes
3answers
2k views

How to estimate SLOC for project that has no source code yet?

Recently, I've been getting familiar with COCOMO II model to calculate the effort (person-months) and duration (calendar time in months) required to develop a mobile application. To calculate the ...
3
votes
0answers
349 views

Documenting and handing over Source Code

I have recently left my previous student job as a part time developer for at small ERP management firm. During my time at the firm i have developed several modules for integration with the ERP ...
18
votes
3answers
3k views

Managing in-house NuGet packages with source code access

We have a lot of in-house libraries that we would like to share between projects inside the company. These are some of the requirements: library sources are stored in repositories separated from end-...
-1
votes
1answer
186 views

Shorthand notation for XSLT?

There are a few languages, that developed shorthand notations, notably e.g. ECMAScript can be generated from coffeescript: CoffeeScript is a little language that compiles into JavaScript. ...
1
vote
1answer
197 views

What is the purpose of keeping “open” a merged MR in Gitlab?

In gitlab, there is Merge Requests (MR) like in github there is Pull Requests (PR). If the MR is rejected, sure, we close it. But what if the MR is merged ? In that case the button to close the MR ...
10
votes
2answers
411 views

Apollo-11: Using inclusion instead of a linker

Recently digitized and turned into a repo, the original Apollo 11 guidance computer source code has been made available for viewing on Github. In MAIN.agc, the repo author comments that they ...
-2
votes
2answers
863 views

Translation of a project from one language to another

If I wanted to turn a Java game into Lua, how could I do it? I'm thinking that you could have a program read the assembly language behind two programming languages, find the patterns, attach them to ...
1
vote
3answers
366 views

What's code that's not a part of API called? [closed]

In a library with many code, some of them being the API which user would use to interact with the library, what should I call the rest of the code which is not part of the API directly? In other ...