-
Notifications
You must be signed in to change notification settings - Fork 15
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
goals and style in user-facing code #22
Comments
I'm lurking, but can I just say that I entirely agree with these comments and the rationales. |
I also agree with everything, except for the << operator. I added this as a
way to simplify usage and to make code shorter. I'm very interested in
hearing how students haver received this.
…On Tue, Mar 5, 2019 at 11:06 AM Graham Wakefield ***@***.***> wrote:
I'm lurking, but can I just say that I entirely agree with these comments
and the rationales.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#22 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAatx9YfZQ4lttrMNDM8voblgE8kYolTks5vTsAugaJpZM4bfD6P>
.
|
sorry. i sent that before it was done. while students have not complained about this usage of <<, they do struggle with << and >> generally. in c++ >> and << mean "shift bits right" and "shift bits left". they also mean "pull from stream" and "append to stream" respectively. neither of these usages have any basis is math where they mean "much greater than" and "much less than". this last meaning would make some sense to a person new to programming. c++ "stream" i/o makes use of << and >>. that's the usage that new students come across (and struggle with) first. IMHO, c++ stream i/o is awful. take a poll of nearby c++ users and see how many favor printf! it's atomic, well-documented, and ubiquitous. i avoid using the >> and << operators for anything other than bitshifting. IMHO it is a mistake that our OSC implementation uses >> (e.g., Message m; float f; m >> f;) New students struggle with >> and << when used in the traditional c++ contexts: stream i/o and bit-shifting. so let's not introduce a new meaning and usage for >> and << in user code. in this use, << is put forward as a shortcut for adding parameters to a gui. let's please leave << and >> for bit shifting and stream operations. |
i would like to start a conversation about our goals and style in user-facing code (i.e., examples). i've sketched out some of my position in the comments of this refactored example:
https://github.com/AlloSphere-Research-Group/allolib/blob/style_opinions/examples/ui/dynamic_scene.cpp
The text was updated successfully, but these errors were encountered: