Skip to main content

Questions tagged [namespaces]

For many programming languages, namespace is a context for their identifiers. Use this tag to indicate concerns about appropriate usage of namespaces.

1 vote
0 answers
109 views

Marvelous Bash does not support built-in sufficient namespace features for functions or variables to specific file/module you would find in PHP or JavaScript. Conflicts in global scopes, which are ...
Serious Angel's user avatar
3 votes
2 answers
166 views

I'm writing firmware for my Arduino project, and I'm struggling with a clean, scalable hardware mapping structure. Initially, I had the following namespace: ...
Dead1nside's user avatar
3 votes
2 answers
372 views

Background I am working on a VBA paradigm for modifying the Excel environment from a UDF. I call this "sudo mode", and I leverage Application.Run() to ...
Greg's user avatar
  • 569
-1 votes
1 answer
133 views

This code was an answer to my own question on SO, however I am looking at the line global X and wondering if there is a better way to do this. I try to minimize the ...
Galen's user avatar
  • 157
5 votes
3 answers
887 views

Mainly looking for feedback on my use of smart pointers to implement a standard stack. For interview level production code I have also include a namespace and asserts to test my class, let me know if ...
greg's user avatar
  • 1,027
2 votes
0 answers
270 views

Not much formal education in programming. One year in school. We did C++ classes for most user defined objects. I've written a few different class variations for matrices but wonder about how useful ...
Chemistpp's user avatar
  • 227
2 votes
0 answers
66 views

You are given an array sorted in ascending order which is rotated at some pivot unknown to you beforehand. Find your target in \$O(log n)\$ which means it should be a binary search. If the value ...
Rick's user avatar
  • 586
5 votes
1 answer
408 views

I don't claim this is useful nor that it adheres to best practices. There's also no good reason the hack is a context manager, and it won't work on the interactive shell. ...
user avatar
9 votes
2 answers
2k views

In Python, we use __all__ to explicitly denote the public API of a module or package. That looks like this: ...
Aaron Hall's user avatar
  • 1,568
3 votes
2 answers
281 views

I have been coding in a certain style for some time now, where I try to avoid classes and stick to pure data structures whenever possible. Basically every module of my program has its own namespace in ...
simulate's user avatar
  • 195
3 votes
2 answers
248 views

I have a big SQL request where I compute dates or counts (from other tables), and I have to compute new dates based on conditions on those pre-computed dates and counts. In the following example, I ...
user3341592's user avatar
3 votes
6 answers
4k views

I have been told that using namespace std is a bad practice (especially in header files). But wouldn't this make the program less readable? ...
CaptainDaVinci's user avatar
9 votes
2 answers
3k views

This seems to work fine, but I'm very new to C++ and would like any suggestions for improvements. Areas I have the most trouble with are: Namespacing (honestly, it's still half looking stuff up and ...
Bill Harper's user avatar
10 votes
2 answers
361 views

I was given an assignment to write a mini-shell: To write your own shell, you will need to start with a C program that will prompt the user for input and accept in a number of arguments from a ...
syb0rg's user avatar
  • 21.9k
1 vote
2 answers
71 views

I have written a wrapper for my code that allows basic namespacing and I'd like some feedback on how it can be improved. It is designed so that a module can define it's namespace and get access to ...
Jack Wilsdon's user avatar
  • 1,661

15 30 50 per page