Live data from Hacker News

What programming languages are used late at night?

stackoverflow.blog

181–190 of 244 posts

Re: What programming languages are used late at night?

#182
post #93

Earlier quoted context omitted.

Whoah! The big news for me is that there is a programmer who rarely uses SO. I use it constantly. Can you say more about: 1. What your programming set up is. 2. What you do when there is an issue? I didn't know there was a reasonable alternative. I do the Google -> SO a lot. The only time Google brings up a different page is if the question is REALLY basic like how to use a function. Edit: added this postscript: I ha…

1. SSH to server and vim. 2. I program in Perl primarily, and have been for over 15 years. There's not a lot language wise that I need to look up. When I forget the specifics of a particular built-in, I can easily look it up in perldoc. If it's a problem with a module, I can use perldoc on the system or use metacpan.org for a better representation with all the bells and whistles. CPAN modules generally have excellent…

Concur. I don't code as much as I used to, but knowing rather much about perl as a language, the gaps in have I either jog my memory from perldoc/metacpan or it's genuinely fiendish enough that I dive right into the perl source code (in the sense of perl.c). Neither of those is helped much by Google or SO answers.

When I was picking up another language a few weeks ago, however, I constantly ended up on SO with little weird questions. It feels like one of the big hurdles to get over with a new language and tool set is to learn to ask the right questions the right way such that you can actually find the answers in the reference efficiently. SO works as a nice bridge because threads are started (and searchable) by the questions of real newcomers like oneself as opposed to bring written by the experienced who optimize for strict(er) correctness and succinctness.

Re: What programming languages are used late at night?

#183
post #132

This is cool but every time I see something like this I think that this kind of data could be seriously skewed by individual language communities. For example, in the Elixir community we have our own forum, IRC, and Slack channel. Because of this, I almost never visit SO for my Elixir needs. However, I do when I am working with JavaScript, C, Java, etc. I know other languages like C++ have similar communities which t…

Same for Unity3D, which is one of the tags they have in their post but it doesn't look very popular there. Unity3D has their own separate SO-like site called Unity Answers, plus a large forum, plus a (somewhat out-of-date) community wiki. So lots of people won't be hitting SO for help

Still, most of this particular blog post is about relatives between hours of the day per language, rather than comparisons between languages, so it won't be too affected.

Re: What programming languages are used late at night?

#184

C programmers start the day a bit later, keep using the language in the evening, and stay up the longest. This suggests C may be particularly popular among hobbyist programmers who code during their free time (or perhaps among summer school students doing homework). ... or they're the only ones stuck down a rabbit hole chasing some obscure memory leak that keeps bugging them until late in the evening.

...or are more likely to be doing the kind of work where no one is pestering you about when to come at work and when to leave.

Re: What programming languages are used late at night?

#186

Earlier quoted context omitted.

How does asan compare with Valgrind? Valgrind is a serious savior for me sometimes, it's able to catch leaks, access violations, use of uninitialized memory, use-after-frees (and it can tell you where it was free'd), data races, etc. Microsoft's heap debugging stuff really doesn't measure up unfortunately, on Windows I'm frequently left grinding my face into the ground when I hit such issues. Fortunately they're fair…

Valgrind misses certain problems with stack memory and runs your program with a 10x slowdown. AddressSanitizer and friends use a lot of extra virtual address space, but run with about a 2x slowdown. If you're interested in C++ tooling, maybe watch through The Care and Feeding of C++'s Dragons [1] from GoingNative 2013. They start to talk about AddressSanitizer at 55m40s, but the entire thing is really good. The tools…

Interesting, what I'd heard from a colleague is that asan wasn't worth using since it couldn't catch uninitialized memory and stuff. Thanks, I'll have to look into it more.

Re: What programming languages are used late at night?

#187
post #139

C programmers start the day a bit later, keep using the language in the evening, and stay up the longest. This suggests C may be particularly popular among hobbyist programmers who code during their free time (or perhaps among summer school students doing homework). ... or they're the only ones stuck down a rabbit hole chasing some obscure memory leak that keeps bugging them until late in the evening.

Use address sanitizer and leak sanitizer (-fsanitize=address). Compile with options that forbid omission of frame pointers (-fno-omit-frame-pointer) to get a nice backtrace of where the allocation occurred. Also compile with full debugging info (-g) so that leak errors contain file and line numbers. Problem solved. EDIT: this apparently only works on x86-64 Linux. If you are targeting something else, it might be slig…

> Problem solved.

You forgot "bypass or instrument our custom allocators", "determine repro steps in the first place", "filter out false positives", "bypass or instrument your refcounting - because failing to pair a free() with your malloc() isn't the problem, nor even failing to pair decRef()s with addRef()s - breaking up cycles is", etc.

Sometimes the answer is "force your scripting language to garbage collect again".

Sometimes the answer is "track down an incorrect cast in code that ultimately causes a single byte corruption in your refcount".

Sometimes the answer is far more horrifying.

Re: What programming languages are used late at night?

#188

Earlier quoted context omitted.

Valgrind misses certain problems with stack memory and runs your program with a 10x slowdown. AddressSanitizer and friends use a lot of extra virtual address space, but run with about a 2x slowdown. If you're interested in C++ tooling, maybe watch through The Care and Feeding of C++'s Dragons [1] from GoingNative 2013. They start to talk about AddressSanitizer at 55m40s, but the entire thing is really good. The tools…

Interesting, what I'd heard from a colleague is that asan wasn't worth using since it couldn't catch uninitialized memory and stuff. Thanks, I'll have to look into it more.

There are different sanitizers for catching different sorts of bugs. MemorySanitizer is the one that catches use of uninitialized memory.

Re: What programming languages are used late at night?

#189
post #139

Earlier quoted context omitted.

Use address sanitizer and leak sanitizer (-fsanitize=address). Compile with options that forbid omission of frame pointers (-fno-omit-frame-pointer) to get a nice backtrace of where the allocation occurred. Also compile with full debugging info (-g) so that leak errors contain file and line numbers. Problem solved. EDIT: this apparently only works on x86-64 Linux. If you are targeting something else, it might be slig…

> EDIT: this apparently only works on x86-64 Linux. If you are targeting something else, it might be slightly harder. What? I do the same thing on both FreeBSD and macOS.

I think he got that from the Clang documentation: https://clang.llvm.org/docs/LeakSanitizer.html

Re: What programming languages are used late at night?

#190

Earlier quoted context omitted.

Valgrind misses certain problems with stack memory and runs your program with a 10x slowdown. AddressSanitizer and friends use a lot of extra virtual address space, but run with about a 2x slowdown. If you're interested in C++ tooling, maybe watch through The Care and Feeding of C++'s Dragons [1] from GoingNative 2013. They start to talk about AddressSanitizer at 55m40s, but the entire thing is really good. The tools…

Interesting, what I'd heard from a colleague is that asan wasn't worth using since it couldn't catch uninitialized memory and stuff. Thanks, I'll have to look into it more.

AddressSanitizer is part of a suite of tools - MemorySanitizer will catch uninitialized memory, and there is UndefinedBehaviorSanitizer and ThreadSanitizer as well. Your colleague may be complaining that a wrench is not a screwdriver.

Address sanitizer has caught something on every codebase I've enabled it on. YMMV, but I encourage you to at least try it out and draw your own conclusions.

Post reply on HN