this post was submitted on 25 Jul 2023
5 points (85.7% liked)

Programming

17433 readers
294 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS
top 2 comments
sorted by: hot top controversial new old
[–] glad_cat@lemmy.sdf.org 2 points 1 year ago (1 children)

It could happen, but we can do this right now with compiler warnings and linters. For example Calling “FooBar” without checking return value can be done with -Wall or [[nodiscard]]. Same for the grouping of merges. As for the merge conflicts, I don't believe anyone will ever be able to do this easily for the next 100 years unless you know what should be done in the merge, which cannot be deduced by a computer, but by talking to the involved developers.

[–] DarkPlayer@lemmy.world 0 points 1 year ago

Checking the return value is just a very basic example of a consistency check and is already supported by some tools. But I think we are heading towards more advanced and project specific checks, such as identifying missing authentication checks. This won't work based on hard coded rules or hints (like [[nodiscard]]) but will be detected because this API endpoint looks different from the others. However, even the return value example is still relevant. Something like [[nodiscard]] isn't supported by all programming languages nor is it used in all third party libraries or system header files.

Regarding semantic merges: You're right that automated tools will not be able to determine whether the merged code makes sense from a logical point of view. But that is not the point of this section. The main idea is that by parsing the code and merging the ASTs merge tools will be able to resolve conflicts even if there are changes on the same line. And they can determine whether the generated syntax would be valid. It is still up to the developer to verify that the merged code makes logical sense.