Hacker News new | past | comments | ask | show | jobs | submit login
Linus Torvalds made Subsurface - a dive tracking tool (plus.google.com)
50 points by kenny_r on Sept 22, 2011 | hide | past | favorite | 17 comments



Slightly unrelated: This is what I like about Google+. Posts and discussions are very readable. I think this also shows Google+ is not dead.


Well it was launched only yesterday ...

I agree it's easy to be engaged in a good discussion in G+.


With all respect to Linus. This project is about 4800 SLOC of C. I wonder how much shorter and less buggy it would be had he chosen some higher level language.


With all respect to you, looking a gift horse in the mouth is not very nice. I invite you to re-write it in a higher level language, prove that it ends up shorter and less buggy. He's made the code available (as he would) to ease your task to one of 'mere' translation.

Linus is a master carpenter using his favorite tools, because for him, given his expertise with them they are the right tools for the job. What is the right tool for the job is not an absolute, you should take in to account the user of the tools as well.

Also, I think it is not very nice to say that it is 'buggy' without any evidence to back it up. Funny how this comment is made on the same day that another post on the homepage lauds C for making it fairly easy to write 'damn reliable' programs.


Maybe I used a bad word here. What I meant by 'buggy' is that if you'll look at commit history there are a lot of fixes for problems that could be easily avoided in other languages (like memory leak here [1]).

[1] https://github.com/torvalds/subsurface/commit/6eefcf40e68c2a...


In my experience just about every language has its own pitfalls. The reason that C has memory leaks is that the programmer is responsible for allocating and de-allocating memory. In a language with a more complex runtime that might be taken care of but the trade-off will be that you get some other class of problems in return.

Linus writes his code, fixes the bugs that are found. The end result will most likely be a solid and fast piece of software with a minimum of dependencies and bloat.

If that is not your cup of tea then do a better job but don't bitch about the way he chooses to do it.

What do you expect? For a guy like Linus to write a utility in a language that he feels is not optimal for himself and/or the problem at hand? To pick installing a 100M runtime to run a 50K binary?

Linus is a systems programmer, not someone that would go for an overkill solution in some high level stack, launched on Monday, forgotten by Friday. Code like this has staying power and has a chance of surviving its creator. Script stuff is typically throwaway.


While I think writing it in C, especially for Linus, makes perfect sense, I disagree with some of your points:

> To pick installing a 100M runtime to run a 50K binary?

Well, first that's a false dichotomy: there are higher level languages that are still compiled and don't require a runtime. And 100M? Really? Lua uses 150K. The libraries he's using are probably way bigger than that.

> Code like this has staying power and has a chance of surviving its creator. Script stuff is typically throwaway.

Script is more throwaway because if the developer had to write it in C, it probably wouldn't be worth the effort. Why exactly would the same program written in a higher level language have less chances of surviving its creator?


Who appointed you Linus's defender? All this aggressive defensiveness because someone said "I wonder"? What's wrong with you?


He wrote it in part to learn GTK, he mentions in another post.


I'd agree with you if this was written by some random guy rather than Linus. Given his track record, I wouldn't be bothered at all.


I don't know why you are down voted. It is generally a (very) stupid idea to write such software in C. Yes I know Linus knows C well so he did it that way, but still..


> It is generally a (very) stupid idea to write such software in C.

Is it? It isn't very common but that alone does not make it stupid. Why do you think it is stupid?

From the README:

"Half-arsed divelog software in C.

I'm tired of java programs that don't work etc."

What language would you use?


>What language would you use?

That's the wrong question. You should ask someone like that "What language did you use?" People complaining about the language are always talking about how they would have done it better. Not that they did it better.


The project in question is not the problem. Generally when you are writing an "application with gui also parsing xml" in C you will end up developing it in longer time because of

- Memory management - Portability issues - Lack of libraries

Because C/C++ allows you to make hard to detect errors easy. And does not usually stop you making stupid errors (such as simple initialization problems, syntax errors etc. because of lack of good IDEs). Maybe a bold claim, but if this would be a challenge, with a well defined problem, many less skilled java-python-ruby programmers would reach to the same level less than half the time.


I think Ruby would be a great language for this sort of app: Extremely high level, automatic memory management, sensible approach to OO, bindings to GTK and other GUI stuff, easy integration with C.


Most such software is still written in C. He should be being downvoted for a knee-jerk reaction against C, which is still very well suited for application software.


Which is a pitty. People lives under the C/C++ bubble for such long time.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: