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.

lemmy.ml

Aceticon , to programmerhumor in optimal java experience

I actually have a ton of professional Java experience and have done a lot of microcontroller stuff of late (for fun mainly) and if you go at doing software for ARM Cortex-M microcontrollers the Java way you’re going to end with overengineered bloatware.

It’s however not a Java-only thing: most of those things have too little memory and processing resources for designing the whole software in a pure OO way, plus you’re pretty much coding directly on the low-level (with at most a thin Hardware Abstraction Layer between your code and direct register manipulation) so only ever having used high-level OO languages isn’t really good preparation for it, something which applies not only for people with only Java experience but also for those whose entire experience is with things like C#.Net as well as all smartphone frameworks and languages (Objective-C, Kotlin, Swift).

odbol ,

I used to write a lot of performance-critical Java (oxymoron I know) for wearables, and one time I got a code reviewer who only did server-side Java, and the differences in our philosophies were staggering.

He wanted me to convert all my code to functional style, using optionals and streams instead of simple null checks and array iterations. When explained that those things are slower and take more memory it was like I was speaking an alien language. He never even had to consider that code would be running on a system with limited RAM and CPU cycles, didn’t even understand how that was possible.

eth0p ,

This may be an unpopular opinion, but I like some of the ideas behind functional programming.

An excellent example would be where you have a stream of data that you need to process. With streams, filters, maps, and (to a lesser extent) reduction functions, you’re encouraged to write maintainable code. As long as everything isn’t horribly coupled and lambdas are replaced with named functions, you end up with a nicely readable pipeline that describes what happens at each stage. Having a bunch of smaller functions is great for unit testing, too!

But in Java… yeah, no. Java, the JVM and Java bytecode is not optimized for that style of programming.

As far as the language itself goes, the lack of suffix functions hurts readability. If we have code to do some specific, common operation over streams, we’re stuck with nesting. For instance,

<pre style="background-color:#ffffff;">
<span style="color:#323232;">var result </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">sortAndSumEveryNthValue(</span><span style="color:#0086b3;">2</span><span style="color:#323232;">, 
</span><span style="color:#323232;">                 data.stream()
</span><span style="color:#323232;">                     .map(parseData)
</span><span style="color:#323232;">                     .filter(</span><span style="color:#0086b3;">ParsedData</span><span style="color:#323232;">::isValid)
</span><span style="color:#323232;">                     .map(</span><span style="color:#0086b3;">ParsedData</span><span style="color:#323232;">::getValue)
</span><span style="color:#323232;">                )
</span><span style="color:#323232;">                .map(value </span><span style="font-weight:bold;color:#a71d5d;">-></span><span style="color:#323232;"> value </span><span style="font-weight:bold;color:#a71d5d;">/ </span><span style="color:#0086b3;">2</span><span style="color:#323232;">)
</span><span style="color:#323232;">                ...
</span>

That would be much easier to read at a glance if we had a pipeline operator or something like Kotlin extension functions.

<pre style="background-color:#ffffff;">
<span style="color:#323232;">var result </span><span style="font-weight:bold;color:#a71d5d;">=</span><span style="color:#323232;"> data.stream()
</span><span style="color:#323232;">                .map(parseData)
</span><span style="color:#323232;">                .filter(</span><span style="color:#0086b3;">ParsedData</span><span style="color:#323232;">::isValid)
</span><span style="color:#323232;">                .map(</span><span style="color:#0086b3;">ParsedData</span><span style="color:#323232;">::getValue)
</span><span style="color:#323232;">                .sortAndSumEveryNthValue(</span><span style="color:#0086b3;">2</span><span style="color:#323232;">) </span><span style="font-style:italic;color:#969896;">// suffix form
</span><span style="color:#323232;">                .map(value </span><span style="font-weight:bold;color:#a71d5d;">-></span><span style="color:#323232;"> value </span><span style="font-weight:bold;color:#a71d5d;">/ </span><span style="color:#0086b3;">2</span><span style="color:#323232;">)
</span><span style="color:#323232;">                ...
</span>

Even JavaScript added a pipeline operator to solve this kind of nesting problem.

And then we have the issues caused by the implementation of the language. Everything except primitives are an object, and only objects can be passed into generic functions.

Lambda functions? Short-lived instances of anonymous classes that implement some interface.

Generics over a primitive type (e.g. HashMap<Integer, String>)? Short-lived boxed primitives that automatically desugar to the primitive type.

If I wanted my functional code to be as fast as writing everything in an imperative style, I would have to trust that the JIT performs appropriate optimizations. Unfortunately, I don’t. There’s a lot that needs to be optimized:

  • Inlining lambdas and small functions.
  • Recognizing boxed primitives and replacing them with raw primitives.
  • Escape analysis and avoiding heap memory allocations for temporary objects.
  • Avoiding unnecessary copying by constructing object fields in-place.
  • Converting the stream to a loop.

I’m sure some of those are implemented, but as far as benchmarks have shown, Streams are still slower in Java 17. That’s not to say that Java’s functional programming APIs should be avoided at all costs—that’s premature optimization. But in hot loops or places where performance is critical, they are not the optimal choice.

Outside of Java but still within the JVM ecosystem, Kotlin actually has the capability to inline functions passed to higher-order functions at compile time.

/rant

netvor , to programmerhumor in Alphabetically sorted months. But WHY?
@netvor@lemmy.world avatar

Months are an unnecessary and leaky abstraction, they don’t need to be taken seriously.

I agree with this programmer.

NerfHerder , to lemmyshitpost in Time to watch the puddles

Why did I hear this?

Honkinwaffles , to linux in What are the main challenges in Linux adoption for New users, and how can it be addressed?

The actual answer, there is no reason to switch. The vast majority of users do not care about Linux or why they would want to. For us there are lots of benefits and things we enjoy about getting away from Windows but for them “why?”

sundaylab ,

I will object on this one. Even if the majority of user does not care about privacy they do care about ransomware , viruses, speed of the system and in my opinion Linux / BSD is secure, fast and speed remains after time not like Windows where I felt that after 6 months I had to reinstall to get a performant system. I guess it is all about convincing your family and friends about those benefits.

Honkinwaffles ,

Two weeks ago my step mother asked me “Can you help my friend connect her PC to the wifi, it runs Windows XP” users are fucking weird.

xtapa , to linux in What are the main challenges in Linux adoption for New users, and how can it be addressed?

I recently changed and could only do it because of ChatGPT. There are a lot of things that work different in Linux, like package managers, the file system in general, the focus on terminal, stuff that works different with different distros. For almost all questions, ChatGPT helped me within seconds. This is even more true, when I kinda don’t know, what my question actually is. Then it helps to give me some good buzzwords to Google for. If I would have done this with just reddit and forums and stack or something, I’d get so much non-helping, gatekeeping, belittling answers - if any.

cybersandwich ,

It’s incredibly powerful when used like this. The real time nature of it is super nice. If you have a quick question, you almost can’t beat it.

Another thing it is great for us explaining what commands do. So if you are following a tutorial or blog and want to double check that a command is safe, it’s great at that.

xavier666 , to linux in What are the main challenges in Linux adoption for New users, and how can it be addressed?
  1. Installation process of Linux is complicated to an average Joe (Bootable USB/ISO file/Boot priority/format <- what are these scary terms?)
  2. Lack of availability of pre-installed Linux PCs at physical shops
  3. Lack of availability of industry-standard software
  4. Confusion for an average Joe due to excess choice of distros/application packaging format. Average people don’t want choices, they want to be guided.
  5. (Minor point) Most available guides for doing something heavily requires terminal usage which can be daunting to new users
CaldeiraG , to linux in What are the main challenges in Linux adoption for New users, and how can it be addressed?

Probably just hardware compatibility and me specifically NVIDIA x) once you get the kinks sorted out it’s a pretty stable experience

undisputed_huntsman , to linux in What are the main challenges in Linux adoption for New users, and how can it be addressed?

Many comments here largely underestimate an average non linux user.

snek_boi ,
lloram239 , (edited ) to linux in What are the main challenges in Linux adoption for New users, and how can it be addressed?

I found repartitioning the harddrive by far the biggest hurdle. That’s a complicated and scary process that can delete all your data if you hit the wrong button. Picking the right partition sizes is another problem, as the Windows default EFI partition for example is far too small to be used with distributions that put their kernel on there (e.g. NixOS), but there is nothing warning you about that and resizing it, is complicated since there is a Windows partition in the way. The solution already existed in the form of Wubi, which made your whole Linux installation a file on your Windows partition, but that got sadly abandoned.

Next biggest problem is the boot manager, they still suck and are far to brittle. I’d wish we got rid of boot managers as is, and instead just booted into a mini-Linux has boot manager, that could not only be used to fix bad boot configuration, but also used as full recovery system. Having a full OS as boot manager means you can update and change the whole OS without fumbling with USB sticks and stuff, you can even update or switch distributions remotely. It’s an extremely powerful setup, that as far as I know, none of the popular distributions uses.

Finally, just having stuff work. My amdgpu driver still crashes regularly. There is always some obscure crap I have to configure to make things work. And I regularly have to search the Internet to find solutions for my problems. Can we have some (opt-in) Telemetry here? A tool that can scan my hardware and error logs, tell me what I have and tell me if it works in Linux or direct me to an bug tracker with workarounds? ProtonDB for hardware, kind of. Why do I still have to do that manually?

Another big hurdle of course is just the software, even if everything runs perfectly on the Linux side, moving all your software over is always a big hurdle. Wine/Proton helps a lot, but still fiddle for stuff outside of Steam. Not really seeing any easy solution here. Something like Xen installed by default that lets you switch OSs without dual booting might work, or a VM that can boot into your actual Windows partition, but no idea if that would work well enough to solve more problems than it creates.

All that aside, the problems for new users are a bit overrated. Installing Linux is something you do once or twice, that process of course needs to work well enough to function, but it’s far more important that the OS works well once you are past that point. If the OS fails in daily use, that’s when people abandon it. Enduring a shitty installer for a weekend is not really that big of a deal in the bigger picture, if the OS you’ll end up with is actually worth it.

Little aside: Why the f’ is ‘parted’ not the command line version of ‘gparted’? As far as I know, there is no command line tool left that allows you to move and resize partitions via command line in a single UI. That functionality was ripped out of ‘parted’ years ago, so you are stuck with manually fdisk, ext2resize, etc. which is not fun at all, since they all take sizes in different units and have different UI.

IvidappAvidapp ,
@IvidappAvidapp@mastodon.social avatar

@lloram239

That 'partitioning' part is absolutely 100% correct😔😔😔 it's scary for general users !

@fugepe

nomadjoanne ,

It’s tough for advanced users like me because I hardly ever need to do it. It’s not a routine task.

One of the few things I genuinely preper a GUI for because I feel I’m much less likely to make a fat-finger mistake.

bouh ,

Installing Linux is not a user problem. Most users wouldn’t be able to install windows. You will never have users easily partition a computer, especially if you want to keep data. Even most people working with computers wouldn’t be able to that!

You’re gravely misunderstanding what users need. If a computer is pre-installed and working, 90% of the problems are solved already. The actual problems are 1) to not break the system with an update, and this on two computers I updated once a year it didn’t happen for 5 years ; 2) have the softwares working

  1. is the big part : people will moan about not having office, but office365 is a thing and you can tell them to deal with it. Video games are the next big part, and with proton it’s almost as smooth as it could get
lloram239 ,

If a computer is pre-installed and working, 90% of the problems are solved already.

That’s a fantasy solution to a real world problem. Computers will never come with Linux preinstalled in large numbers. Even if they did, they’d come with a shitty distribution filled with adware that you’d want to reinstall anyway.

Installation of Linux on an already existing Windows system is an important problem that needs solving, and it feels like we barely made any progress there in 20 years (anybody remember umsdos?).

JackbyDev ,

You hit the nail on the head about telemetry. Every program that asks me to share crash reports I always turn it on. That’s just too useful for them to worry about some ideological puritanism about “privacy”.

lloram239 ,

The problem with telemetry is that it often happens in secret. You can never tell what it’s collecting and when it is sending it. When it happens in the open, than it can be great. Steam Hardware Surveys are a great example of this, you can see exactly what it sends and when, you can opt-out of it before it sends anything and you even get to look at the results of the survey.

That’s the kind of thing I’d love to have for Linux. Couple that with what errors are showing up in the kernel logs, what software versions people are running, and it would make it much easier to chose the right hardware for Linux.

undisputed_huntsman , to linux in What are the main challenges in Linux adoption for New users, and how can it be addressed?

Gatekeeping and elitism

yukiat , to linux in What are the main challenges in Linux adoption for New users, and how can it be addressed?
@yukiat@lemmy.world avatar

The number one issue for me was games.

Like seriously, why do most developers not give a damn about their Linux playerbase?

Smuchie ,

Most likely this will become less of an issue over the comming years due to the popularity of handheld Linux based devices such as the steam deck.

jflesch ,
@jflesch@lemmy.kwain.net avatar

Also thanks to Wine/Proton. You have to give it to Valve : overall it works surprisingly well.

ZIRO ,
@ZIRO@lemmy.world avatar

It does. I am disappointed in the game studios who refuse to allow Linux players, though, such as Bungie. I’m certain that Destiny would be playable if not for their obstinacy.

bouh ,

With proton now it is easier than ever! Right in steam. Lutris is awesome for almost all the others.

joejoe87577 ,

I saw this in a YouTube video about some indie video game. They had a native linux port. The userbase was like 99% windows and 1% linux, but 99% of the crash reports were from linux users.

This and the “problems” with adding anti cheat software that works with linux is just too much for most to bother.

ture ,
@ture@rational-racoon.de avatar

Might be because the average Linux user is way more aware of how useful a crash report can be and therefore actually submitted them. At least most Linux users I know actually read error/ crash messages and not just call someone saying there was some pop-up, I just clicked ok and the game was gone.

art , to linux in What are the main challenges in Linux adoption for New users, and how can it be addressed?
@art@lemmy.world avatar

The average user doesn’t give a shit about what OS they’re running. They also don’t know what tools they need. I remember a client who dropped $700 on Photoshop because “How else can I resize my photos?”

Linux is to hard for someone who doesn’t know why it’s bad to install multiple antivirus suites. People who don’t know the difference between a web browser and a search engine.

Linux will only ever be for hobbyist because they the only ones who give a damn.

Rukt , to programmerhumor in Gitar hero

“Babe, wake up. New sort algorithm just dropped!”

0xalivecow , to linux in What are the main challenges in Linux adoption for New users, and how can it be addressed?
@0xalivecow@infosec.pub avatar

I’d say its probably, among other thigs, hardware compatibility issues.

Running Linux on a mashine, most notably portable, that is somewhat recent and is not specifically built with linux in mind is, imo, almost certainly going to cause some, for the average user unfixable, issues. Things like wifi, bluetooth, audio, etc. not working due to missing or broken drivers.

The best way to fix that would be official Linux support by the OEMs, which realistically is never going to happen. Or extremely time consuming reverse-engineered community drivers.

bouh ,

That’s a wrong take. The issue is when you install Linux. Once installed and running, it works fine.

And users don’t install computers. So it’s not their problem. You merely need to not break you distro once it’s working. And if it’s not arch Linux it’s been a long time since I read it can break on an update.

Holzkohlen , to linux in What are the main challenges in Linux adoption for New users, and how can it be addressed?

I think that is not a question Linux users can answer. I feel so out of touch with what the average joe needs and wants in an OS. Ask them.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • lifeLocal
  • goranko
  • All magazines