What is the definition of source code and code? [closed] - definition

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
What is the exact definition of source code and code?
printf("hi\n");
Is this a source code or a code?
int main(void)
{
printf("hi\n");
}
This is definitely a source code, right?

Source code is generally understood to mean programming reports created by a programmer with a text editor or visual programming tool and then stored in a file. The object code usually refers to the output, the compiled file, which is produced when the source code is compiled with a C compiler.
The code file contains a sequence of algorithms that can be read by a machine running on a computer CPU. The operating system or application software is usually in the form of a compiled object code.
Objectives of the source code
Beyond providing the foundation for software development, source code has other important purposes. For example, software installations can be easily customized if skilled users need access to the source code.
Meanwhile, other developers may use source code to create programs similar to other operating systems - which would be tricky without coding.
Allows programmers to access source code to contribute to their community, either by sharing code for learning codes or by recycling it into other parts.
There are various programs for generating source code. Here is an example source code for the Hello World project in C language:
/ * Hello World Program * /
#Include <stdio.h>
main ()
{
printf ("Hello World");
}

Related

Is it ok to use a non-English, foreign language variable name? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
For me, English is too big a mountain. So whenever I use tools like Visual Studio 2017 (C ++), Unity 3D(C#), Visual Studio Code (html), Eclipse (java), and Android Studio, I've always assigned variables in my native language.
ex)
int get넓이(int 가로, int 세로)
{
int square = 가로 * 세로;
return square;
}
However, many people advised not to use non-English variable names because they can 'cause errors'. But I have not experienced any errors yet.
I also contacted the Unity Game Engine customer center on this issue.
And they answered me like this. "You can do this by going to [Visual Studio → File → Advanced Save Options], and then specify" Save as default encoding option "to UTF-8."
So, I wonder if there is an error when programming in a language other than English. because I have not experienced errors using non-English variable names. I have also contacted other community sites on this issue, but I have not seen anyone who experienced the issue.
It completely depends on what language you are programming in. For example, Python3 will support it (mostly, as long as it's Unicode), however, Python2 will not like it at all as it only supports ASCII.
As with any code, if it makes it easier for you then do it. Just try your best to make it readable to others if it is going to be deployed to others. Just make sure your language fully supports Unicode.
C++ has supported Unicode identifiers for a long time with some compiler caveats. So do Java and C#. So there should be no problem compiling it unless you use an old compiler or and old C or C++ standard
However code is for others to read later. Unless you don't want anybody to maintain your code you can use variables in another language.

Test a program in the same or a different programming language? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
When I started to learn about testing a program, all I learned is to
use a library or package in the same language as the tested program.
For example,
if a tested program is written in Python, its testing program is also written in Python and uses UnitTest class in the python
standard library
if a tested program is written in C++, its testing program is also written in C++ and uses some test library in C++.
I just saw a project where the tested program is written in C++, and
the testing program is written in Python. Instead of making the
Python testing program to call the C++ tested source code, the
Python testing program loads and executes the executable compiled
from the C++ tested program.
General in software engineering, for a project, how is it decided to choose the same or a different programming language to test a program?
Thanks.
I assume that you refer to unit tests, at least in the widest sense.
Normally you will use the same language for testing, just for the sake of simplicity. Using a different language just produces communication overhead between the tests and the tested code.
The only case where using a different language could make sense is when the language of your tested code is especially cumbersome (think Assembler or COBOL) or if you are not familiar with it. But the latter case actually does not count because unit tests and the tested code are normally implemented by the same developers.

How to run Clipper Application [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have a legacy code base written in CLIPPER. I don't have any idea of CLIPPER programming language.
How do I get started with it and deploy this application? Is it a scripting language OR some sort of OOPS language any study reference will be helpful
Thanks in Advance
Kaushik
Clipper is 16-bit compiler for character-based (not GUI) applications running on MS-DOS platform. There are, however, 3rd-party tools that will allow to produce 16-bit Windows GUI applications.
It's still owned by Computer Associates but all future development and support was delegated to GrafX long time ago.
The last released version was 5.3 but many developers stayed with 5.2e. The last update was around Y2K.
There are Harbour and xHarbour open source projects that developed their own compilers for this language (which in the beginning was similar to dBase III).
You can find information about the language and some 3-rd party libs in a Clipper section of this web-site.
Native Clipper compiles all its code into a single executable that runs on user desktops. Its data and index files are usually placed on a network share. Executable itself can also be placed on a share with user desktops having a short-cut to it.
Native Clipper applications (16-bit) will not run under 64-bit Windows. There are emulators (like DosBox) that allow to overcome such limitation.
Clipper related questions can be asked on comp.lang.clipper newsgroup.
If you have more questions add them as comments here.
Another good resource is Norton Guides for Windows, you can download it from a great site with lot of information about Clipper:
Download NGW from www.the-oasis.net.
I was unable to find the .NG files on that site, but you can see them online here if you want or try to found the files googling them.

How to organize information about program solution? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
Неllо. I develop system that works with stock exchange(system, below). And there is a lot of information my program need to interact with this system. This system has formal declared interface, but different details beside this declaration and requirements to my system is often changed. So how can I organize available information about this system and requirements to my program that it could be both easy to understand and easy to change.
Your first and foremost goal is to create documentation for the relevant APIs your program exposes and then add documentation for the configuration files, maybe even set up a validator for configuration that.
Automatically generated content from code annotations (depending on your solution, it might be .NET's XML docs or PHPdoc, etc.) is the first step – this will help you document classes and interfaces as you work on the code. The next step is documenting non-code assets. If you have XML configuration, you can write schemas to validate against, for example.
After that comes integration documentation – steps that need to be taken on the production server and/or workstations to install, upgrade and maintain the application, including support scripts.

Do tools exist which automatically find copy-and-paste code? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Are there tools out there which could automatically find copy-and-paste code among a set of files?
I was thinking of writing a script for this, which would just search for equal strings, but such script would find mostly irrelevant equalities. (Such as private final static ...).
Yes, try the Copy Paste Detector.
Our CloneDR is a tool for finding exact and near-miss blocks of code constructed by copy and paste activities.
It can handle systems of millions of lines of code.
It uses precise language grammars to pick out language structures (identifiers, expressions, statements, blocks, functions, classes, packages, ...) that have been copied, and to determine the points of variation across the sets of clones (any of those structures can be parameters!)
CloneDR operates on a wide variety of languages: C, C++, C#, Java, PHP, COBOL, Python, Ada, Fortran, EGL and visual basic (VBScript, VB6, VB.net).
The website has a number of sample clone detection reports from a variety of those languages.
This product is available for evaluation on http://www.semanticdesigns.com. Other open source alternatives are Simian and PMD CPD
http://patterninsight.com/products/cp-miner.php
Related paper - http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.123.113
CloneDigger for Python and Java.