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.

spudwart , in Bill is a pro grammer

Make it deceptively easy to read.

It appears easy to read in a review of the code, but upon any further glance, to actually keep it up, the only one who can understand it is you.

RGB3x3 ,

That’s just job security

youCanCallMeDragon , in Bill is a pro grammer
@youCanCallMeDragon@lemmy.world avatar

I wonder if chat GPT can add comments

glibg10b , (edited )

<span style="font-style:italic;color:#969896;">// Greetings, intrepid explorer, to the magnum opus of verbosity – the exhaustive elucidation
</span><span style="font-style:italic;color:#969896;">// of the venerable "Hello, World!" program in the illustrious realm of C++.
</span><span style="color:#323232;">
</span><span style="font-style:italic;color:#969896;">// Our inaugural act involves the summoning of external powers through the sacred rite of inclusion.
</span><span style="font-style:italic;color:#969896;">// The venerable  library is invoked, opening the gateway to input and output sorcery.
</span><span style="font-weight:bold;color:#a71d5d;">#include </span><span style="color:#183691;"><iostream>
</span><span style="color:#323232;">
</span><span style="font-style:italic;color:#969896;">// Brace yourself, noble adventurer, for the initiation of our journey transpires within the sanctum
</span><span style="font-style:italic;color:#969896;">// of the 'main' function – the veritable heart and soul of our C++ odyssey.
</span><span style="font-weight:bold;color:#a71d5d;">int </span><span style="font-weight:bold;color:#795da3;">main</span><span style="color:#323232;">() {
</span><span style="color:#323232;">    </span><span style="font-style:italic;color:#969896;">// Let us forge a pact with the realm of 'std', alleviating the syntactic tribulations
</span><span style="color:#323232;">    </span><span style="font-style:italic;color:#969896;">// through the divine power of the 'using' declaration. Behold the namespace, a sanctuary
</span><span style="color:#323232;">    </span><span style="font-style:italic;color:#969896;">// where the gods of C++ convene, rendering our code free from the shackles of verbosity.
</span><span style="color:#323232;">    </span><span style="font-weight:bold;color:#a71d5d;">using</span><span style="color:#323232;"> namespace std;
</span><span style="color:#323232;">
</span><span style="color:#323232;">    </span><span style="font-style:italic;color:#969896;">// As we stand on the precipice of expression, the 'cout' oracle emerges.
</span><span style="color:#323232;">    </span><span style="font-style:italic;color:#969896;">// This venerable entity, an emissary of the standard output stream, awaits our command.
</span><span style="color:#323232;">    </span><span style="font-style:italic;color:#969896;">// With the '<<' conjuration, we channel the essence of our proclamation, "Hello, World!",
</span><span style="color:#323232;">    </span><span style="font-style:italic;color:#969896;">// and cast it into the void of the console, where it shall resonate for eternity.
</span><span style="color:#323232;">    cout </span><span style="font-weight:bold;color:#a71d5d;"><< </span><span style="color:#183691;">"Hello, World!" </span><span style="font-weight:bold;color:#a71d5d;"><<</span><span style="color:#323232;"> endl;
</span><span style="color:#323232;">
</span><span style="color:#323232;">    </span><span style="font-style:italic;color:#969896;">// The denouement approaches, where our protagonist, the 'main' function,
</span><span style="color:#323232;">    </span><span style="font-style:italic;color:#969896;">// bestows upon the cosmic arbiter – the operating system – a token of acknowledgment.
</span><span style="color:#323232;">    </span><span style="font-style:italic;color:#969896;">// The triumphant 'return 0' is a symphony of numerical reverence, echoing
</span><span style="color:#323232;">    </span><span style="font-style:italic;color:#969896;">// the harmony of a flawless performance in the grand opera of computational artistry.
</span><span style="color:#323232;">    </span><span style="font-weight:bold;color:#a71d5d;">return </span><span style="color:#0086b3;">0</span><span style="color:#323232;">;
</span><span style="color:#323232;">}
</span>
GissaMittJobb ,

10/10 literate programming points

Beanie ,

Ah yes, #includen. The magical include that simply copy-pastes the entirety of libc’s headers into your source file.

charliespider ,

Chat GPT is great at writing comments. Usually writes better comments than I do. I’m using copilot which uses Chat GPT so it’s also repo aware.

Landless2029 ,

I second github copilot

Landless2029 ,

Try github copilot I’ve canceled my chatgpt for it.

Now I start scripting by doing all my comments. Essentially make a outline like I’m writing a paper.

Copilot suggests the code that matches my comments.

I script legit 3x~4x faster now with full comments. It’s amazing.

Haus , in Bill is a pro grammer
@Haus@kbin.social avatar

This is what I call a 'pro grammer move.'

onestop , in Bill is a pro grammer

code: return isPersonAStudent()

manager in code review: WHY NO DOCUMENTATION!!??

reverendsteveii ,

manager in code review

theresYourProblem.jpg

magic_lobster_party , in Bill is a pro grammer

x += 1; // Increases x by one

towerful ,

// increase the dynamically allocated memory space of a word sized integer stored at the memory address represented by the symbol “x” by the integer 1 and terminate the instruction

morrowind ,
@morrowind@lemmy.ml avatar

Wait why is it dynamically allocated and why are you increasing the memory. Something is very wrong here

floofloof ,

Found the bug. Thank goodness for comments.

Anders429 ,

Oh, is this what they meant by “commenting your code”?

Anders429 ,

Why the heck does it need to be dynamically allocated? Just put that puppy on the stack.

towerful ,

That’s what it used to do.
But it was a bug, and the code has been fixed.

ZILtoid1991 ,
@ZILtoid1991@kbin.social avatar

x++; // Move X position forward by one

There, I made that kind of comment more useful!

LostXOR ,

x++; // Set x to the incrementation of the value of x
Much better.

Jakylla ,
@Jakylla@sh.itjust.works avatar

// Move to the right

autokludge , (edited )
@autokludge@programming.dev avatar

…Years later
x += config.increment; // Increases x by one


<span style="color:#323232;">"""
</span><span style="color:#323232;">config.yaml
</span><span style="color:#323232;">increment: -2
</span><span style="color:#323232;">"""
</span>
clearleaf , in Works on my machine

They did it! They passed the turing test!

Palacegalleryratio , in Works on my machine

You know what, this is on us. Chat GPT is just a prediction engine that tries to say what words it thinks follow a preceding prompt, and it’s looked at millions of examples (written by us) and it’s seen hapless clients and users complain about bugs and be told: “user error, works fine” so often chatGPT just thinks it’s just the culturally accepted polite response to a bug report, in the same way as responding to “thank you” with “you’re welcome”. This is a dark mirror on our profession.

xx3rawr , in Works on my machine

The AI is taking over us

amanaftermidnight , in Works on my machine

Then we’ll ship the AI.

…what do you mean, all the ICBM silo doors are opening?

hakunawazo ,

ChatGPT is far too long, let’s call it WOPR. The most capable tic tac toe machine.
en.wikipedia.org/wiki/WarGames

Fades , in Works on my machine

Every time I hear this from one of my devs under me I get a little more angry. Such a meaningless statement, what are you gonna do, hand your pc to the fucking customer?

Baizey ,

…yes? I thought we made that clear with containerization

FaceDeer ,
@FaceDeer@kbin.social avatar

It's not actually meaningless. It means "I did test this and it did work under certain conditions." So maybe if you can determine what conditions are different on the customer's machine that'll give you a clue as to what happened.

The most obscure bug that I ever created ended up being something that would work just fine on any machine that had at any point had Visual Studio 2013 installed on it, even if it had since had it uninstalled (it left behind the library that my code change had introduced a hidden dependency on). It would only fail on a machine that had never had Visual Studio 2013 installed. This was quite a few years back so the computers we had throughout the company mostly had had 2013 installed at some point, only brand new ones that hadn't been used for much would crash when it happened to touch my code. That was a fun one to figure out and the list of "works on this machine" vs. "doesn't work on that machine" was useful.

platypode ,
@platypode@sh.itjust.works avatar

doesn’t understand that this is a useful first step in debugging

reacts with anger when devs don’t magically have an instant fix to a vague bug

Yep, that’s a manager

Belzebubulubu ,
@Belzebubulubu@mujico.org avatar

You are seeing the next CEO of that company

1984 ,
@1984@lemmy.today avatar

“my devs under me”

Lols.

FaceDeer , in Works on my machine
@FaceDeer@kbin.social avatar

To be fair, the bug report was utterly useless too.

parpol ,

Should have asked chatGPT to write the bug report.

Contend6248 ,

True, when i respond with the exact problem it usually gets fixed, interestingly even explained why it failed.

Great for learning

IzzyScissor ,

The only problem is that it’ll ALSO agree if you suggest the wrong problem.

“Hey, shouldn’t you have to fleem the snort so it can be repurposed for later use?”

You are correct. Fleeming the snort is necessary for repurposing for later use. Here is the updated code:

Rhaedas ,
@Rhaedas@kbin.social avatar

Models are geared towards seeking the best human response for answers, not necessarily the answers themselves. Its first answer is based on probability of autocompleting from a huge sample of data, and in versions that have a memory adjusts later responses to how well the human is accepting the answers. There is no actual processing of the answers, although that may be in the latest variations being worked on where there are components that cycle through hundreds of attempts of generations of a problem to try to verify and pick the best answers. Basically rather than spit out the first autocomplete answers, it has subprocessing to actually weed out the junk and narrow into a hopefully good result. Still not AGI, but it's more useful than the first LLMs.

FaceDeer ,
@FaceDeer@kbin.social avatar

That's not been my experience. It'll tend to be agreeable when I suggest architecture changes, or if I insist on some particular suboptimal design element, but if I tell it "this bit here isn't working" when it clearly isn't the real problem I've had it disagree with me and tell me what it thinks the bug is really caused by.

Synthead ,

It was trying to is, then it isn’ted. Help?

takeda , in Works on my machine

But it doesn’t even compile!

Kolanaki ,
@Kolanaki@yiffit.net avatar

“You literally just wrote ‘kill all humans’ and put it in curly brackets.”

xmunk ,

“So, did your program fail after you executed it? Or do you just think my code looks wrong?”

kamenlady ,
@kamenlady@lemmy.world avatar

If you keep inquiring like this, it will send the terminator personally to have you exterminated

angelsomething , in Works on my machine

Literally why docker was invented

takeda ,

Yeah, it “solved” the “it works on my machine” by bundling the machine with the code.

youtu.be/0uixRE8xlbY

Opafi ,

Man, I really was interested in that topic, but that guy really can’t do talks.

takeda , (edited )

What about this? youtu.be/5XY3K8DH55M

Also I created this repo to create a reproducible sec environment for myself. I added other languages, but personally work mostly with python. It is basically resonating for handling all the boiler plate:

github.com/takeda/nix-cde

For packaging in docker I started to use nix2container project as it gives me a greater control over layers. So for example when I package my phyton app I typically use 3 layers:

  • python and it’s dependencies
  • my application dependencies
  • my application, which is very tiny compared to other two, so there is great reuse of the layers

The algorithm mentioned in the video also helps a lot with reuse, but the above is more optimized by frequency of how things typically change.

BTW: today I discovered this github.com/astro/microvm.nix I haven’t play with it yet, but in theory it would let me generate a microvm image (in similar fashion to generate a docker container) which would let me to run my app natively as a tiny VM on EC2 for example, and use only minimum necessary of a typical OS to run it.

SpeakinTelnet ,
@SpeakinTelnet@sh.itjust.works avatar

I have a love/hate relationship with docker. On one side it’s convenient to have a single line start for your services. On the other side as a self-hoster it made some developers rely only on docker meaning that deploying the stack from source is just an undocumented mess.

Also following the log4j vulnerability I tend to prioritize building from source as some docker package were updated far later than the source code was.

Zikeji ,
@Zikeji@programming.dev avatar

The Dockerfile is essentially the instructions for deploying from scratch. Sure, they most likely only exist for one distro but adapting isn’t a huge chore.

You can also clone the repo and build the container yourself. If you want to update say, log4j, and then attempt to build it, that’s still entirely possible and easier than from scratch considering the build environment is consistent.

SpeakinTelnet ,
@SpeakinTelnet@sh.itjust.works avatar

If I’m updating the source code already I might as well build my service from it, I really don’t see how building a docker container afterward makes it easier considering the update can also break compatibility with the docker environment.

Also adapting can be a pita when the package is built around a really specific environment. Like if I see that the dockerfile installs a MySQL database can I instead connect it to my PostgreSQL database or is it completely not compatible? That’s not really something the dockerfile would tell me.

evranch ,

I really don’t see how building a docker container afterward makes it easier

What it’s supposed to make easier is both sandboxing and reuse / deployment. For example, Docker + Traefik makes some tasks so incredibly easy and secure compared to running them on bare metal. Or if you need to spin up multiple instances, they can be created and destroyed in seconds. Without the container, this just isn’t feasible.

The dockerfile uses MySQL because it works. If you want to know if the core service works with PostgreSQL, that’s not really on the guy who wrote the dockerfile, that’s on the application maintainer. Read the docs, do some testing, create your own container using its own PostgreSQL or connecting to an external database if that suits your needs better.

Once again the flexibility of bind mounts means you could often drop that external database right on top of the one in the container. That’s the real beauty of Docker IMO, being able to slot the containers into your system seamlessly due to the mount system.

adapting can be a pita when the package is built around a really specific environment

That’s the great thing about Docker, it lets you bring that really specific environment anywhere and in an incredibly lightweight manner compared to the old days of heavyweight VMs. I’ve even got Docker containers running on a Raspberry Pi B+ that otherwise is so old that it would be nearly impossible to install the libraries required to run modern software.

kratoz29 ,

I love Docker because it is the only sane method to selfhost shit with my Synology NAS, and I love my Synology NAS because it is the only Linux interaction that I have (from my old MacBook Pro).

ohlaph ,

Docker has been a savior.

kurwa ,

Now we just need to run docker inside the browser

eatyourglory ,

Ah-ah! Now that’s progress!

GissaMittJobb , in the myth of type safety

It’s all bits in registers at the end of the day, and they all have the only type a bit can have

lvxferre , in The truth about the OpenAI drama - The Code Report
@lvxferre@lemmy.ml avatar

My guesses:

  • Toner’s role is being underplayed by the video. She’s potentially calling Altman out, for underrating the dangers of AI.
  • At least Altman is lying about something - about how much OpenAI is going towards AGI in the short term. The above might’ve bought the bullshit fully, while Sutskever knows that it’s bullshit.
  • I’m not sure if the board is also lying or not.
  • The boiling point was likely OpenAI potentially receiving some cash grant from some scummy party, that would be in a moral grey area considering the "non-"profit goals of the company.
  • Everybody will get a bit more of free popcorn for a while. 🍿 This mess is far from over.
  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines