There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

henfredemars ,

Try assembly language! You have registers, and they are named for you with highly memorable names like R17.

OpenStars ,
@OpenStars@discuss.online avatar

Yes your variable names should indeed all be different from one another.

var Turtle1 var Turtle1 var Turtle1

just doesn’t quite have the same impact:-).

Kolanaki , (edited )
@Kolanaki@yiffit.net avatar

I always make sure my variables are named in ways I can remember what they’re for. The only time I just use generic var1, var2, etc is if I am experimenting with a function I’ve never used before and wanna play around with it to see how it’s used.

This should be easily read by others but there could be times where it’s an inside joke.

Sanctus ,
@Sanctus@lemmy.world avatar

Yes, its code whether it executes or not.

parpol , (edited )

Yeah, a name should describe what it is or does, so if you have two turtles, and let’s say turtle1 wants to shit on turtle2’s lawn, you could name them shittingTurtle and victimTurtle. If the name alone tells you what its purpose is, that saves a lot of time for people looking at your code.

Is_Turtle is not a bad variable name because it tells you it is a Boolean with “is” and that the Boolean tells you whether something is a turtle or not.

Also, depending on the language, I suggest either camelCase or snake_case naming of variables. PascalCase is usually for defining classes or in case of C#, methods.

OttoVonNoob OP , (edited )

I’m gonna be honest I just used Turtle ad an example:X … when it’s actually like a GoldCost, GoldC and GoldH. Where GoldR is a reset var and GoldC is the paid value. GoldCost is self explanatory but I really spagettied it up XD…

Repelle ,

SHOUTING_SNAKE_CASE aka SCREAMING_SNAKE_CASE is the best case for all use cases, because it gives you a chance to use its wonderful names.

wesker , (edited )
@wesker@lemmy.sdf.org avatar

Have you considered using inheritance?

OttoVonNoob OP ,

I’m an amateur I’m not sure what inheritance is:X? Is it like instantiateing?

wesker , (edited )
@wesker@lemmy.sdf.org avatar

When you start learning about different paradigms, you’ll likely learn much more about inheritance when learning about the Object Oriented design paradigm.

To overly simplify, you create objects that inherit attributes from other objects. It’s for instance a way to create reusable patterns, that have stronger and more reliable data structures.

I made the joke comment, because for instance, you could create a Turtle class, and always know it was a Turtle. Again, an oversimplification.

EDIT: I should also add that for some reason OOP is an oddly divisive subject. Developers always seem to want to argue about it.

OttoVonNoob OP ,

Oh yea, class resources. That would work! Thanks.im going to have to into this more, as it’s going to be useful

wesker , (edited )
@wesker@lemmy.sdf.org avatar

If I could give a suggestion I wish I had gotten much earlier on in my education and career, it would be to really spend some time learning about the different paradigms, and their best use cases. You will likely ensure yourself a strong foundation in software architecture.

OttoVonNoob OP ,

I’ll check it out! I’m very casual and doing thus mostly as a passion/Fun project. But I love any direction thank you:)

hoshikarakitaridia ,
@hoshikarakitaridia@lemmy.world avatar

At this point I think there is no software dev topic that is somehow not devisive.

metaStatic ,

blew my inheritance on hookers and blow, now what?

_stranger_ , (edited )

Have you considered multiple inheritance. It’s an upgrade. All upside, literally no downside. I’m trustworthy. Trust me.

InternetCitizen2 ,

You might not like it, but that is what peak shareholders value looks like.

RiikkaTheIcePrincess ,
@RiikkaTheIcePrincess@pawb.social avatar

Idunno, my mom told me not to talk to _stranger_s 🤔

… She said a lot of things that were BS, though, so maybe you’re cool I guess? 🤷

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines