HNHacker News
TopNewBestAskShowJobs

obiterdictum

950 karma · joined May 25, 2010

submissionscomments
obiterdictum··on Programming Languages: What tool is right for which job?
I can't get the index page now. Sorry, I think the traffic from HN may have killed it. :(
obiterdictum··on Want jobs? Encourage immigration
"457 visa holders are usually required to purchase their own since everyone else is covered under the national health care system."

Not sure if you are aware of this, but if you are not entitled to Medicare, you are exempt from paying Medicare levy (and surcharge), which the rest of the residents do have to pay. Though, you have to get it back with tax refund at the end of the financial year (it is paid with PAYG taxes) after you apply for a letter from Medicare that you weren't eligible.

Private hospital insurance should cost you about the same per year, so it's a fair arrangement, I think.

obiterdictum··on What's the one Linux command you wish you knew years ago?
You will be pleased to know that there is a site full of little gems like this:

http://www.commandlinefu.com/commands/browse/sort-by-votes

Most of my time savers that I've never thought of were found there.

obiterdictum··on Planes overhead
Actually it's currently used in Apple's Siri to answer factual questions.
obiterdictum··on Elements of Modern C++ Style
I'd say by the middle of next year you should be able to use the a lot of the features portably.

GCC: http://gcc.gnu.org/projects/cxx0x.html

Clang: http://clang.llvm.org/cxx_status.html (currently down)

MSVC: http://blogs.msdn.com/b/vcblog/archive/2011/09/12/10209291.a...

Notably lacking in current production versions:

1. explicit overrides in GCC

2. lambdas in Clang

3. Variadic templates, range loop in MSVC

obiterdictum··on Elements of Modern C++ Style
We have just started using some C++11 features, and with new features come new traps and potential complexities, as you'd expect with C++.

A few examples:

1. Implicit lambdas ("[=]") capture "this" pointer for data members, if you capture a shared pointer and let the lambda object leave the scope, the shared pointer won't be copied (http://stackoverflow.com/q/7764564/23643), which may create unpleasant results, like code blowing up in your face.

2. Overuse of "auto" (not exclusive to C++) may make the code harder to read, especially if storing a result returned from a function. You can't tell if the return value is a smart pointer or a raw pointer, value or a reference, so you can't figure ownership semantics just by looking at the local code.

3. Move constructors/assignment operators are a bit of a black magic, especially with regard to suppressing default implementation (http://mmocny.wordpress.com/2010/12/09/implicit-move-wont-go) and exception safety (http://cpp-next.com/archive/2009/10/exceptionally-moving). I would refrain from using it, until I fully understand it.

With that said, most of C++11 is a welcome change and makes C++ more pleasant to write, but, as always, you have to have your guard up and use new features judiciously.

obiterdictum··on Is This the Future of Punctuation?
I am not a native English speaker, but I'm constantly dumbfounded as to why anyone would even entertain the idea that "its/it's" are in any way similar. When you substitute one with another, the sentence just does not parse. It stops making sense.

By conflating "its" and "it's", you are overloading the meaning of "its", making the language more ambiguous.

Perhaps this also has to do with me being accustomed to more formal (programming) languages.

obiterdictum··on From C to C++: A quick reference for aging programmers
This feels like a C++ tutorial from mid-90s. C++ code written today looks nothing like what's presented in this article. Besides, some poor sample code choices jump out at me, like throwing an int and using C library. I realize they are there to illustrate a point, but this reinforces bad habits.

In fact, if you are learning C++, you better start it as a new language, rather than a tumor grown on the side of C. These languages are too idiomatically different.

obiterdictum··on SICP optimized for Kindle
PDF conversion is a difficult problem. To my rudimentary understanding of the format, PDF documents aren't really plain text, they have no semantic information, they are just individual glyphs and figures mapped to absolute coordinates on a fixed-size page. This format is really meant to be as a portable printer-friendly document format, not ereader-friendly dynamically resizable format.

I can't comment on the RFC part of your comment.

obiterdictum··on Heretical Confessions of an Emacs Addict – Joy of the Vim Text Editor « /usr
Another good alternative is to remap the infrequently used Caps-Lock key to Esc (what Emacs users remapped to Control for ages). http://c2.com/cgi/wiki?RemapCapsLock
obiterdictum··on Heretical Confessions of an Emacs Addict – Joy of the Vim Text Editor « /usr
I apologize in advance for this ode to Vim, but I feel I should get it off my chest.

I admit, the main reason for me to develop in Vim these days is to simply minimize the number of keystrokes I have to press (and the number of times I have to reach for the mouse), because, due to RSI, I experience a mild, but constant, and noticeable discomfort in my wrists (...and triceps, and shoulder) whenever I type (I distinctly remember I developed it in Eclipse during my Symbian C++ development internship). I honestly tried Emacs a few times because of superior Lisp editing, but it just didn't stick, I just can't bring myself to press more keys than I use to in Vim. Force of habit? Maybe.

I have never expected to be "hooked up" on Vim, but I was. In my first job out of the university I was writing Linux-based embedded software almost exclusively. I could never get used to Linux GUI editors after Visual Studio: the lack of any built-in IDE features and constant switching from the editor to the shell made me switch away to something closer to the shell. The initial discomfort of modal editing was less annoying than the lack of features and the accessibility of shell in Linux GUI editors (Eclipse CDT was a pain to set up and use back in these days). Then the discovery of split windows, regex replacement, folds, macros, ex-mode commands, and extensions made my experience what I then thought tolerable.

The mechanical memory had set in, and, upon moving on to my next job, I discovered that I could no longer use Visual Studio with as much comfort as I used Vim! It was curious, since I've "grown up" as a programmer with Visual Studio in the 4 years at the university.

It has snowballed further since then: remapping ';' to ':', ZQ and ZZ shortcuts, quickfix window, copy-paste registers, more motions with text objects ("delete between {}", "move to next ','", replace "()" with "[]", indent 4 line with "4>>"), sorting selected lines, coming up simple with ad-hoc refactoring functions and macros on the fly, marks, buffer greps, jumping between files with LustyExplorer an NERDTree, plugins (VimScript must die, but while it's there, it does the job), and falling back to the shell where Vim falls short. A few vimgolf (there is a site for this) challenges also added some tricks into my toolbox.

Right now I use Vim whenever I can. It does show its age, especially in areas like REPL, IDE features and code completion (it'll get there, eventually, I hope), but I just don't feel at home using anything else at the moment. I'm always on the lookout on the future of Vim or its next successor.

PS: Disclaimer: I don't necessarily advocate for everyone to learn Vim, it really requires a non-trivial investment of time to establish the necessary mechanical memory, but it was worth it for me personally (I do C, C++ and Python almost exclusively). Depending on your domain and the technology you use, you may be better off using Emacs (Lisp) or VS with Resharper (C#).

obiterdictum··on 74.1% yield on 2-year Greek government bonds
http://www.bloomberg.com/news/2011-09-12/greece-s-risk-of-de...

98% chance of default makes them essentially expensive lottery tickets at this point.

obiterdictum··on Caml Trading: Experiences in Functional Programming on Wall Street
I'm curious if you benchmarked Haskell implementations against any C or C++ implementations (especially for market connectivity). Any hint about magnitude of difference?
obiterdictum··on Caml Trading: Experiences in Functional Programming on Wall Street
Tsuru Capital claims to be using Haskell almost exclusively.

http://www.tsurucapital.com/en/

obiterdictum··on Finding your way in vim: tags, cscope, grep and more
I like where this is going, but it was a bit unstable for my taste last I tried it. I think it still relies on the file being syntactically correct, which may break your parsing sometimes and is still quite slow with template-heavy code (Boost mostly). Is it still the case?

I'd also like some more build system integration hooks (e.g. provide project-specific include dirs and CXXFLAGS on a per-file basis).

obiterdictum··on What does the C++0x standardized memory model mean?
These two are orthogonal. Simply put,

1. ABI is a set of rules for interaction between multiple code units (functions, translation units, libraries) running sequentially and calling each other, e.g. how arguments are passed to the functions, how return values are passed back, how exceptions are thrown and handled.

2. Memory model is a set of rules for interaction between multiple (potentially) concurrently running threads, e.g. how a compiler can reorder load/store instructions to main memory, which operations imply memory barriers.

obiterdictum··on What does the C++0x standardized memory model mean?
The way I see it is that before C++11, the semantics of individual threading implementations relied on compiler and platform-specific primitives (like atomics and barriers) that happened to be similar enough to create an illusion that C++ supports multithreading as a language.

C++, for all intents and purposes, supported multithreading before C++11 via extensions and libraries that are vaguely similar to each other on different platforms, but you can never be sure that your multithreaded code will work when ported to another platform (see "volatile" keyword semantics in standard C++ as opposed to MSVC).

But now,

1. it's officially mandated, and

2. you have more tools in your concurrency toolbox (for example, compiler-independent atomic variables with the ability to fine-tune memory order).

obiterdictum··on The Architecture of Open Source Applications: LLVM
I've never built a compiler, but how well does having common optimizer for all platforms work in practice? (11.5.1) Does it cause a "lowest common denominator" effect thus making the code take less advantage of the target architecture than a architecture/vendor-specific compiler would?

I'd love someone with the experience of building compilers to chime in.

obiterdictum··on Why it's important to find your "niche" in life
It seems to me that the entire site is made up of fluff articles and the the bulk of submitter's history is made up of links to this (and also its 16yo founder's) site. File this under self-promotion.
obiterdictum··on C++ at Google: Here Be Dragons
I think this is a very web-development-centric view on things. In fact, I dare suggest that the world does not revolve around JS, and the bulk of development, especially in-house, is done in fairly pedestrian languages (C++, Java, C#). Web developers tend to have more web presence, naturally, so the majority of public discussions and news may make it seem to be representative of the world.
obiterdictum··on A Japanese broker offers clients market access faster than 3 microseconds (2010)
The blog of Nomura's NXT Direct system developer: http://hackingnasdaq.blogspot.com/
obiterdictum··on Reasons To Give The Vim Text Editor A Chance
I'm a full-time Vim user.

This was my problem when I started with Vim. But then I learned to love GDB and other command-line development tools. At first it seemed a bit archaic to me, a Visual Studio user at the time, but when I got a hang of it, I stopped missing IDE debugging. Now I'm at the point where I feel crippled trying to develop in an IDE (no split windows, to vim-style macros, inefficient use of screen space, constantly have to switch between mouse and keyboard).

For example, GDB can be scripted, so you can repeat debugging sessions, your entire debugging session is printed, so you can always go back and see the history of changed values. It supports pretty-printing STL containers and you can add your own pretty-printers in python.

There are a lot more to these tools than you can discover by poking and trying things like you would with an IDE, they have a steeper learning curve, but I wouldn't dismiss them immediately as a waste of time.

obiterdictum··on Hacker Writing Style
Disclaimer: I don't have a citation for this, I just remember it mentioned a few times, so I may very well be wrong.
obiterdictum··on Hacker Writing Style
As far as I remember, the distinction between "typesetter" quotation and "logical" quotation appears in computerized typesetting. In traditional paper typesetting, a quote was kerned together with a period (or a comma) into a single character, so that quote is above, not before or after the period.
obiterdictum··on A Guide to Undefined Behavior in C and C++, Part 1
For me, the second stage in the evolution as a C or a C++ programmer after a discovery like this was to start relying heavily on language standards. After all, it's the ultimate reference about how the language should work on all platforms and compilers.

But then I learn that not all compilers behave exactly the same way, or implement only a subset of a standard for a variety of reasons (every compiler would implement different subsets), and I return full circle back to experimentation with individual implementations.

obiterdictum··on Exception Safety, Garbage Collection etc. (a.k.a. Why Does Java Suck So Bad?)
There isn't. There are two explicit methods to get raw pointer value with different semantics:

- get(): auto_ptr retains the ownership

- release(): auto_ptr loses the ownership

obiterdictum··on Ask HN: Has anyone had negative experiences with zeromq?
I can't say I have a lot of negative experience, but after evaluating it, I've come to the conclusion that it's not the right tool for the job for us. We develop trading systems and I wanted a decent messaging framework for internal non-speed-critical communication between apps. Disclaimer: I had limited time to evaluate it, so I may have some misconceptions about ZMQ, you have been warned.

1. Extensive use of asserts in release builds terrifies me. It's meant to check for conditions that shouldn't happen, but I see users complaining about their apps aborting with assertion failures on ZMQ mailing lists and it comes up fairly frequently in Google. There are a fair bit of asserts for error codes returned from system calls. I don't want a critical process crash because I've used library in a wrong way in a completely different part of the application.

2. Only in 2.1 they've fixed the problem where some messages would not be flushed and be lost if you terminate the process too early. This seems like a fairly common bug for younger projects. Recommended workaround is... calling "sleep" before you exit, which is one of the deadly sins of multithreaded programming! This and above point convinces me that ZMQ isn't as mature enough for me to be comfortable with.

3. Transparent reconnection is good, but some of our applications need to quickly detect that other nodes in the system are missing, which forces me to implement off-band heartbeat mechanism.

4. Threading model seems a bit awkward to me (last I checked). First of all, let me state that I personally believe that a library starting threads behind your back is a Bad Thing (unless it's a framework). ZMQ uses a sender thread that you queue your messages into, yet it forces you to dispatch your receive loop by either blocking read or zmq_poll. If it already starts threads by itself, why not provide a callback?

5. Not really a problem, but a missing feature: no way to demultiplex messages from a stream of messages, so you have to implement it yourself. You can subscribe to a subset of messages on a socket, but can't subscribe to multiple subsets from a single socket.

obiterdictum··on Why do Russians smile so little (and Americans so much?)
I'll throw in an unsubstantiated hypothesis that this happened with popularization of Carnegie's "How to Win Friends and Influence People".
obiterdictum··on GNU Compiler Collection 4.6.0 released with Go programming language support
Yes and no. They do use a thread pool of OS threads, but they don't map 1-to-1 to goroutines.
obiterdictum··on Bash-Fu
PS

I can't edit my post anymore, but I remembered that there is a similarly named site for command line tricks:

http://www.commandlinefu.com

← PreviousPage 3 of 4Next →