Talk:Computer programming

From Wikipedia, the free encyclopedia

This article is within the scope of Computing WikiProject, an attempt to build a comprehensive and detailed guide to computers and computing. If you would like to participate, you can edit the article attached to this page, or visit the project page, where you can join the project and/or contribute to the discussion.
??? This article has not yet received a rating on the quality scale.
??? This article has not yet received an rating on the importance scale.

Welcome! This subject is outlined on the List of basic community programming topics. That list, along with the other Lists of basic topics, is part of a map of Wikipedia. Your help is needed to complete this map! To begin, please look over this subject's list, analyze it, improve it, and place it on your watchlist. Then join the Lists of basic topics WikiProject!

This article is within the scope of WikiProject Computer science, which aims to create a comprehensive computer science reference for Wikipedia. Visit the project page for more information and to join in on related discussions.
Start rated as start-Class on the assessment scale
Top rated as top-importance on the assessment scale
Computer programming is included in the 2007 Wikipedia for Schools, or is a candidate for inclusion in future versions. Please maintain high quality standards, and make an extra effort to include free images, because non-free images cannot be used on the CDs.

Contents

[edit] Compiling and interpreting

Step four is dumb. Compiling is done by a compiler, not by a computer programmer, and is in no way relevant to the process of software development. Many programs are interpreted anyway, so compilation is hardly a necessary step. I don't know who came up with this list but it's pretty bad. —The preceding unsigned comment was added by 165.123.150.244 (talk • contribs) 20:45, 12 March 2002.

One way or another, code must be translated into assembly language before it can be run by a computer. Sometimes this process is transparent, such as execution of a program written in an interpreted language (e.g. Javascript). The distinction itself is certainly important. Brent 21:33, 18 October 2005 (UTC)
Well, that's a little unfair. Tell me: who wrote the compiler program? —The preceding unsigned comment was added by 24.165.123.157 (talk • contribs) 22:23, 4 October 2005.
As for those interpretted languages, it's basically just taking the information in the program and reading it to the computer in machine language, AKA: binary, or machine binary, depending on how technical you are. And if compiling isn't part of the programming process, then how does, say, this code:
from Tkinter import *
root = Tk()
w = Label(root, text="Hello, world!")
w.pack()
root.mainloop()
turn into the 0's and 1's so imprinted into the ignorant person's mind? It definitely doesn't do it by itself! No, I have a nice, dandy, little program called py_compile.py that does it for me. It's very convenient, very real, and very definitely a part of the programming process. And it definitely doesn't run by itself.
Do you yourself program? If not, I suggest taking it up. It is a very good hobby.
print "See ya' later!" --AHFN October 4, 2005
That code above is represented internally as "0's and 1's", and so is this sentence. Compilation has nothing to do with that. I am not sure what you are attempting to stuff into this fuzzy notion of "machine binary", but Python is an interpreted language, which means py_compile is not creating an executable ("machine binary"), but transforming the source text into an intermediate representation for the sake of efficacy - in this case bytecode. For what it's worth, it definitely does "run by itself" - each time the module is imported or run via "python filename". that is what all those .pyc files are doing lying around. As for compilation (always) being a very definite part of the programming process, i don't really think that is valid. consider a language like Scheme, where the intermediate representation of the source code is negligibly different from the source itself. The term, "compilation" is largely synonymous with arduous build processes (linking, makefiles), and applying it to the implicit generation of bytecode or abstract syntax trees is a stretch. --Moe Aboulkheir —The preceding comment was added on 19:02, 16 October 2005.
Hmm, you yourself just demonstrated that "compile" and "build" are different, not the same. If I type "gcc -o helloworld helloworld.c", I have compiled (or caused a compiler to compile) a program from source code. No makefiles or other ephemera of automation required. Brent 21:36, 18 October 2005 (UTC)
Actually, by doing that, you will have done quite more than just compile. Compilation is done by the compiler; it is the step of taking the original source code and transforming it into object code. It is what would happen if you did "gcc -c -o helloworld.o helloworld.c". To transform this into an executable, one uses the linker; this will take the object code, link it with the appropriate libraries (for example, libc), and build the executable. Capi 19:41, 5 June 2006 (UTC)
Yes, they are, that nuance is not in contention. I said "compilation is largely synonymous with arduous build processes...applying it to the implicit generation of bytecode...is a stretch". What I am trying to convey is that neither compilation, building nor any process which significantly alters the representation of a program in order to have it be executed need be a mandatory step in the lifecycle of a computer program as experienced by a programmer. I apologize if that wasn't made clear. --Moe Aboulkheir —The preceding comment was added on 02:18, 6 December 2005.

[edit] First computer programmer

Defining the "first computer programmer" is impossible, as defining the first computer is a matter of entertaining (but essentially irresolvable) debate anyway. --Robert Merkel —The preceding comment was added on 19:19, 30 June 2002.

[edit] How can different parts of a program be in different languages

Different parts of a program may be written in different langauges. How come ??? Can you give Proper Explaination?

    --Phoe6 —The preceding comment was added on 22:58, 3 January 2003.
To give a simple example, it is generally believed to be easier to write some programs in, say, Perl than C++. However, a well-written C++ program can be much faster than a Perl program for some tasks. Therefore, what you can do is write the bits where performance doesn't matter in Perl, the performance-critical bits in C++, and combine the two. However, this is a little technical for the purposes of the main article. --Robert Merkel —The preceding comment was added on 06:40, 24 January 2003.

Very simply, subroutines to a high level language program can be written in assembler, assembled, and then linked into a main program's compilation link step to produce an executable. Suites of different languages from the same vendor are more likely to follow a compatible scheme in terms of stack protocol, global data, and runtime system library access to allow linking routines written in different languages for the same platform (Operating System, processor chip) in a single program's implementation.

[edit] Algorithms still exist

Algorithms have *not* gone away. Believe me, not everything is available in standard libraries (not even Java's). Maybe *your* programs are all print statements, but mine sure aren't. --Robert Merkel 06:40 Jan 24, 2003 (UTC)

[edit] Some sources for generalizations

Some sources for those first two sweeping generalizations at the bottom of the article would be great. "Most software developers come from NATO"? What the fuck does that even mean? "Most software developers come from the North Atlantic"? or "NATO delegates are far more numerous than previously suspected, and it is thought they may actually comprise the majority of the world's software developers". The Demographics "gamasutra" link at the bottom of the article doesn't mention either of those statistics. Moe Aboulkheir 12:18, 7 February 2006 (UTC)

Don't forget "[...] while most crackers and software disassemblers come from Asia.". I'm not sure whether this is deliberate vandalism or not, but it definitely doesn't sound either neutral or factual to me. I'm removing it for now: if anyone feels that it (or a modified version) does belong in the article, please argue for it here (with sources, if possible). --Piet Delport 14:02, 7 February 2006 (UTC)

[edit] HTML/Javascript image not programming

Is it a good idea to have an image of HTML/Javascript in an article about programming? HTML is scripting and I think there should be a more accurate picture for this article. Maybe some history would be good to... anyone? MichaelBillington 06:27, 1 April 2006 (UTC)

In the page, there is a html screenshot. But Html is not a computer programming! It's a markup language! —The preceding unsigned comment was added by 200.242.12.134 (talk • contribs) 20:01, 22 April 2006.

Maybe my above comment needed some more context. There was a picture in the article which I believed was irrelevant, so I posted my thoughts here and someone removed it. Whoever that was, thanks! MichaelBillington 07:30, 16 June 2006 (UTC)

[edit] C++ is very fast?

"C++ is a very fast programming language, meaning programs written in C++ tend to run at high framerates (which is important for games)."

This is an overgeneralization at best (and really, it's more like flat out misinformation). C++ is well-suited for making fast programs, but the language itself doesn't give the programs their speed. Surely C and assembly language could be called just as fast as (if not faster than) C++. So, I'm removing that tidbit from the article. –Tifego(t) 09:40, 15 April 2006 (UTC)

Not to mention that the concept of 'framerate' cannot be applied to programs in general in any meaningful way. Denis Kasak 12:01, 16 June 2006 (UTC)
Framerate is really only relevant when talking about film/video or similar applications. It could be applied to games but screen refresh rate would be more meaningful. Screen refresh rate has much more to do with the graphics hard/firmware in the user's machine than with the programming language the application was written in (a fast program on a machine with slow graphics hardware will have a slow screen refresh rate. Indeed it doesn't seem meaningful to refer to any language as fast or slow. Programs written in interpreted languages will generally run slower than compiled because of the need to interpret the human readable code (be it plain text such as a scripting language or tokenised such as Java or many BASICs) at run time. There is no inherant reason for a C++ program to be faster or slower than one written in C or Assembly language, or even a compiled BASIC, all other things being equal. The choice of laguage to develop a product is usually driven by the availability of the laguage for the target platform, the availability of developers for that language of sufficient skill level and the ease in which the required product can be developed in that langauge (some languages lend themselves to certain types of project better than others).
Also, my understanding is that games are mostly developed in 4GL environments where the programmer essentially describes the appearence and behaviour of an object. That description is then interpreted by the environment and fed into a game engine, the same game engine may be common to many games, it's just the objects that differ. Stephenbooth uk 14:52, 2 October 2006 (UTC)
And what are the game engines written in? C/C++! sure the game logic which doesn't need to be as fast may be written in a bytecode based or even fully interpreted language
With a good programmer relatively low level languages like C and C++ that let the programmer decide how best to handle issues like memory management are liable to be faster than languages like java that force your hand on memory allocation. Conventional languages are also more predictable (e.g. because of the way java optimises two bits of code can both be fast when tested in isolation but slow down considerablly when loaded in the same jvm) Plugwash 17:36, 16 November 2006 (UTC)


I Use C++ on a daily basis, and I have written games using it. The main reason games programmers prefer C++ is speed, and particularly languages like C# or Java do not run with a speed which is anything like comparable in a gaming environment. C++ is usually chosen over C on the basis of the simplicity of Object orientation. Philcluff (talk) 18:15, 15 February 2008 (UTC)
Java is slower because it is an interpreted byte code language that the JVM has to parse and convert to the object code that is run, this is to give it the cross-platform portable capability as object code for one processor will not run run on another processor and different operating systems have different system calls. The compiler also cannot optimise the code as different platforms would require different optimisations and code optimised for one may run very slowly on another. Whilst languages like C++ (which produce the object code at compile time and usually optimise for the target platform) are available on a number of different platforms programs compiled to run on one cannot run on another. So you could not, for example, compile a C++ program for Windows and run it natively under Linux, Solaris or AIX (even the x86 versions), you could use a product like Wine or CrossoverOffice but that would give you a performance hit. You could, if you so wished, probably write a C++ Virtual Machine that would interpret raw C++ source code and run it, in which case it would probably run at a comparable speed to most BASICs. You could also, if you so wished, probably write a Java to Object Code compiler that would take Java source code and produce platform specific object code, in which case it would probably run at a comparable speed to any of the other languages that are compiled to object code.
Speed of execution depends on factors such as whether to code is compiled to platform specific optimised object code or to interpreted cross platform portable code and the efficiency of the underlying library code (when you type 'x++' how efficient in the object code the compiler substitutes to actually do that task, this can vary from compiler to compiler for compiled languages and from virtual machine to virtual machine for interpreted languages). There is no objective reason why object code produced from C++ source should be faster than the same object code produced fro source in another language. --Stephenbooth uk (talk) 16:36, 2 April 2008 (UTC)
Your characterization of Java was true for earlier versions but is no longer true. Just-in-time compilation is used to convert Java byte codes to machine specific code on an as called for basis. Because optimization is done at runtime based upon the actual conditions that the JIT compiler sees (rather that at compile time) the resulting code is usually at least comparable (and sometimes better) than what a C++ compiler would produce. Memory management is probably the one area where Java is at a disadvantage to C++. Dfmclean (talk) 19:50, 2 April 2008 (UTC)
So whenever a Java application is run the first time a class is instantiated (or maybe the first time a particular method is called) the byte code is compiled and the object code cached. There's still a performance hit the first time a piece of code is called as the JIT compiler does it's work.
This is rather getting off the point that compiled to object code applications will be faster than interpreted applications, regardless of the specific language used to produce them, all other things being equal. Specific compilers may produce more or less efficient code than other compilers so the same C++ source compiled in one C++ compiler may be slower if compiled in another C++ compiler. The same Java byte code may run faster in one JVM than in another, I remember some years ago Oracle changed the JVM they shipped with the Windows version of their software because they found one that was significantly faster and due to issues with the JIT compiler failing on some hardware (problems with certain sorts of memory) with the one they had been using. --Stephenbooth uk (talk) 13:12, 3 April 2008 (UTC)
The problem is that "all other things" are never equal. The hit that a JIT compiler takes producing object code can be made up on subsequent uses of that code. What can be optimized, how it is optimized and how the optimization affects overall performance is now so complicated that for any mature language the quality of the code and choice of and implementation of algorithms have a much larger affect on performance than the choice of language. Add in the performance of modern CPUs and language performance becomes even less important for 99.9% of all applications. Dfmclean (talk) 14:39, 3 April 2008 (UTC)

[edit] Too many "examples"

It looks like people are simply adding their pet language to the "Examples of Programming Languages" list. Even though I thought the poorly-worded entry for VB was rather appropriate, some sort of limit has to be put on what should be in the list. Prune it down and add a comment into the source. Imroy 16:31, 26 April 2006 (UTC)

Done - Centrx 20:47, 24 May 2006 (UTC)
I think a guiding principle would be if the langauge has a Wikipedia page. If someone has gone to the trouble of writing a page then it's probably relvant enough to be an example. Comments? --Stephenbooth uk 16:16, 8 October 2006 (UTC)
Well, there's articles about a lot of non-major languages (until recently we had a whole lot of esoteric languages even), but if somebody adds a languge with no article, instant removal is the way to go, otherwise, think, then remove and/or discuss accordingly. How does that sound? Michael Billington (talkcontribs) 12:33, 13 October 2006 (UTC)

[edit] The history section

I know I did write most of it, but it really does suck. Does anybody with better writing skills than me want to have a go at structuring some sentences? Michael Billington (talkcontribs) 12:09, 8 August 2006 (UTC)

[edit] Introduction

I'm new here and wanted to make sure no one would mind a little clean up. I noticed in the introduction that the first sentence reads:

Computer programming (often simply programming or coding) is the craft of writing a set of commands or instructions that can later be compiled and/or interpreted and then inherently transformed to an executable that an electronic machine can execute or "run".

I just thought it might sound better this way:

Computer programming (often simply programming or coding) is the craft of writing a set of commands or instructions that can later be compiled and/or interpreted and then inherently transformed into a package that can be executed or run.

Executable that can be executed just sounds repetitive. I'm also wondering about the word "craft." --PTR 02:20, 30 September 2006 (UTC)

[edit] Ruby

This article says Ruby is like Python, but the Ruby article says otherwise. I don't know enough about Ruby to correct this.--agr 04:16, 13 October 2006 (UTC)

Ruby is very like Python. 80.5.240.253 20:47, 11 April 2007 (UTC)

[edit] A bit more clarity

From "modern programming" down things get a little hard to understand for the average dunce like myself. Maybe some more nouns, verbs, and adjectives might help: a spoonful of sugar helps the medicine go down Josephbsullivan 08:03, 28 February 2007 (UTC)

[edit] Boolean Programming Method

I recently came across two orphan articles under the same name (Boolean programming method and Boolean Programming Method) that have different content, which seems contradictory. Does anyone know which of these is correct or if both are correct? Squids'and'Chips 00:09, 8 March 2007 (UTC)

Google comes up with very few hits for the phrase. I am going to propose deletion for both of them nominate both of them for deletion. Tualha (Talk) 13:48, 15 July 2007 (UTC)

[edit] Missing Content?

Is there any particular reason why the section of modern programming/methodologies contains no reference to the agile/traditional and iterative/turnkey development approaches and debate? Dfmclean 17:18, 26 March 2007 (UTC)

[edit] POLICY DEBATE: Use of source code and other examples in articles

I have opened a debate on the use of examples in Wikipedia articles (mainly focusing on computer source code and mathematical formulas, proofs, etc.). It seems to me that many examples currently in Wikipedia violate Wikipedia policy, so I believe we need to either clarify or change the situation. Depending on the result of the discussion, this may result in a number of examples being summarily removed from articles!

Please reply there, not here, if you wish to contribute.—greenrd 11:24, 18 May 2007 (UTC)

[edit] Programmers

It bothers me that Bill Gates and other software corporate heads are described as "programmers" and sometimes even "hackers". While these guys may have started out their careers as programmers, they are now businessmen, earning their income by running a corporation, and not by programming. It's not fair to call them "programmers", since that's no longer what they do for a living. (When was the last time Gates ever wrote a substantial program, do you think?) Perhaps "former programmer" is a better description. — Loadmaster 15:03, 21 May 2007 (UTC)

Bill Gates hasn't written any code since 1988. Complex-Algorithm

Yes indeed, this is QUITE precise. —Preceding unsigned comment added by 24.141.150.148 (talk) 23:46, 25 November 2007 (UTC)

[edit] Directly storing ... machine code ... into memory?

This sentence bothers me: "In some specialist applications or extreme situations a program may be written or modified (known as patching) by directly storing the numeric values of the machine code instructions to be executed into memory." What is this referring to? Should it be in the lead? Timhowardriley (talk) 22:50, 25 January 2008 (UTC)

It ought to be mentioned somewhere. It is too obscure to be in the lead.Derek farn (talk) 01:04, 26 January 2008 (UTC)

[edit] What is programming?

I partly disagree with such definition of programming.

Computer programming (often shortened to programming or coding) is the process of writing, testing, debugging/troubleshooting, and maintaining the source code of computer programs.

This is very narrow definition. Is may be acceptable for "coding". (BTW is coding and programming the same?) Programming is much wider

Here is definition from Electronic Computer PROGRAMMING MANUAL

Programming is planning how to solve a problem. No matter what method is used - pencil and paper, slide rule, adding machine, or computer - problem solving requires programming. Of course, how one programs depends on the device one uses in problem solving.

Source: What Is Programming?


Sorry 4 my English Vanuan (talk) 21:50, 3 June 2008 (UTC)

Take note that this article is called 'Computer programming' which refers to programming a computer, which is indeed the mentioned process of creating/testing source code. I think your given definition mainly refers to inventing an algorithm for solving a task. This is very related to computer programming but it's a seperate (though often interwoven) activity. For example, the Euclidean algorithm was invented way before computers existed. Euclid invented an algorithm for solving a task but he wasn't programming a device to solve the task for him. He could solve a problem by executing the algorithm by hand but I wouldn't call that programming. - Simeon (talk) 11:02, 4 June 2008 (UTC)