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.

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.

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.

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.

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.

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.

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.

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.

smeg , in Got no time to code

testing

If you don’t consider this part of “writing code” then I don’t want to run any of your code

void_main , in C++
Meowie_Gamer , in What a time to be alive
@Meowie_Gamer@lemmy.world avatar

Why are tech CEOs always so out of touch…

Knock_Knock_Lemmy_In ,

CEOs are generally the the sales(wo)men.

megopie ,

Because they’re playing a role, an actor so to speak, they’re not presenting their own personal opinions. They’re vocalizing and embodying the output of a series of complex internal mechanism, it’s a slow moving self optimizing system beyond the comprehension of any individual working with in the system.

Much like AI’s it often outputs stupid shit.

RecluseRamble , (edited ) in Roses are red, violets are blue, everyone is using IPv6, why aren't you?

Why should we care? So address space may run out eventually - that’s our ISPs’ problem.

Other than that I actually don’t like every device to have a globally unique address - makes tracking even easier than fingerprinting.

That’s also why my VPN provider recommends to disable IPv6 since they don’t support it.

MrRazamataz ,
@MrRazamataz@lemmy.razbot.xyz avatar

Because people in countries with ISPs that are unable to provide IPv4 (e.g. too expensive) can’t access GitHub easily.

umbrella , (edited )
@umbrella@lemmy.ml avatar

the only reason i can think of is cgnatting ipv4 because of depleted pool. otherwise yea.

i believe you can NAT ipv6 too, i mean so you use the router’s address only?

LordCrom ,

Yes you can.

Avatar_of_Self ,

You’d better hope that you can NAT ipv6 because if you aren’t behind a CGNAT and then your LAN is completely exposed without a NAT you’re very likely going to have devices exploited.

NATs on people’s boundary has been doing pretty much all of the heavy lifting for everyone’s security at home.

orangeboats ,

The word you are looking for is firewall not NAT.

NAT does not provide security whatsoever. If the NAT mapped your (internal IP, internal port) to a certain (external IP, external port) and you do not have a firewall enabled, everyone can reach your device by simply connecting to that (external IP, external port).

I haven’t seen routers that do not come with IPv6 firewalls enabled by default.

umbrella ,
@umbrella@lemmy.ml avatar

everyone can reach your device by simply connecting to that (external IP, external port)

to be fair thats the setup most people run when they open ports.

Avatar_of_Self , (edited )

The word you are looking for is firewall not NAT.

No the word I’m looking for is the NAT. It was not designed for security but coincidentally it is doing the heavy lifting for home network security because it is dropping packets from connections originating from outside the network, barring of course, forwarded ports and DMZ hosts because the router has no idea where to route them.

Consumer router firewalls are generally trash, certainly aren’t layer 7 firewalls protecting from all the SMB, printer, AD, etc etc vulnerabilities and definitely are not doing the heavy lifting.

By and large automated attacks are not thwarted by the firewall but by the one-way NAT.

orangeboats ,

Consumer router firewalls are generally trash

[Citation needed]

They are literally piggybacking on the netfilter module of Linux. I don’t see how that’s trash

Avatar_of_Self , (edited )

They are not layer 7 firewalls for the network which are going to be where most the majority of attacks are concentrated. No citation needed unless you believe they are layer 7 firewalls or using something like Snort.

Added some clarification in my first sentence so it makes a bit of sense.

orangeboats ,

Wait, why are we talking about Layer 7 when NAT and firewalls are Layer 4 at best?

Avatar_of_Self ,

Because, as I said:

layer 7 firewalls for the network which are going to be where most the majority of attacks are concentrated.

The NAT doesn’t have to operate at layer 7 to be effective for this because

coincidentally it is doing the heavy lifting for home network security because it is dropping packets from connections originating from outside the network, barring of course, forwarded ports and DMZ hosts because the router has no idea where to route them.

The point is that the SPI firewalls are not protecting against the majority of the attacks we’ve seen for decades now from botnets and other arbitrary sources of attacks, except, perhaps targeted DDoSing which isn’t the big problems for most home networks. They must worry about having their OS’ and software exploited and owned in the background, which doesn’t get much of an assist from a router’s firewall.

Obviously, this is however true for the NAT since the NAT are going to drop connections originating from outside the network attempting to communicate with that software to exploit it

barring of course, forwarded ports and DMZ hosts because the router has no idea where to route them.

orangeboats , (edited )

How is this “dropping packets” not applicable to firewalls, then? You are not just going to casually connect to my IPv6 device as we’re speaking. The default-deny firewall in my router does the heavy lifting… just like what NAT did.

Honestly, it just sounds like you need to brush up on networking knowledge. Repeat after me: NAT is not security.

Avatar_of_Self , (edited )

Are you saying that everyone’s router’s firewall drops all packets from connections that originate from outside of their network?

orangeboats ,

It’s a stateful firewall. It simply drops unsolicited packets.

Avatar_of_Self ,

So, really, you were “correcting” me for you and your specific setup at the very beginning because your router’s firewall has a deny rule for all inbound connections because I must have been confusing what a NAT and what a firewall is because I must have been talking about your specific configuration on your specific devices.

Holy. Fucking. Shit.

orangeboats , (edited )

Oh come on, are you seriously suggesting that default-deny stateful firewall is not the norm??

Holy. Fucking. Shit. Indeed.

You keep on suggesting to me that you really have no idea how networking works. (Which is par on course for people thinking NAT == security, but I digress)

Let me tell you: All. Modern. Routers. include a stateful firewall. If it supports NAT, it must support stateful firewalling. To Linux at least, NAT is just a special kind of firewall rule called masquerade. Disregarding routers, even your computer whether Linux (netfilter) or Windows (Windows Firewall) comes built-in with a stateful firewall.

Avatar_of_Self ,

Having a NAT on a consumer router is indeed the norm. I don’t even see how you could say it is not.

I never said NAT = security. As a matter of fact, I even said

It was not designed for security but coincidentally blah blah

But hey, strawmanning didn’t stop your original comment to me either, so why stop there?

Let me tell you: All. Modern. Routers. include a stateful firewall.

I never even implied the opposite.

To Linux at least, NAT is just a special kind of firewall rule called masquerade.

Right, because masquerade is NAT…specifically Source NAT.

I’m just going to go ahead an unsubscribe from this conversation.

orangeboats ,

Were I really strawmanning you? Is “I never even implied the opposite” really true? Quote:

So, really, you were “correcting” me for you and your specific setup

Yeah, my “specific setup”… which can be found in virtually all routers today.

laughterlaughter ,

even easier then fingerprinting.

than*

RecluseRamble ,

Auto-“correct”. Thanks, fixed.

Aux ,

That’s the dumbest thing I’ve read today… Your ISP is fleecing you and you’re happy with it.

RecluseRamble ,

What the fuck are you talking about? My ISP supports IPv6 just fine, but following my VPN’s advice I disable it (on certain devices at least) for privacy concerns. And it makes exactly zero difference in functionality.

Aux ,

OK, not your ISP, but your VPN is shit.

RecluseRamble ,

It’s Proton VPN. Lack of IPv6 support is a downer but I wouldn’t call them shit.

Edit: maybe elaborate why you deem IPv6 so crucial? As I said: everything works just fine without.

smileyhead ,

that’s our ISPs’ problem

If the Internet means for you a way to access Facebook, Netflix, Google and YouTube, yeah.
But if it means a network to send something to another computer then it’s a huge problem.

Because ISP won’t care if you can accept connections or not. They don’t care about decentralization and being able to host stuff yourself. Most consumers just want a pipe to big services and not to their friend’s house.

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

I use IPv6 at home, I selected my last few ISP’s because they had IPv6. Left one ISP when they removed IPv6 🤦‍♂️ .

If you can choose ISP choose one that offers IPv6 and let them know why.

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

I’m actually bit sad that I had to move onto a ISP which has zero IPv6 support, as I previously did have IPv6. The last thing I did on that connection was to debug the hell out of my IPv6 code I had developed.

snugglebutt ,
@snugglebutt@lemmy.blahaj.zone avatar

I feel you, moved ISP maybe 3 months ago, only to find out I’m behind CGNAT and no IPv6…

sep ,

That should simply not be allowed. Cgnat for ipv4 is fine if they also provide proper ipv6

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

People use IPv6?

I still don’t know anything about it

spacemanspiffy ,

Same. I have disabled it on my devices since it mostly just causes problems.

smileyhead ,

By disabling both v4 and v6 you can fix 100% of the problems.

Fred ,

Just under half of the Internet: www.google.com/intl/en/ipv6/statistics.html

sep ,

You do as well, if you run any operating system newer then the last 10 years.

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

Because I can remember an IPv4 address and not a V6 address!

At least they could have added an extra octet to v4 instead of making it garbyremoved looking

technom ,

You are not expected to remember a v6 address - or even v4 for that matter. They are designed for machines. DNS is designed for humans.

Turbo ,

This is a good (and fair) point.

However they still look ugly and scary and intimidating :)

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