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
-
bad-frog5464yedit: clarification
i mean oop style of programming ie using an object with all it implies instead of a primitive value and a comparison for instance.
dealing with oop style and philosophy can be so frustrating at times:( -
bad-frog5464y@Maer oop encapsulation:
lets say i build a rudimentary game.
lets say its fps.
lets say i have my actor classes,
classes to do the rendering,
and classes for internal game logic.
now lets say i shoot an enemy.
following encapsulation principles i should either
a)scrap my nice classes and put all my methods and all my data within a "main" class.
b) have spaghetti code of the "main.enemy.gethitscan" sort with practically duplicated methods, and more difficult, less efficient code (because hitscanning an enemy during rendering makes things so much easier)
c) just ignore encapsulation for readability and performance sake.
oop just adds philosophical fluff to a subject thats hard enough already.
and like with encapsulation, said fluff sometimes even gets in the way of getting a job done. -
bad-frog5464y@Maer oh, i just read again what i typed above:
it was something that popped up recently: phone numbers.
and want to check whether the first number is bigger than 5.
looks like i have to do
const string = "123456"
const check = "5"
if (string.charCodeAt(0) > check.charCodeAt(0))
{
-something-
}
:/ -
bad-frog5464yand if it turns out that charCodeAt method is anything more than one single dereferencing, ima start insulting the people who made JS
Related Rants
-
NoMad6Cyber security. Deep knowledge of cyber security and networks is what I wish I had. The math stuff that no one...
-
GiddyNaya12* Driving... Thinking about code. * Walking... Thinking about code. * Lying down... Thi...
-
black-kite4If I could, I would ask the genie to give me the ability to completely disconnect from programming when my wor...
deal with oop.
because they made it waaaaay more complicated than it needs to be.
rant
wk262