Hot answers tagged

519

It's running 2.5 million lines of C on a RAD750 processor manufactured by BAE. The JPL has a bit more information but I do suspect many of the details are not publicized. It does appear that the testing scripts were written in Python. The underlying operating system is Wind River's VxWorks RTOS. The RTOS in question can be programmed in C, C++, Ada or Java....


177

The code is based on that of MER (Spirit and Opportunity), which were based off of their first lander, MPF (Sojourner). It's 3.5 million lines of C (much of it autogenerated), running on an RA50 processor manufactured by BAE and the VxWorks operating system. Over a million lines were hand coded. The code is implemented as 150 separate modules, each ...


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 ...


147

The problem is that #1 requires you effectively parse and interpret the entirety of the SQL variant you're working against so you know if it is doing something it shouldn't. And keep that code up to date as you update your database. Everywhere you accept input for your queries. And not screw it up. So yes, that sort of thing would stop SQL injection attacks,...


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 "...


139

OOP did not invent encapsulation and is not synonymous with encapsulation. Many OOP languages do not have C++/Java style access modifiers. Many non-OOP languages have various techniques available to offer encapsulation. One classic approach for encapsulation is closures, as used in functional programming. This is significantly older than OOP but is in a way ...


116

It has appeared earlier. In fact, this was the original model of getting access to computing resources back in the 1950s till well into the 1980s, when it was called "time sharing", then in the early 1990s it re-appeared under the name "Client/Server", then in the late 1990s again under the name "Thin Client", then "Application Service Provider". However, ...


116

In short, there aren’t any particularly useful subtraction-like operations on strings that people have wanted to write algorithms with. The + operator generally denotes the operation of an additive monoid, that is, an associative operation with an identity element: A + (B + C) = (A + B) + C A + 0 = 0 + A = A It makes sense to use this operator for things ...


115

Because immutable collections absolutely require sharing to be usable. Otherwise, every single operation drops a whole other list into the heap somewhere. Languages that are entirely immutable, like Haskell, generate astonishing amounts of garbage without aggressive optimizations and sharing. Having collection that's only usable with <50 elements is not ...


109

As far as I understand, pipe is a system call which shares a piece of memory between two processes where one process writes and other reads from. Actually, there is no shared memory involved. The reader and writer are NOT sharing any part of their address space, and they are not using any explicit synchronization. The reading and writing processes are ...


103

As mouviciel and Emilio Garavaglia noted, the concept predates computing. However, the first instance of a software loop was the loop Ada Lovelace used to calculate Bernoulli numbers, as described in Note G of her translation of the Sketch of the Analytical Engine Invented by Charles Babbage, by L. F. Menabrea. The Analytical Engine's ability to loop is ...


103

0 is false because they’re both zero elements in common semirings. Even though they are distinct data types, it makes intuitive sense to convert between them because they belong to isomorphic algebraic structures. 0 is the identity for addition and zero for multiplication. This is true for integers and rationals, but not IEEE-754 floating-point numbers: 0.0 ...


98

Writing a compiler seems like a much harder problem than an interpreter. That might be true today, but I would argue that it was not the case some 60 years ago. A few reasons why: With an interpreter, you have to keep both it and the program in memory. In an age where 1kb of memory was a massive luxury, keeping the running memory footprint low was key. And ...


96

Pretty much all mature languages are defined by a specification, and compilers or interpreters attempt to follow the standard defined in that specification. But very rarely do they succeed, unless the standard is defined by the author of the language. You can find the C++ 2003 standard, the C# 4 specification, the Java 7 specification and many more online. ...


90

According to Wikipedia, Internet Protocol Version 5 was used by the Internet Stream Protocol, an experimental streaming protocol. The second version (of Internet Stream Protocol), known variously as ST-II or ST2, distinguishes its own packets with an Internet Protocol version number 5, although it was never known as IPv5. The Internet Stream ...


87

There's certainly a noticeable trend towards functional programming, or at least certain aspects of it. Some of the popular languages that at some point adopted anonymous functions are C++ (C++11), PHP (PHP 5.3.0), C# (C# v2.0), Delphi (since 2009), Objective C (blocks) while Java 8 will bring support for lambdas to the language . And there are popular ...


80

Because option 1 is not a solution. Screening and filtering means rejecting or removing invalid input. But any input might be valid. For example apostrophe is a valid character in the name "O'Malley". It just have to be encoded correctly before being used in SQL, which is what prepared statements does. After you added the note, it seems you are basically ...


79

In a sense he was right. The original (pre-spec) versions of HTML, HTTP and URL were designed by amateurs (not standards people). And there are aspects of the respective designs ... and the subsequent (original) specs ... that are (to put it politely) not as good as they could have been. For example: HTML did not separate structure/content from ...


79

A mutable collection is not a subtype of an immutable collection. Instead, mutable and immutable collections are sibling descendants of readable collections. Unfortunately, the concepts of "readable", "read-only", and "immutable" seem to get blurred together, even though they mean three different things. A readable collection base class or interface type ...


75

Because the math works. FALSE OR TRUE is TRUE, because 0 | 1 is 1. ... insert many other examples here. Traditionally, C programs have conditions like if (someFunctionReturningANumber()) rather than if (someFunctionReturningANumber() != 0) because the concept of zero being equivalent to false is well-understood.


71

In its most basic form, a website serves static files. Mapping the URL path to a file path is the most obvious choice; essentially, it's a read-only FTP site. Then people wanted to change the content of the page with some scripting. The easiest way is to embed a scripting language into the page and run it through an interpreter. Again, given the already ...


69

It isn't that the goto is bad by itself. (After all, every jump instruction in a computer is a goto.) The problem is that there is a human style of programming that pre-dates structured programming, what could be called "flow-chart" programming. In flow-chart programming (which people of my generation learned, and was used for the Apollo moon program) you ...


65

Sun Microsystems had back then a bad habit of going through numerous naming changes for its products, and to use confusing name to start with in the first place. What's in a Name, or what does "Java" Mean? Originally the term "Java" was being used to describe indiscriminately: the language, the platform, and some others happened to refer to the JVM and ...


65

Suppose we're designing a new language and we want Sqrt to be an instance method. So we look at the double class and begin designing. It obviously has no inputs (other than the instance) and returns a double. We write and test the code. Perfection. But taking the square root of an integer is valid, too, and we don't want to force everyone to convert to ...


64

Although there were older precursors, the influential French mathematician Rene Descartes is usually credited for introducing superscripted exponents (ab) into mathematical writing, in his work Geometrie which was published in 1637. This is the notation still universally used in mathematics today. Fortran is the oldest programming language widely used for ...


64

Why is goto dangerous? goto doesn't cause instability by itself. Despite about 100,000 gotos, the Linux kernel is still a model of stability. goto by itself should not cause security vulnerabilities. In some languages however, mixing it with try/catch exception management blocks could lead to vulnerabilities as explained in this CERT recommendation. ...


61

He actually elaborates on that very topic on the second page of the interview. It's not the technical shortcomings of the protocol he's lamenting, it's the vision of web browser designers. As he put it: You want it to be a mini-operating system, and the people who did the browser mistook it as an application. He gives some specific examples, like the ...


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