Details
-
AboutPointer Arithmetician & Interactive Real-Time Simulation Developer
-
SkillsC++, Python, htmlcssjshttp, etc
Joined devRant on 8/12/2017
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
-
Protip: never search for available domain names through any web services, always use the `whois` command to query the whois servers directly.
-
@sauronjs time to learn software engineering then :)
-
@sauronjs or you move somewhere where people don't write shite code
-
Do you have an actual example of where you think there should be a comment?
-
@DefiniteGoose that is only needed in very severe cases
-
@duckWit our code doesn't have to know what the actual value is. That's the beauty of programming. A proprietary library can provide the value; it doesn't matter at all where the value is coming from when we only care about mutating it. I don't grasp what your problem with this abstraction is.
-
@duckWit knowing the actual value is out of scope of the "how to mutate a variable without knowing its value" topic. The value could be set by your favourite God; we don't know how the object was created. We just invoke operator-- on it.
-
@duckWit "What was the old value? What's the new value? I told it to decrement by 1 (the --), but from what to what?"
This makes it obvious that you don't actually understand how a write-only property works.
As I said, the variable would have to be seeded with a value when the object is created or before you try modifying it. There's no need for me to know the value when calling operator-- since it's all contained within the object. -
@duckWit as a more practical example you can imagine sending me money, in an envelope, by wire transfer, or otherwise. By doing this you're mutating my amount_of_money without being able to read its actual value.
-
@duckWit the "write accessor" can be part of the class hence having private access to its member variables, meaning the public interface is only able to mutate the value indirectly. You can also imagine some hardware that decreases a number upon receiving a signal, but with no way to read the number back out.
Both of these would have to be initially seeded with values of course. -
@duckWit days_to_live could be write-only, as in allow modification but not reading the actual value, e.g. only implementing operator--()
-
@benzammour what kind of documentation are you referring to?
-
Code shouldn't be documented. Code should be well-written so that documentation isn't needed.
-
@Yamakuzure isn't that only for template errors
-
There are three hard things in computer science: naming things, cache inv asynchronous callbacks,alidation, and off-by-one errors.
-
@Yamakuzure OP is talking about the brevity of error messages.
-
The problem isn't that you didn't write comments. The problem is that you wrote bad code that is unreadable.
-
@tokumei pacaur has been deprecated 😕
-
@inaba PHP doesn't have an event loop. Sleeping just pauses execution.
-
Order of includes should be: cpp file's hpp, local headers, libraries, standard libraries. If file.hpp depends on iostream, it should include it itself.
Otherwise, including file.hpp will work in places that is using iostream (and includes it before file.hpp) but will fail in places that aren't using iostream, requiring you to include iostream in a place that doesn't need it (or do the correct thing and include iostream in file.hpp (and then there's no point in including iostream before file.hpp in the former case)).
Using the correct inclusion order above will prevent this accidental dependency injection as including file.hpp will always fail because iostream won't have been included yet -- forcing you to include iostream in file.hpp like you should. -
Like this?
-
Try saving it by following up with "As in, put a number to it for each aspect?"
-
Would've worked if she said "put a scalar to it".
-
He will die single because he's not using ISO 8601 YYYY-MM-DD
-
@Fast-Nop have you tried TortoiseGit?
-
@py2js no, stop confusing counting with indexing.
-
Why is this a problem? Just pull --rebase
-
The term "self-taught" is terrible. Using it completely disregards the time and effort spent by those writing documentation and books and making tutorials and lectures, and those giving you feedback and code reviews and mentoring you -- all these combined is what has taught you what you know.
One might not have a formal education, but one is not self-taught. -
Because you're a good software engineer who know what you're doing unlike the great majority of the people on this platform?
-
@telephantasm Indeed, hence "few exceptions". What most these people refer to by "commenting code", is the "how"-type comments and docblocks.