Kinda misleading. volatile is for memory mapped I/O and such. volatile means the memory access really happens
Traps to Developers
71–80 of 113 posts
Re: Traps to Developers
#72bash: errexit depends on caller's context, will utterly fail you one day: https://lists.gnu.org/archive/html/bug-bash/2012-12/msg00093...
Re: Traps to Developers
#73Earlier quoted context omitted.
Maybe this is cute monady stuff, but there isn't an equivalent to Optional > with only null/None. You usually don't directly write that, but you might incidentally instantiate that type when composing generic code, or a container/function won't allow nulls.
In what context would you not want to treat Optional.of(null) and null as the same? It shouldn't be a big deal.
Re: Traps to Developers
#74Re: Traps to Developers
#75Earlier quoted context omitted.
In what context would you not want to treat Optional.of(null) and null as the same? It shouldn't be a big deal.
Often people use optional or nullable types as a convenient approximation to an Either type.
Re: Traps to Developers
#76> Unset variables. If DIR is unset, rm -rf $DIR/ becomes rm -rf /. Using set -u can make bash error when encountering unset variable. sweet mercy :O Someone call the Inquisition
Re: Traps to Developers
#77LF vs CRLF
MSYS$ cat build.sh
#!/bin/bash
echo "hello, world"
MSYS$ ./build.sh
: not found: 2: build.sh
e.g. https://askubuntu.com/questions/370124/not-found-error-when-...Polite projects will have .gitattributes specifying that .sh or .bash or bin/* or whatever are to always checkout with eol=lf https://git-scm.com/docs/gitattributes#_eol>
As best I can tell, .ps1 does tolerate Unix lf but I'd bet good money that .bat and .cmd definitely do not
Re: Traps to Developers
#78> Some routers and firewall silently kill idle TCP connections without telling application. Some code (like HTTP client libraries, database clients) keep a pool of TCP connections for reuse, which can be silently invalidated. To solve it you can configure system TCP keepalive. For HTTP you can use Connection: keep-alive Keep-Alive: timeout=30, max=1000 header. Once a TCP connection has been established there is no st…
Re: Traps to Developers
#79> Java, C# and JS use UTF-16-like encoding for in-memory string That’s incorrect for Java, possibly also for C# and JS. In any language where strings are opaque enough types [1], the in-memory representation is an implementation detail. Java has been such a language since release 9 ( https://openjdk.org/jeps/254 ) [1] The ‘enough’ is because some languages have fully opaque types, but specify efficiency of some opera…
Re: Traps to Developers
#80The first "trap" on the page says "min-width: auto makes min width determined by content", but this is false outside of flex/grid. From MDN: "For block boxes, inline boxes, inline blocks, and all table layout boxes auto resolves to 0." https://developer.mozilla.org/en-US/docs/Web/CSS/min-width