249

For languages that use first-class functions, its quite common that the syntax of referring to a function is: a = object.functionName while the act of calling that function is: b = object.functionName() a in the above example would be reference to the above function (and you could call it by doing a()), while b would contain the return value of the ...


238

The Java Language I believe all these answers are missing the point by trying to ascribe intent to the way Java works. Java's verbosity does not stem from it being object oriented, as Python and many other languages are too yet have terser syntax. Java's verbosity doesn't come from its support of access modifiers either. Instead, it's simply how Java was ...


237

Copy-paste blindly: bad. Look up documentation, read code examples to get a better understanding: good. I'd rather work with someone who looks up things all the time and makes sure everything works as intended than someone over-confident who thinks he knows it all but doesn't. But the worst is someone who doesn't bother understanding how things work, and ...


234

Reverse engineering can become very hard, even more if you do not just want to understand the program's logic, but change and recompile it. So first thing I would try is to look for a different solution. I want to modify the columns, spacing format and add VBA logic etc. on the Excel spreadsheet If that is the only thing you want, and the calculation ...


211

No. OCaml, Haskell, Lisp dialects like Scheme, and several other languages are often used in the development of hobby languages. Many languages are implemented in C because it's a ubiquitous language, and compiler-writing tools like lexer-parser generators (such as yacc and bison) are well-understood and almost as ubiquitous. But C itself couldn't ...


168

I have to answer, "All of the above." People argue about whether coding is an art, a craft, an engineering discipline, or a branch of mathematics, and I think it's fairest to say it's some of each. As such, the more techniques you bring to mastery of the language, the better. Here is a partial list: Use the language all day, every day. Usually this ...


160

I can't seem to understand the reason as to why multiple programming languages are used in the same product or software? It is quite simple: there is no single programming language suitable for all needs and goals. Read Michael L. Scott's book Programming Language Pragmatics Some programming languages favor expressiveness and declarativity (a lot of ...


158

Avionics For aircraft control systems, we don't speak of operating systems but of avionics, integrated avionics or computer airborne systems in general. And they are actually a combination of a multitude of independent or inter-dependent systems, for different functions (flight control, collision avoidance, weather, communications, blackboxes...). Each ...


157

There needs to be some way of telling where the condition ends and the branch begins. There are many different ways of doing that. In some languages, there are no conditionals at all, e.g. in Smalltalk, Self, Newspeak, Io, Ioke, Seph, and Fancy. Conditional branching is simply implemented as a normal method like any other method. The method is implemented ...


157

This depends on your definition of high-level and low-level language. When C was developed, anything that was higher-level than assembly was considered a high-level language. That is a low bar to clear. Later, this terminology shifted to the point that some would nowadays consider even Java to be a low-level language. Even within the high-level language ...


156

Because there is a a difference between "This function can succeed or fail and is self-aware enough that it can tell the difference" and "There is no feedback about the effect of this function." Without void, you'd endlessly check success codes and believe that you are writing robust software, when in fact you are doing nothing of the sort.


143

To answer the historical aspects of the question: The design philosophy is explained in The C Programming Language written by Brian Kernighan and C designer Dennis Ritchie, the "K&R" you may have heard of. The preface to the first edition says C is not a "very high level" language, nor a "big" one... and the introduction says C is a relatively "...


136

There are two diametrically opposed schools of thought in programming language design. One is that programmers write better code with fewer restrictions, and the other is that they write better code with more restrictions. In my opinion, the reality is that good experienced programmers flourish with fewer restrictions, but that restrictions can benefit the ...


119

Because arrays teach concepts like indexing and bounds, two fundamentally important concepts in computer programming. Lists are not a "standard." There is a wide variety of problem spaces for which arrays are a perfect fit.


113

In addition to the already given answers by Doc Brown and Telastyn, I would like to suggest an alternative approach (under the assumption it's mission critical). If you do not know the computations it performs and the calculations are (somewhat) mission-critical: Deduce the original logic in the .exe file by any means necessary. Decode it using a decompiler/...


110

If you code your solutions in a maintainable way and actually UNDERSTAND what you copy/paste/modify then there is no problem. I die inside every time I ask a senior developer questions about why he did what and the answer is "I don't know, I copy pasted the code and it worked at that given time".


110

No, an object does not have to represent an entity. In fact, I would argue that when you stop thinking about objects as physical entities is when you finally get the benefits that OOP promises. This isn't the best example, but the Coffee Maker design is probably where the light started to come on for me. Objects are about messages. They're about ...


109

No. In general, the performance of a language implementation is primarily dependent on the amount of money, resources, manpower, research, engineering, and development spent on it. And specifically, the performance of a particular program is primarily dependent on the amount of thought put into its algorithms. There are some very fast interpreters out ...


105

Nope. They're really handy for implementing Observers and making sure that classes are closed to modification. Let's say we have a method that registers new users. public void Register(user) { db.Save(user); } Then someone decides that an email should be sent. We could do this: public void Register(user) { db.Save(user); emailClient.Send(...


103

Operators are just functions under funny names, with some special syntax around. In many languages, as varied as C++ and Python, you can redefine operators by overriding special methods of your class. Then standard operators (e.g. +) work according to the logic you supply (e.g. concatenating strings or adding matrices or whatever). Since such operator-...


103

Basically because the designers of Java and similar languages didn't want undefined behavior in their language. This was a trade off - allowing undefined behavior has the potential to improve performance, but the language designers prioritized safety and predictability higher. For example, if you allocate an array in C, the data is undefined. In Java, all ...


101

Consider the following. var [Example Number] = 5; [Example Number] = [Example Number] + 5; print([Example Number]); int[] [Examples Array] = new int[25]; [Examples Array][[Example Number]] = [Example Number] Compare it with the more traditional example: var ExampleNumber = 5; ExampleNumber = ExampleNumber + 5; print(ExampleNumber); int[] ...


98

I would strongly advise against #1, because just ignoring errors is a dangerous anti-pattern. It can lead to hard-to-analyze bugs. Setting the result of a division by zero to 0 makes no sense whatsoever, and continuing program execution with a nonsensical value is going to cause trouble. Especially when the program is running unattended. When the program ...


96

Don't worry about meeting some ridiculous concept of "skill" so commonly heard in such statements like: All programming languages are basically the same. Once you pick up one language well you can pick up any other language quickly and easily. Languages are just tools, there's some overarching brain-magic that actually makes the software. These statements ...


94

Because C has a void type, and Java was designed to follow many of the conventions of the C language family. There are many functions that you don't want to have return a value. What are you going to do with "a generic Success type" anyway? In fact, return values to indicate success are even less important in Java than in C, because Java has exceptions to ...


91

Is each and every language written in C language? A language is a set of abstract mathematical rules and restrictions ("if I write this, that happens"). It isn't written in anything, really. It is specified, usually in a mixture of a formalized subset of English, mathematical notation, and maybe some specialized specification language. The syntax is often ...


90

I guess it's just consistency, or "principle of least astonishment". String is an object, so it would be surprising if was treated differently than other objects. At the time when Java came out (~1995), merely having something like String was total luxury to most programmers who were accustomed to representing strings as null-terminated arrays. String's ...


Only top voted, non community-wiki answers of a minimum length are eligible