Live data from Hacker News

Show HN: tere – A Faster Alternative to cd+ls

github.com

151–160 of 206 posts

Re: Show HN: tere – A Faster Alternative to cd+ls

#151

Earlier quoted context omitted.

The "too many dependencies" meme is far too often an example of Chesterton's Fence. The answer to your question "How come a simple thing is more complex than I first thought?" is: "Because you've spent less time thinking about it than the author".

I don't think you can cite Chesterton's Fence for something that is 5 minutes old and lightly used. The Chesterton's Fence meme is far too often an excuse for baselessly dismissing criticism.

This project is 7 months old with almost 800 commits.

The comment I replied to is less than 100 characters long plus a command line invocation.

One of these two has spent more time thinking about whether some dependencies are needed.

Re: Show HN: tere – A Faster Alternative to cd+ls

#154
post #18
post #6

curl https://raw.githubusercontent.com/mgunyho/tere/master/Cargo.lock | grep source | wc -l 51 How come that such a simple tool has more than half a century of dependencies? This is terrifying.

I tried to avoid bloat as much as possible, and I would argue that the non-transitive deps are pretty essential. I'l look into tweaking some features as suggested in sibling to trim it further down. But you're right that it could always be simpler, in fact I wrote tere originally in C with curses as the only dependency, and it compiles >10x faster. But there I had to manually write some (pretty certainly buggy) unico…

I disagree with "bloat" comments. First, the binary will only have stuff you use. Secondly, the fact that you are not writing from scratch code that someone else had more time to write and test - this is a huge plus. I'd use your implementation any day vs. something that someone could put together in C with no dependencies and remarkable pointer math equilibristics.

As long as the use of dependencies remains reasonable, the number of dependencies does not immediately mean that the code is "bloated".

Re: Show HN: tere – A Faster Alternative to cd+ls

#155

Earlier quoted context omitted.

> If this had been an older GNU utility, the dependencies likely would have been libterm and libc. Yes, but then you are stuck with glibc + kitchen sink and GNU code quality, which is atrocious.

Atrocious but exceptionally battle-tested?

It was the best option a long while ago, and basically resulted in a kind of vendor lock in of sorts.

Musl is far superior as a libc, but most Linux software is written for glibc and has quirks that make porting hard.

Re: Show HN: tere – A Faster Alternative to cd+ls

#157
post #37

Congrats for getting this out! > I also wanted an excuse to learn This is the best reason ever, and not just for you: seeing your GIF I thought "could I achieve that with fzf?". Turns out, yes I can: function fcd() { local dir; while true; do # exit with ^D dir="$(ls -a1p | grep '/$' | grep -v '^./$' | fzf --height 40% --reverse --no-multi --preview 'pwd' --preview-window=up,1,border-none --no-info)" if [[ -z "${dir}…

FYI: I think you meant "contagious" rather than "contaminating". The latter means to make something impure whereas the former means more to spread something. :)

Contagion?

Re: Show HN: tere – A Faster Alternative to cd+ls

#158

Earlier quoted context omitted.

I don't know much about Rust, but I have a hard time believing python's standard library wouldn't have all the required functionality covered (whether performance would be adequate is different question). I for one, really really like python for its comprehensive standard library.

Python is "batteries included", Rust isn't. Different design choices entirely. You can do a lot with pythons stdlib, and a lot of popular libraries (requests, for example) largely are just usability wrappers for underlying stdlib stuff. Whereas with Rust, you have a very minimal std, and things you want to achieve are imported specifically.

requests is a wrapper around urllib3, which re-implements quite a bit.

Re: Show HN: tere – A Faster Alternative to cd+ls

#159

One of my pet peeves is CLI newbies who always have the need to cd into some directory before running a command. I learnt pretty early on that this was stupid. Just run your command from the repo root or $HOME.

To be fair most of those newbies are probably writing scripts that use relative directories so they require them being run in the same directory. Newbies tend to reinforce bad habits like that which makes it harder to break out of those ruts.

Re: Show HN: tere – A Faster Alternative to cd+ls

#160

Earlier quoted context omitted.

What is the point of this function? In rust, there's no equivalent to sprintf?

https://doc.rust-lang.org/std/fmt/ Different tools for the same job. One is explicitly integer to string conversion the other is sting formatting. You can technically use the latter, but some prefer a function which explicitly does one thing and one thing only.

More accurately, some prefer a function that is statically dispatched and does not talk to std::fmt::Formatter.
Post reply on HN