[-] aloso@programming.dev 2 points 11 months ago

I can't remember ever needing more than two question marks (??), and even that is very rare in my experience.

[-] aloso@programming.dev 4 points 1 year ago

No it's not, it is 100% a unit type (except it's not really a type, since you can only use it as return type and nowhere else)

[-] aloso@programming.dev 4 points 1 year ago
  • Svelte/Vue/React components need to be compiled
  • JavaScript should be minified if the project has a significant size
  • File names should have a content hash, so they can be cashed in the browser
  • Even with HTTP/2, there's still a case to be made for bundling hundreds or thousands of JS modules into a single file for better performance
  • Bundlers give you a dev server with live reload and hot module replacement for great developer experience
  • Setting up Vite is really easy and requires minimal configuration (compared to Webpack, for example)
[-] aloso@programming.dev 4 points 1 year ago* (last edited 1 year ago)

Easy interop with legacy code is how kotlin took off, so maybe it will work out?

Good interop was a requirement for widespread adoption, but not the reason why programmers want to use it. There's also null safety, a much nicer syntax, custom DSLs, sealed classes, type inference, data classes, named and optional arguments, template strings, multi-line strings, computed properties, arbitrary-arity function types, delegation, custom operators, operator overloading, structural equality, destructuring, extension methods, inline functions and non-local control flow, reified types, ...

Some of these features have since been added to Java.

[-] aloso@programming.dev 3 points 1 year ago

Actually, it's not a package repository (it doesn't store crates), it's "just" a website to display metadata from crates published on crates.io. It also shows certain information from docs.rs, GitHub, rustsec.org, etc, and has many useful features that the crates.io website lacks, including a pretty good full-text search.

[-] aloso@programming.dev 3 points 1 year ago* (last edited 1 year ago)

I started another, even bigger flag at (960, 830). Feel free to help!

P.S. I also started an ace flag, a non-binary flag, with more to come :)

[-] aloso@programming.dev 5 points 1 year ago

Even if this was true in 2013, when this article was written, the more accurate answer today would be "it depends".

In Rust, there are multi-threaded async executors implementing M:N threading (e.g. tokio), where M asynchronous tasks are mapped to N operating system threads. So when you await, the rest of the function may very well run in a different OS thread.

Swift also has async/await, and like tokio it uses multiple threads to run concurrent tasks in parallel (therefore using multiple OS threads).

Scala's equivalent to asynchronous tasks are Promises, which can also run in parallel, as I understand it.

Kotlin doesn't have async/await, but it has a similar concept, coroutines, which are basically a superset of asynchronous tasks. While Kotlin's coroutines are single-threaded by default, there is a multi-threaded implementation, enabling truly parallel coroutines.

Go also uses coroutines (which it calls "goroutines"), which can use multiple threads.

C++ will soon get coroutines as well, which support multithreading to run coroutines in parallel.

[-] aloso@programming.dev 3 points 1 year ago

My Fairphone is 4 years old, it has been dropped on the floor (even hard surfaces like rocks and asphalt) countless times. It still works and looks like new. It has a protective cover that covers the edges, but not the screen or the back. It still survived all these years without a scratch.

[-] aloso@programming.dev 3 points 1 year ago

Is that Professor McGonagall

[-] aloso@programming.dev 6 points 1 year ago

Lemmy is like Reddit, which is used a lot to ask questions and get help. But StackOverflow fills a different niche, it's meant to be useful to as many people as possible and stay up to date. This is why

  • there's a distinction between "comments" and "answers" (comments can be used to request additional information, and for meta discussion)
  • both questions and answers can be modified by other users, for example to
    • add more information, or remove unnecessary details
    • correct outdated information
    • fix typos and formatting
    • rephrase sentences that are confusing
  • a question can be closed as duplicate, so people always find the oldest thread of the question with the best/most detailed answers
  • before submitting a question, you get a list of related questions to avoid creating a duplicate question
  • questions have tags, making them easier to search for
[-] aloso@programming.dev 6 points 1 year ago

We have pointers in Rust, too :) see documentation

[-] aloso@programming.dev 6 points 1 year ago

Fully agree with what you said. There are still just as many passionate people fascinated by computers in the youngest generation as there are in older generations. It's just that the sheer number of programmers has made them less visible in recent years.

Also, one thing the article misses is that programming 8 hours a day and then continuing to program in your spare time is not healthy for many people. People are different, and there are some who can do it without negative consequences, but for others it can lead to burnout, especially if they also have a family to take care of or other issues to deal with. I used to do a lot of programming in my spare time when I was in college. Now that I have a 40-hour-a-week job, I've learned that I need to be careful how much energy I spend, and I don't do as much open source work because I need a lot of my free time to rest and recharge.

view more: ‹ prev next ›

aloso

joined 1 year ago