Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Presto
Nov 22, 2002

Keep calm and Harry on.
So, how 'bout that IPv6, eh?

I'm trying to update some code at work so that when someone someday decides that we need to make the switch to IPv6 I can slack off.

I have code similar to this:
code:
struct sockaddr_storage some_box;
socklen_t some_size;

...

some_size = sizeof(some_box);
cfd = accept(sfd, (struct sockaddr *)&some_box, &some_size);
When I connect a socket from the same machine using the IPv4 address, and I pull the address info of some_box (with inet_ntop), I get the actual IP address of the machine. If I connect using the IPv6 address, I get the loopback address instead. I've looked at the actual bytes in the some_box struct, and the accept() really is putting the loopback in there, so it's not inet_ntop's fault.

The server- and client-side sockets are set up in exactly the same way for both, except the address family for one is AF_INET and the other is AF_INET6. This is on Linux if it makes a difference.

I can work around this, but it's kind of a wart. Is this the intended behavior? Is it because my IPv6 address really a fake being tunneled back to the IPv4 address? Or what?

Adbot
ADBOT LOVES YOU

Presto
Nov 22, 2002

Keep calm and Harry on.

apropos man posted:

Cool. I looked at PyCharm and I think you have to pay for it? We're looking for something preferably free to start off with, so I'll look at VSCode as well.

EDIT: Can we actually use PyCharm for free?

The community edition is free.

Presto
Nov 22, 2002

Keep calm and Harry on.
C++ is fine as long as you stick to the basics (ie, ignore templates and all that template metaprogramming stuff).

Presto
Nov 22, 2002

Keep calm and Harry on.

Hammerite posted:

I don't see that there's anything inherently absurd about a 3-space indentation increment.
Because it's not 4, which is clearly the correct number.

Presto
Nov 22, 2002

Keep calm and Harry on.

Pennywise the Frown posted:

I'll certainly check that out. Looks like a lot of it is about breakthrough 90s tech lol.
It was co-hosted by Gary Kildall, who invented CP/M and founded Digital Research, and if a meeting with IBM had gone differently, everyone would've been using CP/M instead of MS-DOS and Bill Gates might be just another face in the crowd.

Presto
Nov 22, 2002

Keep calm and Harry on.

ultrafilter posted:

Code you wrote sufficiently long ago is someone else's code.
And "sufficiently long ago" might be "this morning".

Presto
Nov 22, 2002

Keep calm and Harry on.

rjmccall posted:

If another language is only half as good as Fortran in the abstract, but its tools and ecosystem are ten times better because it’s got three or four orders of magnitude more users, and that also means you can actually hire expert programmers in it instead of having all your code be written by novices, it’s very likely you’ll got better results overall.

The other half of this though is that if your other language just isn't as good at doing what you want to do then it doesn't matter how good your programmers are.

If you're doing heavy duty simulations, like simulate-the-atmosphere-over -the-entire-planet level simulations, then you're probably using Fortran somewhere because it still kills at math.

Presto
Nov 22, 2002

Keep calm and Harry on.

nelson posted:

The general feeling I got from Java was it focused more on organizing things in layers of indirection and actually doing something was just a happy side effect. With python especially but even with C#, getting to the action is more the focus.

Yeah I'm not a Java programmer, but I remember when it was on the rise, and everybody was hyping the "write once run anywhere" idea, but somewhere along the way (and I don't know where) they went hard into "Thou shalt write strict object-oriented code".

I bought a Java book at one point when I was looking for a new job, and it was almost condescending about how if you're not doing OOP you're doing it wrong.

Presto
Nov 22, 2002

Keep calm and Harry on.
Early on they didn't seem to be so hardcore about it though. Could just be my perception, since apart from a couple tiny college homework assignments in the md 90s, I haven't touched Java directly.

Adbot
ADBOT LOVES YOU

Presto
Nov 22, 2002

Keep calm and Harry on.
If you ever read the changelogs for game updates sometimes you'll see very specific stuff like "fixed problem of armor not appearing in chest after talking to village blacksmith with dwarven fighter character" and you just know the code is a big ol' nest of switch/cases and if/elses.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply