linked-list-good-taste
Linus Torvalds' linked list argument for good taste, explained (by mkirchner)
plusplus
Enables increment operators in Python using a bytecode hack (by borzunov)
linked-list-good-taste | plusplus | |
---|---|---|
12 | 9 | |
1,968 | 91 | |
- | - | |
0.0 | 1.7 | |
about 1 year ago | 11 months ago | |
C | Python | |
MIT License | MIT License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
linked-list-good-taste
Posts with mentions or reviews of linked-list-good-taste.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-11-12.
-
I wrote these short methods to remove a node from an unbalanced BST. Is it "bad style"?
I'm in a data structures course as an undergraduate over the summer. For practice, I made an unbalanced binary search tree class in C++ with search, insertion, removal. We were given pseudo-code for removal, but I noticed a lot of repeated logic could be used if I traversed the tree with a pointer to pointer to Node, and that it didn't need recursion. I saw the same logic as what's explained by "Linus Torvalds' linked list argument for good taste, explained", and I'm pretty familiar with it by now. My tree traversal about 40 lines of actual code, but about 70 lines with comments. However, I showed this to a classmate, and they couldn't follow it at all, and said that it seemed complicated. I'm also concerned because this logic isn't portable to any language that doesn't allow pointers to pointers, i.e. not in Java, Python, etc., only C, C++, and maybe Rust (I don't know if this is portable there).
-
What's the use of pointers-to-pointers?
One usecase I find kinda neat is for linked list algorithms. See https://github.com/mkirchner/linked-list-good-taste
-
Guess my favorite language based on my frustrated Python comments
Don't believe me? Check out Torvalds elegant solution to remove an item from a linked list using a pointer to pointer. This algo is unimplementable using references. https://github.com/mkirchner/linked-list-good-taste
-
So what should I use then?
Philosophically do-while should have very rare applications. Because as programmers our code should be as generic as possible. If the code is treating the first iteration as different it is by definition not as generic as possible. This is illustrated by how the example you provided creates a bug when n=1. Linux Torvald's linked list example is a famous one for how a special case is removed: https://github.com/mkirchner/linked-list-good-taste
-
Accessing the value of a double pointer to a list node
I'm struggling a little bit with double pointers here. I have a pretty simple personal linked list lib for ints and I'm experimenting with incorporating some of this "good taste" logic based off a TED talk given by Linus Torvalds.
- How's my Doubly Linked List?
- linked-list-good-taste - A deeper explanation on the code Linus Torvalds considers better for removal of an item from a linked list
-
Notation as an avenue for exploring zero-cost abstractions?
A couple of days ago this got posted to /r/programming : https://github.com/mkirchner/linked-list-good-taste
plusplus
Posts with mentions or reviews of plusplus.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-03-17.
-
x = x + 1
Realistically they could add some syntactical sugar for it. I see both points of view. Here’s a library that adds it if it really bugs you: https://github.com/borzunov/plusplus
-
So what should I use then?
Here you go: https://github.com/borzunov/plusplus
-
Why Python doesn’t have the ++ operator?
It can be yours, right now! (Don't actually use this) https://github.com/borzunov/plusplus
- Enable and+x and –x expressions in Python
-
A function decorator that rewrites the bytecode to enable goto in Python
I do the same in my module that enables increment operators in Python by patching the bytecode for two unary plus/minus ops: https://github.com/borzunov/plusplus
- Bytecode hack that enables increment operators in Python
-
Enable ++x and --x expressions in Python
I'd like to share the plusplus module that turns the ++x-like expressions into x += 1 at the bytecode level, using pure Python only.
- Show HN: Enable prep in Python
What are some alternatives?
When comparing linked-list-good-taste and plusplus you can also consider the following projects:
linkedlist - The first generic linked list in go :dancer:
pex - A tool for generating .pex (Python EXecutable) files, lock files and venvs.
python-goto - A function decorator, that rewrites the bytecode, to enable goto in Python
LinkedList - Basic data structure used to store data in computer's memory.
FFmpeg - Mirror of https://git.ffmpeg.org/ffmpeg.git
Git - Git Source Code Mirror - This is a publish-only repository but pull requests can be turned into patches to the mailing list via GitGitGadget (https://gitgitgadget.github.io/). Please follow Documentation/SubmittingPatches procedure for any of your improvements.
pointers.py - Bringing the hell of pointers to Python.