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
-
Hobo424068yHe's bothering to comment what they are on the sides, but those comments could just be the variable names instead. Two birds one stone.
Shouldn't enforce bad practices at any level. -
iAmNaN71318yIt takes fewer keystrokes to type const canvasWidth = 800 ... btw, is everything declared a const in his code?
-
spacem18448yI agree with his statement and his use of p = new puck is limited scope enough for me to use p as a name.
Personally I dislike the short const names in his example - could say that if it needs commenting then don't do it - Exception would be if the short name is a commonly used name in the domain. Like using po instead of purchase order. I don't know game development but maybe those are standard acronyms and someone who knows the domain would know them. -
vause4918y@spacem
I see where you're coming from, and in those circumstances I would agree. However there's two things he's talking about, paddle and puck. Using PX and other short variable names is super confusing especially when he calls them in functions later. You have to go back to the original declaration just to see what the hell he's talking about. -
What engine/language are you guys using? Canvas makes me think JS and HTML5, but I don't see any language specific things, and const is still kinda unsupported so I'm unsure
-
vause4918y@iam13islucky
Yep html5 and js. A framework called createjs. Not a huge fan but I guess it teaches javascript. The instructor is awful though so I'm lucky I already knew js before coming into this class. -
That's what I always tell my classmates. "If I ever get into a team with you, be sure to name variables properly, with a meaning or a common short name, or you'll have problems with your balls soon."
-
Canilho3168yI think most of you are overlooking the real issue here.
Doesn't matter how you feel about what are the best practices, but what is the purpose of the code.
For me, in small code snipets, using short names is good to keep the focus in the logic / fast prototyping. However if the code scales up, having better names can make the difference from a 5 minutes fix from a 5 hour headache.
Don't be so quick judging people by their methods. We are not all the same.
If everyone followed standards, you would still be playing with sticks and stones. Think about that! -
I honestly don't think it's that bad for what's being done... Like sure he could use more descriptive​ names but really that isn't very hard to understand what's happening
-
@Canilho @TEvashkevich I personally am confused just looking at those 2 letter variables. There's way to much processing power needed here just to understand that simple code. Simply put, through his stoneage coding techniques he puts off people that might be interested in coding but get confused and think they are not smart enough. Developing software like in the 90s when there were no IDEs with tab completion and you having to keep your code short because of long variable names using up too many space is your sticks and stones. There is a reason nobody is supposed to write code like this anymore.
The most obvious thing that makes this code bad is that he has to comment every variable because even he won't know what he has done there in 1 hour. That is redundant is sh*t. Use sensible names and even a 100 lines in ppl know what you want from them. Software development practices have come a really long way...Thank God. I hope his linting tool slaps him in the face hard -
@GigabyteDX I know that, but most of my teachers couldn't even setup eclipse on the lab computers correctly, let alone set up Babel lol. I was curious if he had done that
-
Guys... This guy is supposed to be a teacher. Basically is teaching that doing that code is ok.
When you cross the street with a kid don't you wait for the green light and look both sides? Why? So the kid can learn and redo next time. -
viking817428yBack in the old days, Fortran was limited to 6 characters in variables. That stuck with a lot of people, and continued into C world.
I code a lot of complex mathematical operations at work, and keeping the math and code the same makes life easier when talking with our scientists. So, it depends.
Related Rants
Our instructor for game development claims that variable names are not important if your scope is small.
Thoughts?
Here is a picture of his code he gave us as a reference the other day.
undefined
insane instructor
convention
variable naming