Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
So the web frontend stuff is for babies but C++ is for already grown-up kids, interesting!
-
-
-
@Demolishun my teacher also wrote doc comments for each and every trivial getter and setter in Java.
/*
Gets the horse shit.
- params: none
- returns: horse shit
*/
HorseShit getHorseShit() {
return this.horseShit;
} -
@CoreFusionX
> Global using namespace are evil.
> (And defeat the whole point of namespaces)
Not if they are file global.
Ok, there is no file level in C++ but if I use it in a cpp file (not a header),
using my_namespace;
then it will only apply to that file, IIRC.
And IMO this is ok.
Btw, can you disambiguate possible collisions by fully qualifying the name with its namespace on the spot?
If yes, that makes it even more viable. (Assuming that the compiler treats this as an error and not just picks one of the multiple possible names silently)
In C# and Swift you can do that np. -
@Lensflare
You can indeed disambiguate by fully qualifying, yeah.
Using using in an implementation file is not so bad, but doing so in a header file deserves the gallows, because you'll pollute the global namespace of whichever file includes it. -
@Lensflare I am not defending it. Just repeating the lame excuse for a lot of programming anti patterns.
-
@CoreFusionX I don't like it in a file scope. It can dump so many symbols into the space. I don't mind so much in function scope.
-
@Demolishun I didn’t even know that it's possible to do it function scope in C++! Sounds great!
Definitely not possible in C# and Swift! -
@Lensflare
You can just create a scope on the fly:
using namespace std{
}
Sometimes I just do this:
void stuff()
{
...
{
//some var I want deleted outside braces
int something;
}
...
}
Related Rants
-
Brolls2Not specifically dev related other than being hired as a dev, more a corporate thing. I have medical issues t...
-
Vicious10Slack, my boss and I: Me: Lucky I left when I did, I'll get through that fix when I'm less 🤢 Boss: Don't wo...
-
DenRand8I bought a new carbon fiber bike (I am into cycling the last two years) and it is fantastic. Lightweight, it f...
I still attend JSA (javascript anonymous) meetings...
joke/meme
sickness