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.

TangledHyphae , in C++

As someone who writes C++ every day for work, up to version C++20 now, I hate the incoming C++23 even more somehow. The idea of concepts, it just… gets worse and worse. Although structured binding in C++17 did actually help some with the syntax, to be fair.

gandalf_der_12te , in Naming is hard

As the saying goes, there’s only two hard problems in IT:

Caching, naming things, and off by one errors.

VitabytesDev , in Roses are red, violets are blue, everyone is using IPv6, why aren't you?

My ISP doesn’t provide an IPv6 connection.

cellardoor ,

Time to shift providers. Vote with your wallet

ArmokGoB ,

You have more than one provider in your area?

cellardoor ,

Sure, in the UK we have very strict rules around competition law and broadband access. Here, fibre businesses lay fibre to premises (and are paid to do so). Then, a customer can order from any number of broadband providers, and the company who originally laid the fibre lease that line out at wholesale prices. The broadband operator runs ‘over the top’ of whoever installed the fibre.

That way, the fibre installer makes money over time, gently and progressively. All broadband companies and smaller ‘Alt-Nets’ as we call them, have an equal opportunity to a customer base. Finally the customer has the choice to find services matching their needs and price points. Pay a lot get a lot, pay less get less.

I think I have a choice of 6. Names which come to mind are EE, Vodafone, Virgin, Trooli, Cuckoo and Orange.

Zorsith ,
@Zorsith@lemmy.blahaj.zone avatar

Meanwhile, in the US, the government paid ISPs for fiber to be ran and they just pocketed it instead.

Now we’ve got smaller companies running fiber and charging less for synchronous gigabit than you’d pay for copper 500mb down 5mb up, and ISPs are panicking a bit.

All the fiber maps have big empty zones where apartment complexes are, sadly.

VitabytesDev ,

Here in Greece, we have three providers, but I don’t want to change, since we pay very little money to the one I am in right now in return of slower speeds (5 Mbps download, 0.5 Upload).

Aux ,

5Mbps? OMG…

NeatNit ,

While I agree that it’s awfully low nowadays, kudos to them if they know that’s all they need.

oldfart ,

Oh no, a cheap offer! 🙀

Takumidesh ,

5 Mbps is slow enough that it should be considered a free tier, like, basic service for being alive tier.

calcopiritus ,

Not always possible. In Spain IPv6 adoption is at like 5%. There’s literally no ISP that offers it. I don’t even know how that 5% got it, maybe special deals.

cellardoor ,

Yes just had a look, according to Google countrywide it’s 10%. Very low, sadly. Neighboring France at 74% IPv6. Interesting to see the difference even with neighbouring countries.

JackbyDev ,

As soon as fiber covers the final < 0.5% of my city with fiber (🤞 but I doubt it will happen) I’ll switch off of cable. Until then I can use cable with one provider or DSL with another.

KillingTimeItself ,

move providers? Where, to who? There is currently one provider where i live, soon potentially to be two. Though it’s not finalized yet, nor constructed, so for all intents and purposes, it’s just the one provider.

ytg ,

Mine provides a connection, but doesn’t expose ports on v6. So I can access v6 services but can’t self-host any.

NeatNit ,

Huh? With IPv6 you get your own IP address, the ISP doesn’t need to know shit about ports. Your address is not behind a NAT anymore, and ports don’t need to be forwarded.

Perhaps you mean the ISP set up a firewall that blocks incoming connections? In which case, maybe you can have that firewall disabled? ISP firewalls and “safe browsing” packages are always shit.

To be honest though there might be some aspect to this I don’t know.

Blackmist ,

Honestly, I was there the first time round, when everyone raw dogged the internet on a single modem per PC. I remember Blaster, and talking people through removing it in 60 second bursts as their PCs shut down over and over.

It was carnage. The average user doesn’t need open ports on the internet, and they’ll only get their elderly machines infected instantly if they did.

ytg ,

No option to disable… that I found, that is.

ngn , in Roses are red, violets are blue, everyone is using IPv6, why aren't you?
@ngn@lemy.lol avatar

whats the problem with IPv4?

NakedGardenGnome ,

Their ranges are running dry. Nearly all address spaces are taken, so we will need to migrate eventually. However, since almost everyone still supports both, and ipv4 is much easier to read and maintain, adoption of IPv6 has been slow.

chris ,
@chris@l.roofo.cc avatar

IPv6 changed some things. First and foremost it has a huge address space:

  • IPv4: 4294967296 (2^32)
  • IPv6: 340282366920938463463374607431768211456 (2^128)

Then they simplyfied some things:

  • Removed Broadcast in favor of Multicast and Anycast
  • Added autoconfiguration without a DHCP server
  • Better subnetting support

And much more

JohnEdwa ,

They went just a teeny tiny little bit overboard with the address space. Ipv4 is four groups between 0 and 255, ipv6 is eight groups of four digit hex, 0000 to ffff - e.g the Google DNS ipv4 address is 8.8.8.8. the ipv6 one is 2001:4860:4860:0:0:0:0:8888 (thankfully at least some devices allow using :: to skip all the zeroes, so it’s “just” 2001:4860:4860::8888)

But we now have enough ipv6 addresses to give more than 10 billion ipv6 addresses to every single grain of sand on earth, and still have some left over.

chris ,
@chris@l.roofo.cc avatar

They never wanted to worry about address space size again. And this makes subnetting much easier. I have a /56 allocation so I could do 256 /64 subnets. I hope that at some point home routers will have the option for seperate subnets built in. This way you could easily have guest, IoT, work or whatever networks without NAT.

One thing you have to consider though is that the minimum network size that allows autoconf is /64 and that because of the privacy extension a device usually has 3-4 IPv6 adresses.

KillingTimeItself ,

They went just a teeny tiny little bit overboard with the address space.

as is seemingly standard for bit range increases. y2038 is now y2,900,000,000 due to added a silly amount of bits.

ngn ,
@ngn@lemy.lol avatar
  • we already have enough IPv4 addresses thanks to stuff such as NAT and CG-NAT, these devices also protect the end-user by not directly exposing their IP to the internet
  • what’s the problem with broadcast? also afaik IPv4 also supports multicast
  • what’s the problem with IPv4 subnetting?
chris ,
@chris@l.roofo.cc avatar

In my opinion NAT is a hack that makes lot of things harder than they should be. STUN and TURN are services that are created because there is no easy way to connect two hosts between different NATs. UPnP for port forwarding is another. CG-NAT is even worse. I have heard of so many people having problems with it.

Breadcast is messy. It is like screaming into a room and waiting for an answer. Multicast lets the computer decide if it wants and needs to listen to a specific group message.

IPv4 didn’t have cidr from the beginning. They only had classes. IPv6 was designed with complex routing and sub routing in mind.

smileyhead ,

Imagine getting out of phone numbers, so the solutions is for everyone to call the last remaining people with public/routable numbers 24/7 so those people would redirect messages to others.

With Internet, users does not see that easly, but if you host anything for others it’s getting harder and harder to accept incoming connections without many layers of hacks to bypass hacks that ISPs do to keep IPv4 network working.

KillingTimeItself ,

IPV4 has a static ceiling for how many addresses can exist. We’re concerningly close to that ceiling already. If we were to run out, internet suddenly becomes a fucking nightmare.

rottingleaf , in Roses are red, violets are blue, everyone is using IPv6, why aren't you?

I’m using ipv6 when I occasionally connect to Yggdrasil.

And I think I’ll use ipv6 if we ever need to build a new earthnet.

It’s a fine technology.

technom ,

What do you do on the yggdrasil network?

rottingleaf ,

Google some sites, visit some empty IRC channels, dream of the future for a bit, then turn it off

technom ,

I wish there was something more interesting to do there.

starman , in Roses are red, violets are blue, everyone is using IPv6, why aren't you?
@starman@programming.dev avatar

How do you guys remember IPv6 addresses?

efstajas ,

Assign a DNS name

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

Is it possible to do that for router/access point running OpenWRT?

I have to try it when I’ll be back home.

Edit: turns out that all devices connected to router are accessible from <hostname>.lan. I don’t remember setting it up, tho.

BarbecueCowboy ,

Probably, look into dnsmasq? I believe that was the easiest way with openwrt back in the day.

starman ,
@starman@programming.dev avatar

Thanks

smileyhead ,

Even better, if that’s not something available from outside, to just enable mDNS.

starman ,
@starman@programming.dev avatar

Wow, that’s so cool. Thank you, I’ll implement it in my LAN.

fruitycoder ,

You can shorten them sometimes, the neatest trifk I saw was putting leetspeak words in the address.

JackbyDev ,

CAFE, BABE, BEEF, DEAD, and of course, 1337.

bfg9k ,

You shouldn’t need to remember IP addresses, they invented DNS to solve that problem lol

Even so, the addresses can be even easier to remember because we get a-f as well as digits, my unique local subnet is fd13:dead:beef:1::/60 cause I like burgers haha

SpaceCadet ,
@SpaceCadet@feddit.nl avatar

You do need to know it when you’re working with subnets and routing tables.

Unless you have anything but a flat network structure with everything in one subnet, working with IPV6 is a giant PITA.

bfg9k ,

I’m curious how you normally deploy since there’s a couple of ways to do it, I’ve mostly dealt with requesting a number of prefixes from the upstream router and delegating to each subnet/VLAN as appropriate, and each time I’ve done it it’s been a breeze

Even if you need static addressing you can just set it manually and DAD will handle it if it ever conflicts with a DHCP address, at least in my experience

SpaceCadet ,
@SpaceCadet@feddit.nl avatar

It’s when you have to set static routes and such.

For example I have a couple of locations tied together with a Wireguard site-to-site VPN, each with several subnets. I had to write wg config files and set static routes with hardcoded subnets and IP addresses. Writing the wg config files and getting it working was already a bit daunting with IPv4, because I was also wrapping my head around wireguard concepts at the same time. It would have been so much worse to debug with IPv6 unreadable subnet names.

Network ACLs and firewall rules are another thing where you have to work with raw IPv6 addresses. For example: let’s say you have a Samba share or proxy server that you only want to be accessible from one specific subnet, you have to use IPv6 addresses. You can’t solve that with DNS names.

Anyway my point is: the idea that you can simply avoid IPv6’s complexity by using DNS names is just wrong.

SynopsisTantilize ,

Yes. However I can just avoid using ipv6 by NATing the fuck out of my network lol. Kick that can!

SpaceCadet ,
@SpaceCadet@feddit.nl avatar

You don’t even have to NAT the fuck out of your network. NAT is usually only needed in one place: where your internal network meets the outside world, and it provides a clean separation between the two as well, which I like.

For most internal networks there really are no advantages to moving to IPv6 other than bragging rights.

The more I think about it, the more I find IPv6 a huge overly complicated mistake. For the issue they wanted to solve, worldwide public IP shortage, they could have just added an octet to IPv4 to multiply the number of available addresses with 256 and called it a day. Not every square cm of the planet needs a public IP.

smileyhead ,

You can subnet it with the exact same rulea as IPv4, nothing is chaning there.

Replace, for example, 192.168. with fd01::, with digits after this being divided however you like. You might step upon a too basic router that has it’s own way to assign addresses with no way to change it, but that would not be IPv6 fault.

smileyhead ,

Since I bought a domain name I do not remember IP addresses. Just like I don’t remember password since I installed password manager or not remember phone numbers since I have a smartphone.

It’s only annoying when being on someone’s else computer without my clipboard sharing setup and need to copy an address by hand. But that’s an issue when setting something up. I would take this inconvenience while setting up than all everyday inconveniences that IPv4 created in last years.

KillingTimeItself ,

hosts.txt

dns, VPN setups. ETC we live in 2024, there are solutions to this problem.

FQQD , in University Students
@FQQD@lemmy.ohaa.xyz avatar

I mean, it’s better to have to many comments than not enough

Darohan ,

Legit, I’ll take this over the undocumented spaghetti I too often see written by “professionals”.

Fal ,
@Fal@yiffit.net avatar

This is so wrong. I would absolutely prefer no comments over incorrect comments, which is exactly what happens when things get over commented

docAvid ,

It’s better to have useful comments. Long odds are that somebody who writes comments like this absolutely isn’t writing useful comments as well - in fact, I’m pretty sure I’ve never seen it happen. Comments like this increase cognitive overhead when reading code. Sure, I’d be happy to accept ten BS useless comments in exchange for also getting one good one, but that’s not the tradeoff in reality - it’s always six hundred garbage lines of comment in exchange for nothing at all. This kind of commenting usually isn’t the dev’s fault, though - somebody has told a junior dev that they need to comment thoroughly, without any real guidelines, and they’re just trying not to get fired or whatever.

Fades ,

Wonderfully said, I’ll be linking your response

henrikx , (edited )

Universities often teach students to write a lot of comments, because you are required to learn and demonstrate your ability to translate between code and natural language. But this is one of the things that are different in professional environments.

Every comment is a line to maintain in addition to the code it describes. And comments like this provide very little (if any) extra information that is not already available from reading the code. It is not uncommon for someone to alter the code that the comment is supposed to describe without changing the comment, resulting in comments that lie about what the code does, forcing you to read the code anyway.

It’s like if you were bilingual, you don’t write every sentence in both languages, because that is twice as much text to maintain (and read).

The exception of course, being if you are actually adding information that is not available in the code itself, such as why you did something a particular way.

Nevoic ,

Yup this is the real world take IME. Code should be self documenting, really the only exception ever is “why” because code explains how, as you said.

Now there are sometimes less-than-ideal environments. Like at my last job we were doing Scala development, and that language is expressive enough to allow you to truly have self-documenting code. Python cannot match this, and so you need comments at times (in earlier versions of Python type annotations were specially formatted literal comments, now they’re glorified comments because they look like real annotations but actually do nothing).

smeg ,

Exactly! Write your code to be as clear and self-descriptive as possible, and then add a comment if something is still not immediately obvious.

Starbuck ,

If I see comments explaining every other line, especially describing “what” instead of “why”, I assume the code was written by a recent grad and is going to be bad. Describing what you are doing looks like you are doing a homework assignment.

Like on that line, obviously we’re initializing a variable, but why 1 instead of 0? Could be relevant to a loop somewhere else, but I guess I’ll have to figure that out by reading the code anyways.

magic_lobster_party ,

It's like if you were bilingual, you don't write every sentence in both languages, because that is twice as much text to maintain (and read).

This is a very good analogy. And just like with natural languages, you might have an easier time expressing an idea in one language but not the other. Comments should provide information that you find difficult to express with code.

cheddar ,
@cheddar@programming.dev avatar

If there are too many comments, it means you have to support them just like the code itself. Otherwise, like any other documentation, comments will quickly go out of sync.

Tarogar , in University Students

There is usually no such thing as too many comments. There is a point to keep them to the point though

Fades ,

Who upvotes these terrible takes???

Give this comment a read: midwest.social/comment/10319821

sping ,

Well on Reddit, programmerhumor was mostly populated by people weirdly proud of how bad they are at their job, so I don’t see how Lemmy was going to be different.

Tarogar ,

Not to mention the fact that it’s programmer Humor. Not programming advice. which means that there are usually less serious comments to be found that may or may not be good advice. But I suppose some people have no sense of humour.

Tarogar ,

You know, you do you in Humor communities. I personally don’t expect to find the most serious of comments under posts in those.

Anyhow…Naturally there is a good argument to be made about making good comments. And that it may be a good idea to not comment things that are probably obvious. Just so that the file is a shorter read.

BeatTakeshi , in University Students
@BeatTakeshi@lemmy.world avatar

We all started somewhere

Fades ,

The problem is that many don’t leave the starting line

Cratermaker , in University Students

Software devs in general seem to have a hard time with balance. No comments or too many comments. Not enough abstraction or too much, overly rigid or loose coding standards, overoptimizing or underoptimizing. To be fair it is difficult to get there.

MagicShel ,

It’s an art, not a science. Which is where I think a lot of people misunderstand software development.

Varyk , (edited ) in University Students

me what it’s about

print(“tell me about it”)

user224 , in University Students
@user224@lemmy.sdf.org avatar

I am not a programmer, I just barely wrote one bash script in the past. But I’d say more comments are better than too few.

When I later wanted to edit it, I got completely lost. I wrote it with absolutely no comments.

01101000_01101001 , (edited )

While this is true, an alternative is to name your variables and functions descriptively so that when you see number_of_cats you know that variable is the number of cats, and buyAnotherCat() is a function that increases the number of cats.

riodoro1 ,

Bash is a shit „language” and everytime i need to write the simplest thing in it I forget which variable expansion I should use and how many spaces are the right amount of spaces. It’s impossible to write nice to read bash, but even in C you can write code that comments itself.

AProfessional ,

bash sucks but i don’t agree. Some simple rules like regularly use intermediate variables with useful names and never use shorthand arguments goes a long way.

marcos ,

It’s perfectly possible to write nice to read bash, and to also make is safe to run and well-behaved on errors.

But all the three people that can do those (I’m not on the group) seem to be busy right now.

Manifish_Destiny ,

Yeah you lost me at well behaved.

Manifish_Destiny ,

Still better than powershell though

Fades ,

Wrong. Too many comments makes the code messy and less readable and also it provides ZERO value. Just look at the post, WHAT is useful about ANY of that comment???

All it is is a waste of goddamn space, literal junk crowding the actual code.

I love how you admit you aren’t a developer but feel quite confident to tell us that a larger number of comments automatically means it’s better.

This person articulated it better than I: midwest.social/comment/10319821

LwL ,

Too many is still better than too few, and it’s not close. Useless comments make parsing a bit harder. Missing comments can mean hours of research.

sping ,

These are arguments talking past each other. Sure 1 useful comment and 9 redundant ones can be better than zero, but comments are not reliable and often get overlooked in code changes and become misleading, sometimes critically misleading. So often the choice is between not enough comments versus many comments that you cannot trust and will sometimes tell you flat-out lies and overall just add to the difficulty of reading the code.

There’s no virtue in the number of comments, high or low. The virtue is in the presence of quality comments. If we try to argue about how many there should be we can talk past each other forever.

floofloof ,

I’ve been programming for almost 25 years and I’d still rather see too many comments than too few. A dogmatic obsession with avoiding comments screams “noob” just as much as crummy “add 1 to x” comments. If something is complex or non-obvious I want a note explaining why it’s there and what it’s supposed to do. This can make all the difference when you’re reviewing code that doesn’t actually do what the comment says it should.

AeonFelis , in Roses are red, violets are blue, everyone is using IPv6, why aren't you?

I’ll start using it after I migrate to Wayland.

MagicShel , in Defragged Zebra
General_Effort ,

Ahh. TV shows before everything became political. Just two guys hating each other for very silly reasons completely unconnected to anything on earth.

enteroninternet ,
@enteroninternet@lemmy.dbzer0.com avatar

Needs an /s

bluey ,
vk6flab , in Defragged Zebra
@vk6flab@lemmy.radio avatar

I’m glad you defragged it, rather than fragged it…

lseif ,

its pride month you cant say ghat word

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