Skip to main content
22 events
when toggle format what by license comment
Sep 30 at 13:35 comment added Caleth @glades that isn't an educated guess. The language grammar is surprising to humans, but it is unambiguous. Wikipedia is in error to call it ambiguous, because there is a language rule disambiguating the situation.
Sep 29 at 18:48 answer added gnasher729 timeline score: -1
Sep 28 at 8:19 review Close votes
Oct 2 at 18:51
Sep 28 at 0:35 answer added Justin Time - Reinstate Monica timeline score: 4
Jan 21 at 6:28 vote accept glades
Jan 21 at 6:25 comment added glades @Flater "because the compiler refuses to make educated guesses". Well have you heard of the most vexing parse? Also there's quite a bit of guessing when looking at lsp's, for example clangd's "switch to header file" has a pretty heuristic approach. But you're right, in an ideal world everything is completely deterministic and programming languages should at least strive for that.
Jan 21 at 5:32 comment added Flater Even in your own example, you assert that the inference logic isn't ironclad, there is a 1% edge case. Time and time again, programming teaching you that logic requires you to be pedantically unambiguous about everything you mention, specifically because the logic/compiler refuses to make educated guesses. Your question is just another example of the same thing.
Jan 15 at 18:29 answer added JacquesB timeline score: 1
Jan 15 at 14:20 answer added Useless timeline score: 1
Jan 15 at 1:48 comment added STerliakov Does rust fit as an example? You can use some_crate::some_function directly without preceding use some_crate (and in fact use statements just bring the subname into scope). It doesn't have namespaces in c++ sense, but you said "like C++ / python", and python uses modules, which are quite different from c++ namespaces.
Jan 14 at 22:59 history became hot network question
Jan 14 at 20:34 comment added Basilevs This question is similar to: Why don't languages auto import everything?. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem.
Jan 14 at 20:33 history edited Basilevs CC BY-SA 4.0
Readable link
Jan 14 at 17:38 review Close votes
Jan 20 at 3:01
Jan 14 at 16:36 comment added JimmyJames "While C++ can't necessarily guarantee that there isn't a competing std::cout out there, a language designed with this in mind could potentially (hypothesis)." How do you prevent two independent developers (or teams) from creating the same names? I don't see a way for a programming language (alone) to prevent that.
Jan 14 at 15:36 comment added Craig It's easy enough with something obvious like cout, I'm not as sure that it's easy when you consider the entire family of things that may be pulled in by a simple-looking #include <iostream>, especially considering that (currently) the include is purely textual and performed by the pre-processor (so the existence of it is gone by the time the compiler takes a crack at it).
Jan 14 at 15:33 comment added Doc Brown @glades: in C++, Java or C# (and many other languages), you define library references by giving the compiler or linker the appropriate command line parameters. This is usually not done directly, but by utilizing the specific build system. Is this what you also want to spare?
Jan 14 at 15:31 answer added freakish timeline score: 8
Jan 14 at 15:28 comment added glades @DocBrown How would you do library referencing without import/includes? Generally I would like to spare the imports/includes, but dependencies within a requirements.txt I don't have a problem with.
Jan 14 at 15:25 comment added Doc Brown Your question is unclear. Do you only want to spare the imports/includes, or any kind of dependency definition / library referencing?
Jan 14 at 15:15 comment added Greg Burghardt @freakish: your comment sounds like the start to a good answer.
Jan 14 at 14:47 history asked glades CC BY-SA 4.0