Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror

Comment Re:It always starts like this... (Score 2) 87

The problem with the 10th is that the federal government will still grab as much power as they want, because they can just interpret their enumerated powers as broadly as they want. For example, the commerce clause - it's been made nearly worthless at this point, as the federal government is able to regulate things that are neither interstate nor commercial thanks to disastrous SCOTUS decisions. Fortunately, more recent decisions have backed away from those a little bit, but it has taken 80+ years just to chip away at it.

Comment Re:Stand up for traditional bitmaskulinity! (Score 1) 108

Sorry but this is still wrong on a number of counts.

I specifically mentioned system resources. For any non-trivial application, the mapping of authentication to sockets should be a miniscule part and it only applies if your application absolutely needs to use raw sockets. If you can use Websockets over https, the entire thing can be managed by the Servlet infrastructure (part of the Java standard) and you won't have to think about that at all.

GGP did not limit the scope to just system resources. System resources are usually not the issue anyway. Nobody says that an app is a "resource hog" because it left a few file descriptors open. They say it's a resource hog because it's using 4GB of RAM to do nothing. The socket to user mapping is merely an example - you're supposed to extrapolate it to whatever use case you have.

You really don't need to think about interning strings. Any string constants in your code get automatically interned by the compiler (which is why you shouldn't use them as lock objects.) If you're really worried about saving a few bytes of memory, put your strings in a HashMap.

You absolutely should be thinking about this. I can tell you've probably never used Java Mission Control or similar, since it will outright show you how much memory is being wasted to duplicate strings. If you're, let's say, parsing XML files, you're going to see lots of small duplicate strings in the tag names. Same thing with a log parser, or anything else handling textual data. HTTP server? Yeah, you're gonna see a lot of similar strings in headers and such.

The reason you are thinking about memory when writing Java is that you are thinking of Java as a C/C++ variant with garbage collection. It's not. Java is it's own language.

No, I'm thinking about memory because I don't want my program to eat all of a user's RAM for no reason, or to inflate cloud bills because we have to allocate twice the RAM for JVM instances.

If you tried to write Lisp like it were an imperative language, you'd find it frustrating too. Same with JavaScript.

If you find yourself thinking about memory management in Java, you're probably approaching the problem wrong. Best to step back and reconsider than immediately blame the language.

Who says it's frustrating? Who says the language is the problem? Java code will typically use less memory than the equivalent in Python, JS, and other high-level languages. It packs objects' fields much more efficiently, and supports primitives. However, a bad programmer can still destroy that efficiency by thinking that they don't need to worry about memory. Just because the language handles garbage collection of unreachable objects doesn't mean you can just forget about memory usage.

Comment Re:Stand up for traditional bitmaskulinity! (Score 1) 108

You still have to think about a lot of memory-related things to make applications memory-efficient and free of memory leaks.

For example, somewhere in my code, I might have a map from sockets to users, to keep track of which user is authenticated on any given socket. However, I need to either make absolutely sure that I am removing mappings from that when a socket terminates through any means - even unclean ones - or, I need to use weak references to make the garbage collector do that for me. The fact that just about every language with managed memory supports weak references should be a hint that you still have to think about it.

You also have to think about things like what strings to intern. If you know you're going to have tons of duplicate strings, it might make sense to intern them. But not if you're going to have many distinct streams, in which case you just inflate the string pool too much.

Comment Re:Why? (Score 1) 86

Part of the issue is that creators have their own sponsored segments in their videos, so you're still supporting them even if you block ads, and it means that YT premium isn't even an "ad-free" experience in the first place. I'd much rather support creators directly anyway, especially seeing as creators are often forced to alter their own content just to make advertisers happy.

Comment Seeing some convergence (Score 2) 30

One thing I've noticed is that languages seem to be more likely to adopt features from other languages. For example, Java has virtual threads now, which reduces some of the advantage that Golang has over it in heavily asynchronous tasks. GIL-less Python will eliminate one of the major downsides of Python. Typescript has polished the JS turd enough to make it a usable language.

At this point, getting traction for a new language is incredibly difficult. You not only have to fight the uphill battle of other languages having massive collections of libraries, but also the fact that your language's killer feature could very likely be integrated into an existing language.

Comment Re:There is overhead but it's not junk (Score 1) 117

It has also made many of these tasks far easier.

For example, if I want to host several different websites, possibly with different backend languages, it makes that easier - even if it's only on a single host. You would have to manually configure a web server to reverse proxy to the individual sites' directories or backend processes, figure out certificate provisioning for all of the domain names, update DNS records, deal with updates/deployments, and so on. That's not even considering things you'd need to be truly prod-ready, like blue-green deployments, failover, or limiting resources of each site so that it doesn't crash the host if it goes haywire.

In k8s, I can just push my containers to a registry, use ingress objects to specify the hostname/paths of each domain, do certificates automatically via LetsEncrypt or similar, blue-green, resource management, and many others. Sure, you could do all of that manually, with or without containers, but you'd essentially just be reinventing the same thing but not scalable.

Comment Re:mouse and keyboard blocked banning all third pa (Score 1) 29

Did you miss the part where I said "I'm fine with segregating matchmaking based on input device"?

I don't choose input devices for the primary purpose of gaining a competitive advantage. I choose an input device based on what feels the most comfortable in the game. Any advantage is secondary, and is easily handled by just making separate matchmaking.

Comment Re:mouse and keyboard blocked banning all third pa (Score 1) 29

I don't know how I feel about the notion of "games that support it".

Having used the original Steam Controller, and now the Steam Deck, it's actually pretty cool how well those work for playing games that were never intended for controllers. I'm fine with segregating matchmaking based on input device, but the notion that you shouldn't be allowed to choose the peripheral that you wish to play a game with doesn't sit well with me (especially if it's a game where one type of input device is clearly better than others - e.g. a mouse in an FPS).

Slashdot Top Deals

Have you reconsidered a computer career?

Working...