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.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

Enoril , (edited ) in Aaargh....my eyes......my eyes......

I don’t see the benefit of this long naming convention…

It still allow bug to exist… like the fact that, with this code, the player can still play with 0 Hp.

Should have been better to put a “if(health <= 0)” instead of “< 0”

nikscha ,

Came scrolling for this ^^

joshfaulkner ,

I asked this question on this post on a different instance, but would there be issues being that the code compares a float to integer zero “0”?

BombOmOm , (edited )
@BombOmOm@lemmy.world avatar

Since the health is a float, yeah, it can create issues. A health of 0.000000001 is greater than zero, but that would almost assuredly be displayed to the user as simply 0, causing player confusion. The easiest solution is to have health and damage always be integers. A less great solution is to use a non-floating point decimal format. If such doesn’t exist in your language, you can emulate one by having health and damage both always be integers, but move the decimal point over, say two points, when displaying it to the user.

mindbleach ,

Kreed rule.

stockRot ,

It sounds like the only concern you have with code is its bugginess, which is short sights. This is unfortunately better documented code than stuff I’ve seen in production. Obviously no one should do this, but let’s not act like there’s no benefit

Enoril ,

Indeed, you can achieve a better result with less verbose naming convention. And choose better variable name to make it obvious than 0 Hp is death. While i don’t like having too verbose variable name (as it impacts the readability and quick understanding of the function), i’m not against that for the function name… without going too far of course!

Best is too have proper datamodeling of the object manipulated on top of some classic basic comments. Good interface contract is also a minimum. Best is to have full datamodeling of all the services, objects, in and out interactions between them, etc.

Documentation is a mandatory piece of the code delivery (with tests being the other important part) far too much forgotten if you don’t enforce it on your teams.

xep , in Aaargh....my eyes......my eyes......

This has likely been done intentionally for humour's sake, but take a look at some of the names in Apple's AppKit framework, like https://developer.apple.com/documentation/appkit/nspreviewrepresentingactivityitem

qaz ,

That page is giving me a 403

BombOmOm , (edited )
@BombOmOm@lemmy.world avatar

I’m still annoyed with how verbose Objective-C is. Just check out what one has to do to create and concatenate a string. Madness:


<span style="color:#323232;">    NSString * test = [[NSString alloc] initWithString:@"This is a test string."];
</span><span style="color:#323232;">    NSString * test2 = [test stringByAppendingString:@" This value is appended."];
</span>

And god forbid you want to concatenate two things to a string:


<span style="color:#323232;">    NSString * test3 = [test1 stringByAppendingString:[test2 stringByAppendingString:@" Adding a third value."]];
</span>
Claudio , in Aaargh....my eyes......my eyes......

Probably still better than bool a; bool b; int c;…

BurningTurtle ,
@BurningTurtle@programming.dev avatar

But i, i is sacred.

Darken ,
@Darken@reddthat.com avatar

deleted_by_author

  • Loading...
  • rmuk ,

    Primitive tribe discovers personal rights.

    Scoopta ,
    @Scoopta@programming.dev avatar

    🤔… I’ve never liked i and don’t use it…not sure why. I keep thinking I should start but alas I just don’t.

    RobMyBot ,

    Honestly? Yes, I agree

    hardkorebob , in Aaargh....my eyes......my eyes......
    MicrowavedTea ,

    I’d ask what I’m looking at here but feel I might regret it

    hardkorebob , (edited )

    In Oct’23 a basic Text widget with Subprocess to run shell commands allowed me to take my command line fu into a different arena because Tkinter gave me special tricks. This tool (shell functions) allows me to type up GUI apps or any Python script with less effort, for my fingers and brain.

    wc newide; ksh newide | wc

    513 1671 11018 newide in pnk

    604 1987 29867 newide in python

    The blocks of color are capital letters colored using tkinter methods (tag_add & tag_configure) with a bg and fg of the same color to make it look like a lego block, it’s all ASCII. On the right, an idle clicker game/toy made with pnk.lang, also just ASCII/UTF-8. The IDE you see in the pic also was coded using functional shell language I call pnk.lang and the original first iteration of this specification is in the legacy folder in the repo below. Just me learning how to code faster in Python but in shell but in neither at this point.

    github.com/dislux-hapfyl/pynksh

    www.reddit.com/r/pnk/

    Don’t be put off by Ksh because Bash can also interpret it, since it’s just shell functions that print Python code. But I have plans to use an Xbox controller so I can move away from building with the keyboard at piecemeal rates. I will do this by abstracting away identifiers and all data we use as engineers into “dictionaries” to then transform it into a spatial system. I already done this first step! Using a basic grid with a maximum of 10 rows x 3 cols, indexing row[0-9] col[0-2], as you see there on the left side, and by using a letter I then categorize the functions of pnk(shell+python) so I can have 30 x 26[a-z] available slots; a00 b11 k22 and so on…by making it a visual shortcut that reduces cognitive load and typing for me.

    Take a closer look at my repo without dismissing it too quickly. It could seem unnecessary but maybe someone else can see what I have made as useful and how we gonna take it to higher levels of abstraction and create a new realm for making computer applications in an abstract game/IDE of art and code. Perhaps it’s that creator effect that happens when you make something for the first time that makes me see its future utility and appeal. All this was made incrementally using my own software I built from scratch. I do have a great vision and would love to speak to anyone who is interested. I also demonstrate the utility of this small tool on youtube[link in repo]. Thanks.

    MicrowavedTea ,

    Ok I don’t completely get the use case but that’s…impressive. Thanks for the detailed explanation and good luck moving it forward

    hardkorebob ,

    Thanks a lot! ;) … maybe also see my reply above.

    kralk ,

    I’m somehow more confused

    hardkorebob , (edited )

    I write python in shell. Literally. I made a shell function file (pnk.lang) that prints correct python code. The capital letters in the shell function’s name, my Tkinter IDE turns into color as you see above. So I let the color (capital letter) abstract away indentation for my brain. The second letter is for category of python code according to me. Again using color to allow me to think. I dont like Python syntax. I looks ugly to me. So I made this tool to make coding colorful, succint and fun for me. It reduces my eye strain among many other personal benefits.

    S=self

    E=echo

    #Z=“” #0

    Y=" " #3

    X=“$Y$Y " #7

    W=”$Y$X "

    V=“$Y$W "

    U=”$Y$V "

    YDfd() {

    
    <span style="color:#323232;">typeset z="$1"
    </span><span style="color:#323232;">
    </span><span style="color:#323232;">    typeset nn="$2"
    </span><span style="color:#323232;">
    </span><span style="color:#323232;">typeset cc="$3" 
    </span><span style="color:#323232;">
    </span><span style="color:#323232;">if [[ $z == z ]]; 
    </span><span style="color:#323232;">
    </span><span style="color:#323232;">then
    </span><span style="color:#323232;">
    </span><span style="color:#323232;">	$E "$Y def $nn(${S}$cc):"
    </span><span style="color:#323232;">
    </span><span style="color:#323232;">else
    </span><span style="color:#323232;">
    </span><span style="color:#323232;">	$E "$Y def $nn($cc):"
    </span><span style="color:#323232;">
    </span><span style="color:#323232;">fi
    </span>
    

    }

    YDdefe() {

    
    <span style="color:#323232;">typeset fn="$1"
    </span><span style="color:#323232;">
    </span><span style="color:#323232;">YDfd z $fn ,e=None
    </span>
    

    }

    YDdefe addNew

    XIcv $ap Pnk

    XFpk $ap 1 both

    XFfc zz pw.add $ap

    turns into

    
    <span style="color:#323232;">def addNew(self,e=None):
    </span><span style="color:#323232;">    self.appinstance = Pnk(self,)
    </span><span style="color:#323232;">    self.appinstance.pack(expand=1,fill="both",padx=2,pady=2,)
    </span><span style="color:#323232;">    self.pw.add(self.appinstance)
    </span>
    
    mspencer712 , in Aaargh....my eyes......my eyes......

    Ugh, this makes me want to “slash slash slash.”

    RatBin , in Aaargh....my eyes......my eyes......

    Why not leave comments

    bAZtARd ,

    Why leave comments?

    jimmy90 , in Variable Declaration

    #![allow(warnings)]

    :)

    tourist , in Aaargh....my eyes......my eyes......
    @tourist@lemmy.world avatar

    lgtm

    merged

    xmunk ,

    I’m assigning all my PRs to you, buddy, your performance metrics will be over 9000!

    Hupf , in Aaargh....my eyes......my eyes......
    mectag ,

    It’s an unwritten rule that there‘s always a fitting xkcd post

    CCF_100 , in Aaargh....my eyes......my eyes......

    My ASDV professor has two moods: He either names variables like this post, Or he names variables pp (for pointer pointer)

    robojeb ,

    Fuck for some reason pp is giving me flashbacks to having to write using Hungarian notation variable names.

    Vigilante , in Open Source VS Company

    Yeah those entitled shits are ruining it for everybody .

    pivot_root ,

    “Add support for XYZ.”

    No please, no thank you, just a follow-up of “is it done yet?” three days later.

    kernelle ,

    Eta when?

    solarvector , in Open Source VS Company

    Yes, but also have you seen some game development forums? Oof. Some people just need their gaming chair hooked up to a sun facing launchpad.

    Jako301 , in Open Source VS Company

    You haven’t worked in any customer support position, and it shows. The amount of slurs hurled at them is far greater than anything found in a few github comments.

    savvywolf ,
    @savvywolf@pawb.social avatar

    Yeah, I read this meme and it was like… Have you met gamers?

    The amount of patches that apparently ruin the game or Devs refusing to fix “simple” bugs is astounding.

    setsneedtofeed , (edited )
    @setsneedtofeed@lemmy.world avatar

    Also complaints that lack specificity must be aggravatingly common. I once complained on an open board about a bug in Wasteland 3 and a dev reading comments actually PM’d me asking for details. I provided details as best I could, including screenshots- the very next patch included a fix for my niche issue. But I imagine most bug reports being “GAME BROKEn! SUX! Fix NOW character creation BROKENN!”

    Daxtron2 ,

    Yeah that’s pretty average for most bug reports. You’re lucky if they even mention the issue, people like you who actually submit details are the only reason we can fix bugs lol.

    xmunk , in Aaargh....my eyes......my eyes......

    Obviously, we can’t allow code like that - PascalCase is heresy… camelCase that shit.

    TrippaSnippa ,

    snake_case gang represent

    IsThisAnAI , in Open Source VS Company

    On what planet do you live where people treat commercial requests nice? Clearly you haven’t been in the industry long.

    ByteJunk ,
    @ByteJunk@lemmy.world avatar

    I presume OP works at a decently sized company, and they have magical people like PMs and CSMs that turn customer tantrums into neat little cards that he can push down the kanban.

    vithigar ,

    Or a giant company where customer tantrums are just background noise that is easily ignored.

    Quill7513 ,

    Soothing white noise that helps you sleep

    habl ,

    I always go to the headquarters of the commercial company in a bomb suit to request the update I need.

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