Readit News logoReadit News
stantona commented on Ask HN: What is your best advice for a developer to write better code?    · Posted by u/gdaz
stantona · 9 years ago
Write less of it.
stantona commented on GNU/kWindows   mikegerwitz.com/2016/04/G... · Posted by u/mikegerwitz
stantona · 9 years ago
This confusion is both astonishing, given the length of time GNU has been around. Yet it is also understandable, for many there's a missing distinction between GNU vs Linux project vs FreeBSD etc etc. The GNU operating system website explains the distinction pretty clearly on its home page.

https://www.gnu.org/home.en.html#More-GNU

I often wonder why Microsoft doesn't just bite the bullet and adopt Linux as the kernel for Windows.

stantona commented on Advanced Economies Must Still Make Things   spectrum.ieee.org/at-work... · Posted by u/craigjb
haddr · 9 years ago
This has been known for some time (and proven with some good examples) but still is a shock to people who believed somewhere in '90 that the next stage in the economy is the shift to services instead of industry.

I recommend this book from Ha-Joon Chang that has a nice chapter on that (a very pleasant read with references): http://www.amazon.com/Things-They-Dont-About-Capitalism/dp/1...

stantona · 9 years ago
+1. I highly recommend Ha-Joon-Chang's books, I've learned a lot about economics from him. He puts forward a strong argument that economic policy must be flexible, and shift with evolving times and technological changes. In other words, he's highly critical of ideologies, like f global free markets, or trickle down economics.
stantona commented on Ubuntu on Windows   blog.dustinkirkland.com/2... · Posted by u/bpierre
stantona · 9 years ago
Is this a sign that Windows is moving towards a linux kernel?
stantona commented on Anxiety and Depression Are Symptoms, Not Diseases   psychologytoday.com/blog/... · Posted by u/_xs0j
pc2g4d · 9 years ago
Amen to this article. As one who myself once believed my depression "came out of nowhere" (but which, in retrospect, was an obvious symptom of my emotionally destructive family and school environment) and who tried for many years to smother those feelings with antidepressants, I feel strongly that this article presents a wiser path.

Evolutionarily speaking, it seems likely that depression/anxiety are there for some purpose, and yet we treat them both like meaningless pain meant only to be banished using drugs. I believe both are signals that something in our environment is not working for us. They indicate emotional or physical needs unmet---needs for safety, autonomy, connection, etc.

Often the individual suffering is fundamentally unaware of their own circumstances. I didn't realize how messed up my family relationships were growing up until much later. There are various reasons for this unawareness, but I believe the depression/anxiety are there to force our conscious self and the people around us to acknowledge that something is wrong.

This isn't just the old nonsense about depressed people needing to cheer up, and that it will pass in a day. This is a completely different paradigm that explains depression and anxiety as meaningful signals of underlying problems rather than as inexplicable suffering to be numbed through prescription medication. I believe it will prove the more robust and also the wiser way of looking at these experiences.

stantona · 9 years ago
..or that for some individuals, those who suffer bipolar (such as myself) or clinical depression, there's a biological factor that has little relation to past circumstances.
stantona commented on Anxiety and Depression Are Symptoms, Not Diseases   psychologytoday.com/blog/... · Posted by u/_xs0j
stantona · 9 years ago
This is pure generalization and does not apply to those who are clinically depressed or suffer bipolar.
stantona commented on Anvil: A Drag-and-drop web app builder with Python   anvil.works/blog/introduc... · Posted by u/meredydd
stantona · 9 years ago
I just got a sudden flashback of Visual Studio circa 2003 shudder
stantona commented on Use the Unofficial Bash Strict Mode (Unless You Love Debugging)   redsymbol.net/articles/un... · Posted by u/gkst
gdavisson · 9 years ago
Agreed. In addition to still having trouble with tabs and newlines, setting IFS still leaves the other big problem with unquoted variables: unexpected expansion of wildcards. The shell considers any unquoted string that contains * , ?, or [ to be a glob expression, and will replace it with a list of matching files. This can cause some really strange bugs.

Also, an unquoted variable that happens to be null will essentially vanish from the argument list of any command it's used with, which can cause another class of weird bugs. Consider the shell statement:

if [ -n $var ]; then

... which looks like it should execute the condition if $var is nonblank, but in fact will execute it even if $var is blank (the reason is complex, I'll leave it as a puzzle for the reader).

Setting IFS is a crutch that only partly solves the problem; putting double-quotes around variable references fully solves it.

stantona · 9 years ago
The test command has certain rules depending on the number of arguments. The most pertinent rule is: For one argument, the expression is true if, and only if, the argument is not null.

In this case

    [ -n $var ] 
is the same as

    test -n $var
$var is not quoted, so when this command is run, word splitting occurs and therefore $var is null. Which there falls into the one argument rule above.

Therefore, always quote your variables.

u/stantona

KarmaCake day50May 12, 2012
About
Software developer Clio.
View Original