7 votes
Accepted

Should I use Lua for writing config files?

The needs for any language that you use for configuration files are the same, regardless of whether it is a programming language or not: The people who use it can do so reasonably effectively. If ...
Nicol Bolas's user avatar
  • 11.9k
5 votes
Accepted

Implicit/Explicit Assertions

This seems primarily opinion based, but I'd suggest option 3: function doStuff3(stuffType,...) local stuffCallback = assert(stuffLookup[stuffType], "stuffType is not a valid stuff!") ...
Kevin Fee's user avatar
  • 2,837
4 votes

Should I use Lua for writing config files?

Using a programming language for a configuration file is reasonable if the following cases are met: The software is open source (so there's no worry about users doing introspection to get at its ...
walpen's user avatar
  • 3,231
3 votes
Accepted

Is it better to accept a dictionary/table or arguments in a function?

Lua uses positional parameter passing. So there isn't a 'natural' way to pass named arguments. You can simulate them by turning this: --invalid code rename(old="temp.lua", new="temp1.lua") into ...
candied_orange's user avatar
2 votes

Criteria for a language (Terra as a tricky example) to be usable for operating system development, and how to meet missing criteria

Er, it depends. Operating Systems can be written in any language. JavaOS was written almost entirely in Java as a bet, ran slowly, and then had to be sold as a product. Most requirements, like ...
Charles Merriam's user avatar
2 votes

Criteria for a language (Terra as a tricky example) to be usable for operating system development, and how to meet missing criteria

First, you need to understand and define precisely what exactly is an operating system. And the definition is not that simple, and is ambiguous in the details. I suggest to spend days to read ...
Basile Starynkevitch's user avatar
1 vote

Assigning variables as lines of code

Yes, you can use method references and lambda expressions. Consumer<String> print1 = System.out::println; print1.accept("hello"); //prints hello Consumer<String> print2 = s -> System....
Spotted's user avatar
  • 1,690
1 vote

Would using coroutines improve my code?

Having one routine/thread feed another and wait for it to finish is pretty pointless, that is just a complicated way to do things synchronously/sequentially. What you can do in your case is put ...
Martin Maat's user avatar
  • 18.4k
1 vote

Why do we need "callback functions"?

Stumbled upon this and wanted to provide a more up to date answer... Callback functions allow us to do something with data at a later time, allowing the rest of our code to run, instead of waiting ...
NRV's user avatar
  • 121

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