Live data from Hacker News

What programming languages are used late at night?

stackoverflow.blog

161–170 of 244 posts

Re: What programming languages are used late at night?

#161
post #148
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…

Unless you're working in the embedded space, there's no reason to not write your C project to target whatever arch is the most debug-friendly first, and then just port it to the system it's "for" at the end.

Unless the issue ends up being arch specific

Re: What programming languages are used late at night?

#162
post #144

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.

Naively, there's nothing forcing these developers to chase that leak into the night, rather than into the next work-day. But I do wonder whether some languages have debugging problems that require "keeping more state" to solve them than others, such that the developers doing debugging in those languages would rather forge ahead and finish, than drop it and pick it back up the next day. That'd be an interesting thing…

> But I do wonder whether some languages have debugging problems that require "keeping more state" to solve them than others, such that the developers doing debugging in those languages would rather forge ahead and finish, than drop it and pick it back up the next day.

I used to stay late at work sometimes for this reason - not more than an hour or so but I found that even when I stayed late I often didn't manage to solve the issue that day - instead I came in the next morning fresh and was able to solve it better after having slept on it.

Now, that's true of debugging in my experience, but if you're knocking something out quick and don't want to have to get back into that groove the next day, it's a different story.

Re: What programming languages are used late at night?

#163
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…

> 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.

Re: What programming languages are used late at night?

#164
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…

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 fairly rare as I generally stick to C++ with more modern techniques which avoid most of the pitfalls - but when they do happen it can get nasty without a tool like Valgrind.

Helgrind is quite good for threading issues too.

Re: What programming languages are used late at night?

#165
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…

And the skill of the userbase.

Haskell naturally attracts a more skilled developer who is more likely to dig into documentation/blog posts rather than running for help on SO.

I used SO all the time when I was a newbie. But I only use it now for obscure issues, usually as a last resort.

Re: What programming languages are used late at night?

#166

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.

Every one of my worst-bug-ever stories starts with something stupid I did in C.

Re: What programming languages are used late at night?

#167
post #123

Earlier quoted context omitted.

I'm pretty sure the biggest player using Haskell is Microsoft, which develops and maintains Haskell in the first place...

I though MS was pushing towards F#. Is there any indication they plan to focus more on one or the other?

They're not focusing on Haskell commercially, but in Microsoft Research where they employ some of the main Haskell devs. A lot of their research has gone into F#, C# and .NET libraries (like LINQ).

Re: What programming languages are used late at night?

#168
post #144

Earlier quoted context omitted.

Naively, there's nothing forcing these developers to chase that leak into the night, rather than into the next work-day. But I do wonder whether some languages have debugging problems that require "keeping more state" to solve them than others, such that the developers doing debugging in those languages would rather forge ahead and finish, than drop it and pick it back up the next day. That'd be an interesting thing…

There's definitely the overhead in re-loading where you were yesterday, although sometimes that's handy - "sleeping on it" does work. I find (in any work, not just the rare C work) that when I get into a juicy problem I just don't want to stop. It's nothing to do with the task switching / reload cost, it's that I'm interested in what I'm doing. So I think you're right that it's about what kind of developers a languag…

I started leaving my laptop hibernated with visual studio or gdb stuck at the break point where I was off. The feature to anottate variables and pin them also helps for when somebody bothers you mid debug session.
Post reply on HN