Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.

Questions tagged [programming-languages]

Artificial languages for instructing computers to do steps of computation in order to complete tasks. They allow programmers to communicate with computers.

Filter by
Sorted by
Tagged with
2 votes
5 answers
1k views

This is basically a continuation of "Why don't languages auto import everything?" but with a slightly altered premisse: Say we have a language like C++ / python that uses namespaces to ...
glades's user avatar
  • 493
12 votes
7 answers
5k views

I'm quite confused about the concept of mutability (or mutation?), especially across different languages. In a language like Python: x = 10 x = 20 I believe this is called shadowing (or rebinding) ...
Ghassen's user avatar
  • 185
35 votes
11 answers
13k views

As developers, we often face the challenge of balancing meaningful variable names with code readability. Long, descriptive names can make code harder to read, while short names may lack context. For ...
Shardul Vikram Singh's user avatar
0 votes
3 answers
368 views

Having fewer lines of code per feature is typically better as it increases the developer productivity. Did anyone ever measure the number of code lines executions per line of code across multiple ...
Sebastian Wagner's user avatar
3 votes
5 answers
1k views

In C#, strings can be used like objects with methods, properties, and other features of objects. At the same time, strings are treated the same as primitive data types like int or float in numerous ...
Bunabyte's user avatar
  • 643
-3 votes
1 answer
173 views

I am designing my next project, which will do various domain-specific tasks, but all that will be controlled and used via a generic crud web app. I have been professionally using Java with Spring for ...
rafal.sz's user avatar
1 vote
1 answer
723 views

I'm writing my own dynamic programming language. So far I've been using a tagged union for all values. Since this boxes primitive types needlessly, I've begun researching tagged pointers which seem to ...
Matheus Moreira's user avatar
0 votes
1 answer
594 views

I've just accidentally came across this answer about inlined functions and I'd like to know how this affects call stack. But I can't add comments because I don't have enough rep so I decided to ask ...
b3rry's user avatar
  • 3
0 votes
1 answer
186 views

I am thinking about how to build a language VM. I have been able to get some of the basic constructs right, including jumps to functions within the chunk of bytecode that is currently loaded. But now ...
mydoghasworms's user avatar
4 votes
1 answer
360 views

I'm reading the book The Secret Life of Programs by Jonathan E. Steinhart. In it, he mentions in passing: many consider the handling of whitespace in Ruby to be a replay of of a mistake in the ...
tsvallender's user avatar
0 votes
2 answers
318 views

In C and C++ we need to declare a function before its usage, if its definition comes after where it is called. (Well, there is also the "implicit declaration" rule in C, but it is rarely ...
Ma Joad's user avatar
  • 101
4 votes
3 answers
1k views

I was reading the excellent book by Axel Raushmayer, Tackling TypeScript. In this section of Chapter 7, the author makes the interesting claim In many programming languages, null is part of all ...
Ray Toal's user avatar
  • 1,325
0 votes
2 answers
771 views

There are many packages for creating bindings of a library that's written in one language to be called from another language. Some programming languages also include such interop in the standard ...
danijar's user avatar
  • 846
1 vote
1 answer
711 views

PHP have what it calls "traits" which despite the name is not like traits in Rust, Scala or other languages. In many other languages with support for traits, a trait create a is-a relation. ...
Fred's user avatar
  • 509
1 vote
5 answers
845 views

Why is there a such thing as import in programming languages? If a package does not exist, then trying to import it would cause an error anyway. So why don't languages just auto import ALL available ...
user1345541's user avatar
-1 votes
1 answer
188 views

For example, keywords have a special prefix. Objective-C has @interface, @implementation, but that's for compatibility with C. It inherits all the C keywords of course, with no @. How about a language ...
Eugene's user avatar
  • 117
0 votes
1 answer
252 views

I have seen information that at least one of reasons why type placed before variable name is that it allows compiler easier evaluate size and type of variable. If so then how (what way) it eases this ...
Ya Y's user avatar
  • 29
2 votes
5 answers
1k views

Many languages such as C or even C++ or C# or Java have no natively supported vector (SIMD) types or functionality. In such languages, one would have to either use non-standard extensions or third-...
CPlus's user avatar
  • 1,219
0 votes
1 answer
308 views

I'm maintaining a library written in C++, which offers modern-C++ bindings for another API that's C-ish (it's this one, although I'm trying to make this question somewhat more general). Now, when I ...
einpoklum's user avatar
  • 2,808
0 votes
1 answer
177 views

In the case of kotlin, rust and many other programming languages... There are variables with direct implicit type declarations... Where you can see the type of a variable at the same line where it's ...
user avatar
0 votes
1 answer
758 views

I created a simple parser in Rust and defined the AST like this: enum Expression { Number(i32), BinaryOperator(Box<Expression>, Operator, Box<Expression>), Identifier(String), }...
Iter Ator's user avatar
  • 111
3 votes
1 answer
330 views

Really dumb question. I really like the new feature called "optional chaining" in JavaScript, and it's used in quite a few places in my front end code. However, I am concerned that whoever ...
Rongeegee's user avatar
  • 167
0 votes
0 answers
713 views

The traditional (Scheme, Pascal) way to structure code is this: declare outer function declare inner function body of inner function body of outer function The where clause in Haskell moves ...
ceving's user avatar
  • 401
0 votes
2 answers
99 views

I came across Environment Diagrams,it is described below Whenever Python needs to work with an object, that object is stored in memory; and, additionally, Python also needs a way to associate names ...
Dennis's user avatar
  • 25
2 votes
2 answers
505 views

If we program to interfaces various parts of the implementation can be effectively hidden. We can define multiple interfaces for a single implementation and use them as needed, instead of 4 fixed ...
Ondrej Bozek's user avatar
8 votes
5 answers
10k views

I wrote some script in Python that creates a giant 2D matrix (1000x1000 or bigger) and fills it with random numbers. And after that, it goes through every element of the matrix and changes the number ...
devdevdove's user avatar
13 votes
8 answers
6k views

I'm recently learning the programming language, and I wonder how compilers work when the language itself does not allow recursion, like how the compiler or the runtime checkers makes sure that there ...
csxyyyyy's user avatar
  • 151
-3 votes
1 answer
237 views

Is there any common wisdom for managing a software project in an unfamiliar programming language? Most software projects go for safety and use some mainstream language but some opt for a niche ...
Gergely's user avatar
  • 131
-2 votes
4 answers
274 views

Programming languages traditionally have blocks that specifically cater to controlling iteration. There is the simple while-loop: while (i < 3) {...}; Then there is the more complicated for-loop: ...
Steve's user avatar
  • 12.6k
4 votes
2 answers
2k views

A seemingly basic question here. Is there anything you can do with multidimensional arrays that you can't do with nested arrays? Many languages have been designed with both facilities and syntactical ...
Steve's user avatar
  • 12.6k
2 votes
4 answers
918 views

Is it possible in theory to have a programming language that allows for object lifetimes that exist beyond the current scope but without using heap? As a little background, in embedded development it ...
Jeff's user avatar
  • 139
1 vote
2 answers
308 views

I see the term legacy signature a lot in the documentation of programming languages. For example in the php documentation : Passing the separator after the array (i.e. using the legacy signature) ...
Hicham Jerdaoui's user avatar
4 votes
3 answers
1k views

I've been trying to better understand (at least at a high level) why the early versions of HTML were designed the way they were. Most of the decisions make sense; I can deduce (at least at a high ...
Mathew Alden's user avatar
0 votes
0 answers
311 views

I want to build a code analysis tool for personal use when programming in kdb/q. In order to do this, I need to be able to parse q code into an AST. I have never written a parser before. ANTLR4 seems ...
Chechy Levas's user avatar
1 vote
5 answers
2k views

Short Version If we had an application based on a state machine - transitioning between states to run the application: is repetition, and in fact the entire state machine, based on the presence of an ...
Ian Boyd's user avatar
  • 25.1k
4 votes
2 answers
429 views

Assume you have a small set of suitable programming languages (e.g., Python, C++, Julia), a clearly defined task (development of software services in the context of computational sciences), and a team ...
Unis's user avatar
  • 175
0 votes
1 answer
308 views

I don't know if this is the right place to ask more of a "philosophical" question. The more I code in Java, the more I have to bear with Comparable<T>. And the more I bear with this ...
Thomas Herondale's user avatar
-1 votes
2 answers
296 views

I've noticed that most AST tree implementations use classes for nodes instead of something like a vector. I want to ask, why do most people use classes? Are there issues to using vectors to make AST ...
StandingPad Animations's user avatar
1 vote
2 answers
1k views

Many programming languages have an implementation language (mostly a system language like C) which is used to implement important parts of the core of the language. Besides the libraries are written ...
Student's user avatar
  • 133
0 votes
2 answers
405 views

So I'm trying to write a interpreter with a lexer. Currently, it adds a token line by line and does some more processing later on. But when I look at sources online, they all seem to go word by word ...
StandingPad Animations's user avatar
3 votes
2 answers
847 views

Given the abstract syntax tree (AST) of each line of a function's code, I am asked to generate code for that function's corresponding unit tests, similar to what Microsoft's IntelliTest tool does here:...
David Johnson's user avatar
0 votes
3 answers
982 views

Logically, not based on how cost we will spend or how much we will hire programmers to do it. Can we (Is it possible to) make a compiler for any dynamic/script/interpreter language, like Lua, Python, ...
Zaher Dirkey's user avatar
2 votes
1 answer
186 views

Does there exist some language whose execution model is implemented as a neuron network, or maybe as some other type of a network/grid (e.g. network of finite automata)? That is, specifically, without ...
Al Berger's user avatar
  • 279
2 votes
1 answer
147 views

I am implementing anonymous functions (lambdas) in a scripting language that supports hot reloading. The language currently supports passing user defined functions (pointers) to plugin functions which ...
korri123's user avatar
  • 141
8 votes
2 answers
2k views

I'm very interested in the topic of parsers, especially in the topic of parser combinators like Superpower. The problem with them is that the grammars that they can work with are a bit limited. For ...
SuperJMN's user avatar
  • 453
3 votes
4 answers
1k views

I have noticed that JavaScript and PHP and Python do not support function overloading. Do all dynamically typed languages not support function overloading? If the answer is yes, then why is that?
William's user avatar
  • 65
-2 votes
1 answer
173 views

My project is about an automatic HTML documentation generator. The final product can't be in C# because of some organizational and legal constraints. To my experience, Python is harder to debug than C#...
user366312's user avatar
0 votes
2 answers
172 views

I am tasked with making a program that will roughly have the same steps as a program that a former has written. The program that I'm trying to imitate doesn't seem to be open for extension, otherwise ...
lukaabra's user avatar
0 votes
1 answer
396 views

I am trying to build a static program analyzer for a proprietary progamming language for a school project, and am currently trying to implement the parser from scratch. I was wondering, what are the ...
Meowmi's user avatar
  • 101
13 votes
4 answers
3k views

In my experience, all languages I know have a sort of "positive" type system. What I mean by "positive type system" is that when you are writing the source code, you always specify ...
user avatar

1
2 3 4 5
29