-
Notifications
You must be signed in to change notification settings - Fork 464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor C++ namespace usage #1367
Conversation
4f4e294
to
ed8388d
Compare
I don't recall needing to add |
using std::endl; | ||
|
||
using std::unordered_map; | ||
using File::make_canonical_path; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can get rid of the File
namespace at all (if it makes making bindings more difficult...)? Also Util
then...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bindings are only in the C space, nothing from outside should interface with the C++ internals! There is no stable API on that side!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope it is not necessary, haven't tried swig for years...
Re git history: It got much more complicated with the file moves, so I wouldn't worry too much about it now. For example:
|
I mean mostly for ie. blame commands, since it changed a lot of existing lines. From looking at the commits, it looks like |
8ab9654
to
6951361
Compare
Resolved the nitpicks ... I'm pretty sure there are much more redundant header includes. But IMHO It is just not really worth the time to hunt them all down! |
It was meant to be part of a "lightweight drop-in" library :) and moved in from |
I have no specific feedback. I'm more interested in @saper's thoughts. |
👍 |
41d778c
to
ca1bc0f
Compare
Add new `sass.hpp` header for minimal std includes and exporting only specific symbols from std into our `Sass` namespace. Also removed some redundant includes!
ca1bc0f
to
cf950ef
Compare
Would like to move forward with this so we can prepare the first beta releases! |
Ok, it's my turn. This is going to be difficult because it is mostly a matter of style but it also has some technical implications (like keeping namespace pollution to the minimum).
That's why I think there is no easy way out - we need to get it out of headers, use Unfortunately, the headers need to be dealt with now and uniformly, as we don't have long methods there which would justify putting I am not using an editor that magically completes identifiers - and I still prefer to type those |
So here my short feedback:
I will be pretty much away for 2 weeks now! |
I've been following all the discussion around this, and giving it some thought. I'm in agreement with @saper here. The minor overhead of typing On a personal note: I'm not a career c++ dev. As a result I've learned on the fly by googling. To me the explicitness On a community note: This project is gain massive popularity and our contributor base is going. Sticking to some form a best practice or styleguide will be a big boost to helping new contributors get up to speed. Things are much better than they where a year ago, and IMHO explicit namespacing makes things better again. |
Add new
sass.hpp
header for minimal std includes and exporting only specific symbols from std into ourSass
namespace. Also removed some redundant includes! This is an alternative to @saper changes, which blindly addsstd::
to every symbol. I opted to only do this for more esoteric symbols and leave it as is for the more common ones.Main fix is that I got rid of all
using namespace std
by explicitly saying:Those are the only symbols imported into the
Sass
namespace. You can then import that namespace if you want. IMO this should solve the most important problem, which was that we were exporting all symbols instd
into the global namespace in multiple headers!I guess I don't have to emphasise that I like this solution much better than the approach in #1310.
It should also keeps the git history much cleaner!