Hacker Newsnew | past | comments | ask | show | jobs | submit | zer's commentslogin

Nowadays I use TinyWall[1] on Windows. A simple firewall with a whitelist and some convenience functions.

[1] https://tinywall.pados.hu/


Fish is really great for an interactive shell, I love using it. Not so great when it comes to scripting though. For example I think there's still no way to easily exit a script on error except to manually check exit codes.

However I haven't tried writing scripts in zsh yet, just sh/bash.


I couldn't possibly use a shell that wasn't also a decent shell script. It seems my natural progression is always:

1. "Hand written" commands in shell

2. Shell script with copy-pasted commands from interactive session

2b. Evolved shell script with getopt. Complexity level beginning to tickle the spidey sense that it's too big.

3. Node.js script (I can write Python but JS seems infinitely nicer)

fish would break the 1->2 transition, sending me straight to 3 before I've really gotten a handle on the problem domain.


Perhaps it's just personal preference, but in what world is JS "infinitely nicer" than python?


I'm really far from a JS fanboy, but Python's whitespace thing really is annoying enough that I avoid it when possible.

Ruby'd be my pick for "most-pleasant scripting language" so long as I can avoid any libraries/frameworks that do too much metaprograming "gee, wouldn't you love to never be able to track down where this is defined?" crap. Maybe Lua, but deps are a bit of a pain to manage there, and it's a huge step down in third party library availability compared with the other three languages here mentioned.

Really, if not for up-to-date library availability being higher in other languages, I'd probably still be using Perl for everything. It feels more "command-line native" than the other options. Installed everywhere. The community's not too in-love with trendy, cute bullcrap. A project you wrote five years ago will probably still run fine with no effort. It's kinda like supercharged bash with way fewer footguns.


I've been seeing a lot of pro-perl comments here on HN. Never used it myself, may have to check it out.


Beware that it was created at a time when many programs were written in plain text editors, with no syntax highlighting or autocompletion, with the printed-book language manual on your desk, on a screen that could legibly display only a small fraction of the text that a modern display can (or even ones that came along a few years later). Hence: sigils for variables (though unlike PHP these make some sense and are actually used to do things, and aren't just there because... well, because Perl did it, so PHP should too, I guess); single-character magical variables for very commonly-used loop- or input-related variables; et c.

I don't think anyone would make something quite like it these days, starting form scratch.


Sorry, I didn't mean to start a flame war. I find regexes, HOF, and especially asyncio/Promises much more palatable in JS, which are things I look forward to when moving out of shell scripting land.


Nothing precludes you from using bash scripts even if ysit fish interactively. Just set a shebang in the script, or run it with bash script.sh.

That said, personally, for anything more involved than a one-liner alias kind of script, I turn to python, or PowerShell on Windows.


> for anything more involved than a one-liner alias kind of script, I turn to python

I agree with this. If you can trust your users to have python3 in their environment, I don't see a good reason to use sh/bash instead of python. Non-trivial shell scripts are unreadable to me, and the semantics are too different from normal programming languages.

The only scenario I can see is a script that has to call multiple commands over and over, which can be a pain in python if you're piping a lot of stuff and all that. No, piping grep to cut and sed doesn't count; you can do that in python itself.


> If you can trust your users to have python3 in their environment, I don't see a good reason to use sh/bash instead of python

You would need to ensure said users have all the pip dependencies your python script imports as well. shell scripts don’t have that issue unless you’re calling some external program that isn’t installed.


>shell scripts don’t have that issue unless you’re calling some external program that isn’t installed.

Good thing that bash has such an extensive amount of standard libraries and that you're almost never calling external programs? And unlike Python, which is seemingly almost exclusively calling third-party libraries from PyPI?


> That said, personally, for anything more involved than a one-liner alias kind of script, I turn to python, or PowerShell on Windows

You and submitter (who according to CV is proficient in Python) might like Oilshell.


I made dash my sh and started writing shell scripts targeting it instead of bash. If there's some bash-ism that can't be elegantly expressed in POSIX sh, it's time to bring out something like Python.


I wouldn't attribute it to malice. The author has got that probably right: the people in charge think in iOS terms.


Ah yes iOS where refreshing a page now requires you to menu dive instead of having an always accessible button up top


On macOS too now, it’s beyond ridiculous.


Tap the top of the screen and Safari jumps to the top of the page. Pull down to refresh.


What if I don't want to lose my spot in the page by scrolling to the top[1]? This is a straight up UI regression. Just because there are workarounds doesn't mean it's not shit.

Edit:

[1] For example if I want to load new comments in a HN thread I'm reading.


That's three steps that used to take one. In exchange for losing the capability to quickly refresh a webpage in a browser we got... nothing?


I like the general idea. I haven’t got the time to do more than skimming right now but I already feel that a single markdown file (especially without a table of contents) isn’t the right medium for this.


I assume the markdown is the source and that other presentational forms will follow.


The Idasen does look a lot better. Do you think it would handle a move (or two) well?


My clients — oncological institutions — license Oracle and so they prefer my solutions to use it as well. Really simple, and sad.

As for why they use it... as far as I know it‘s the old tale: historical reasons. Classical lock-in.


Regarding your second point: This sounds similar to .NET‘s CancellationToken. It works very well there.

What are those nuances in JavaScript which aren’t handled by it?


I think you're going to point out that I'm about to demonstrate non-JavaScript nuances, but here are issues I've encountered:

Let's take a great of example of where promises are used most often: AJAX. If the endpoint isn't RESTful and there is state on the other end, cancelling a promise requires updating the entire module of the new state. There can be multiple reasons for cancelling, and the code needs to be aware of what is happening beyond a simple timeout.

Same thing goes for USB devices (via libusb+ffi) and serial-ports (via serialport). In flight requests can disturb state if cancelled, and it makes the programming very complex to just time-out.

One could argue AJAX and hardware programming are outside the domain of JavaScript, but I wouldn't.

I guess it is more than a "nuance", it is the observance that cancelling an asynchronous operation in general can have unintended consequences if not handled correctly ... beyond memory leaks from unresolved promises.


I use schemy [0] for non trivial config tasks in .NET projects. LISPs in general are well suited for this. Very small implementations are easily done and data is code, it’s pretty great.

Of course, if one has already access to a Python runtime that is probably fine as well.

[0] https://github.com/microsoft/schemy


Lisps are great as embedded scripting and configuration languages! Lisp is XML done right.


I use http://hn.premii.com/

I believed it to be more popular but it seems no one has mentioned that site so far...


The colour scheme is painful. Both on 'day' mode and night mode


Yeah I did the same.

It's infuriating to put the machine to sleep only to see in the morning (or days later...) that Windows woke it up at 3am.

Is it supposed to go back to sleep or is this honestly how someone at Microsoft wants it to work?


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: