Giter Site home page Giter Site logo

Comments (4)

e2-dunstan avatar e2-dunstan commented on August 22, 2024 1

Update: I have now figured out what all the variable names represent - duh! For anyone else with a slow brain like me:

  • dp refers to dot/scalar product.
  • c refers to a contact
  • sm refers to square magnitude

from cyclone-physics.

ButchDean avatar ButchDean commented on August 22, 2024

Variables have no context outside their use in statements or expressions. If you can't understand what the code is doing by reading it and running the examples, you may need to reread the chapter then run and examine the code again.

from cyclone-physics.

e2-dunstan avatar e2-dunstan commented on August 22, 2024

Variables have no context outside their use in statements or expressions. If you can't understand what the code is doing by reading it and running the examples, you may need to reread the chapter then run and examine the code again.

This code is not featured in the book, or at least I cannot find it. I am working through the book and understand the theory however those variable names are very obscure. I have added this issue just so those names can be clarified to me, they do not need to be changed. (PS: I know what a variable is...)

from cyclone-physics.

ButchDean avatar ButchDean commented on August 22, 2024

Honestly, I'm not saying that you don't know what a variable is, I'm trying to point out how you discover what it is intended for just by looking at the code. As an example, you asked what the variable 'toSt' is. For me, just by looking at its context within contactPoint(), the code at line 370 suggests that it is used to retain the difference between two points in 3D space, and that is all you really need to know. Elaboration is given in the following lines where deltas between the first and second points with that point are calculated.

That is what I mean by looking at the context over relying on names to describe what the code is doing - could the vars be named better? Sure, but they aren't. If you want then renamed you can perform a basic refactoring exercise to rename them as you see fit, but this is not something that needs fixing in the published code or for someone to take the time reminding themselves of what everything is doing in order to provide an explanation.

When you become a full-time programmer you will see what I man. Good luck! :)

from cyclone-physics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.