New answers tagged

0 votes

Design Pattern: How to handle changing format of text file?

I would split the task into two parts: Parsing the file. It looks reasonably simple to write code to parse this text file into a python dictionary. And, from what I can see in your examples, this ...
  • 8,458
1 vote

Am I making this web app right?

This sounds like a great first project - lots of variety, and focused around a subject that interests you. A few things I'd recommend: Break down the requirements Since your project involves so many ...
0 votes

Where to create repository instances?

CLI or API both are likely to have an entry point. The so-called Main or Application. Sometimes, it's a class and sometimes is a function. In some programming languages is a mix of both. In any case, ...
  • 11.9k
5 votes

How do non-RAII languages free resources during stack unwinding?

In Java, the finally clause of a try statement is invoked as the stack unwinds, allowing the programmer to explicitly release resources that require this. For instance, early Java code to write to a ...
  • 3,854
7 votes

How do non-RAII languages free resources during stack unwinding?

Answering only of Java here, though other languages often have equivalents. First, I'd note that Java doesn't really have destructors... while it does support a finalize() method that kind of ...
43 votes
Accepted

How do non-RAII languages free resources during stack unwinding?

Both of the programming languages you mention (as well as many other programming languages) provide Automatic Memory Management. What this means is that the programming language is responsible for ...
19 votes

How do non-RAII languages free resources during stack unwinding?

In garbage collected languages (whether mark-and-sweep style like the JVM or reference counted like Python), there are generally two types of resource: Managed resources, which are handled directly ...

Top 50 recent answers are included