14

Exact syntax matters less than you might think. In an interview, you can say something like: I don't remember in this language if a set.add returns a boolean indicating if the item was already in the set or not. It doesn't really matter for this problem because it's easily looked up, but assuming it does return that indication, this is how I would write it.....


7

JavaScript was originally used for tiny things. Often, your entire script would be inlined in your HTML onclick attribute. A large use of JavaScript would be two or three functions in the HTML header. I remember thinking why would anyone ever want to use the ability to put a script in a separate file. It makes zero sense to precompile something that small. ...


6

The best is to write the actual code in C or C++, and then to just create interfaces for any other languages so that for example a python developer can use the library in their python code without ever knowing the actual language. Writing the implementation in multiple languages is a waste of time. It increases the number of bugs. With cryptography it is ...


4

This is hard to answer in isolation. A lot depends on the overall design of your language and the goals you want to reach. To quote Bjarne Stroustrup quoting Dennis Ritchie: “There are two kinds of programming languages: The ones that want to solve a problem and the ones that want to prove a point.” Which of the two is yours? What problem do your future ...


3

Is it a good idea to implement the logic in one (Turing-complete) language, then call functions from all other languages? Or do I implement from scratch for each language? Generally yes. This is the usual way to do such thing. Implement all functions and algorithms in a language you choose for a core library only once (e.g. c or c++). The interfacing with ...


3

My question is, how on earth can I get past a whiteboard interview when my mind is so scrambled with so many languages? A whiteboard interview is not a syntax exam. It's an examination of your ability to break down a problem. You don't need to use a particular language for that. Pseudocode would apply equally here. If certain companies are using whiteboard ...


2

The problem is that const applied to the type of a variable means immutable (equivalent: readonly+no_mutable_references (C restrict pointers satisfy the latter)) in C++, but if you take a reference, it means readonly. If you add immutable to the type-system, you will no longer have to throw immutable and readonly together when passing it on, and knowing the ...


2

Tooling and ease of use. The way the web was done at the time was in a text editor. That is, JavaScript was not feed into a tool that would spit some binary format, because that is not how you develop for the web. Instead, if you develop for the web, you pick a text editor, any text editor, and you type. No special tool required. Well, we have minifier and ...


1

I don't know of a single term which exactly match your criteria. Your criteria seem rather arbitrary anyway since the condition in an if statement affect control flow, while a return value does not affect control flow (even though the return statement does). Also the "first line" criteria is a bit arbitrary. For example multiple languages have both ...


1

The premise of your question is wrong. An ahead-of-time compiled language was introduced in browsers at the same time as JavaScript. Netscape 2.0 was the first browser which supported JavaScript and it introduced support for Java Applets at the same time. But for various reasons Java applets fell out of use. JavaScript was specifically positioned at the time ...


1

There is no such thing as a "compiled language". Compilation is a property of the compiler (duh!), not the language. Therefore, the term "compiled language" is not even wrong, it is non-sensical. Which makes the answer to your question trivial: you cannot adopt something that doesn't exist. Some people define "compiled language" ...


1

I consider an heresy to create a function, class, or attribute type, since they wouldn't be at the same logic-level than data types. But if you are able to pass a function as an argument to another function, then a function is a data type at the same logical level as other data types. And then you have to be able to represent a function as a data type in ...


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