• 0 Posts
  • 6 Comments
Joined 1 year ago
cake
Cake day: June 13th, 2023

help-circle

  • 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.


  • Whenever possible, it’s recommended to work in a common Git repository and use branching strategies to manage your work. However, if you do not have write access for the repository you want to contribute to, you can create a fork.

    A fork is a personal copy of the repository and all its branches, which you create in a namespace of your choice. Make changes in your own fork and submit them through a merge request to the repository you don’t have access to.

    https://docs.gitlab.com/ee/user/project/repository/forking_workflow.html

    How is this different from GitHub?

    Just to make sure there’s no misunderstanding: When I want to contribute to a project I’m not involved in, like inkscape, I’m not allowed to create a branch in their repo, so I have to fork it, which creates a copy of the repo, and sets the original repo as a remote.

    Note that git is a distributed VCS that doesn’t distinguish between servers and clients. Forking and cloning are the same operation from a technical perspective, except when you git clone, the copy ends up on your local machine, and when you press the “fork” button, the copy is on a GitHub/GitLab server.



  • 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.


  • 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