News for hackers. Stuff that matters.
Re:Shoestring Budget? Starting to feel growth issues on you... by barryfandango on Tuesday September 09, 2008 @08:02PM (#299943)
Funny how these 2.0 young bucks consider a C-rewrite extreme, when for many coders is is the lingua franca, the bread and butter. I got started on high-level languages but I've made an effort to get familiar with C because it's small, beautiful, and fast as all hell. Fast is powerful.
Re:Shoestring Budget? Starting to feel growth issues on you... by paul on Wednesday September 10, 2008 @12:59AM (#300119)
Part of knowing a tool is knowing when it's inappropriate. A rewrite in ANY language to "fix" a problem that you don't understand is generally a mistake. Doing things the needlessly complex way doesn't make you a better or manlier programmer.

By the way, a lot of these perl and python scripts spend most of their time calling into C libraries anyway, so the performance difference is often negligible.

Re:Shoestring Budget? Starting to feel growth issues on you... by barryfandango on Wednesday September 10, 2008 @03:44PM (#300688)
And unless my knowledge of the Python standard library is way off, the Python standard library is written in Python, not C. That's what all those .py files are in the /lib folder. So python scripts spend most of their time calling into Python libraries. It's true that the interpreter is written in c (c++?,) maybe that's what you were thinking of.
Re:Shoestring Budget? Starting to feel growth issues on you... by barryfandango on Wednesday September 10, 2008 @03:33PM (#300677)
Why would you bring manliness into the discussion? Are you suggesting that Perl and Python are somehow manlier? Because I have no idea what that means.
Re:Shoestring Budget? Starting to feel growth issues on you... by gnaritas on Tuesday September 09, 2008 @08:59PM (#299967)
Speed comes in two forms, execution time and development and maintenance time, C is only good for one of these. Python or Ruby would be better for the other.
Re:Shoestring Budget? Starting to feel growth issues on you... by coliveira on Tuesday September 09, 2008 @09:38PM (#299993)
People that complain so much about C never had a change to learn it well. Go talk to Linus Torvalds about changing from C anything else....
Re:Shoestring Budget? Starting to feel growth issues on you... by brlewis on Wednesday September 10, 2008 @10:37AM (#300397)
I wrote almost exclusively in C for 12 years. I wrote cgiemail, which was very widely used. Today I would never start a server-side web project in C.
Re:Shoestring Budget? Starting to feel growth issues on you... by paul on Wednesday September 10, 2008 @01:00AM (#300120)
Which parts don't I know well?
Re:Shoestring Budget? Starting to feel growth issues on you... by jshen on Tuesday September 09, 2008 @11:25PM (#300049)
apples and oranges. Linus writes OS code. Good luck doing your next web 2.0 startup if you write it primarily in C
Re:Shoestring Budget? Starting to feel growth issues on you... by jawngee on Tuesday September 09, 2008 @09:22PM (#299977)
Why do you think C is such a maintenance issue?
Re:Shoestring Budget? Starting to feel growth issues on you... by jshen on Tuesday September 09, 2008 @11:24PM (#300048)
I like it's well accepted that garbage collection is a huge boon for productivity and stability
Re:Shoestring Budget? Starting to feel growth issues on you... by jawngee on Wednesday September 10, 2008 @08:53AM (#300327)
C has a variety of garbage collectors, here's one:

http://www.hpl.hp.com/personal/Hans_Boehm/gc/

I wonder if it's really more of an intimidation factor than anything (and I'm not saying this to be a jerk, I am truly curious why people have the perception that C is such a nightmare to maintain).

Re:Shoestring Budget? Starting to feel growth issues on you... by gnaritas on Wednesday September 10, 2008 @11:41AM (#300464)
Again, you're looking at best case. Talk to us when GC is mandatory, not optional, because until then, we'll still have to work with C code that can't be trusted because it may not use a GC. To folks who want higher level languages, CG is not an optional feature, it's a core part of the language.
Re:Shoestring Budget? Starting to feel growth issues on you... by jshen on Wednesday September 10, 2008 @10:53AM (#300414)
Are you suggesting that you can be as productive in C as I can be in ruby? If not then you answered your own question.

Second, are those garbage collectors widely used in C code and if not why?

Re:Shoestring Budget? Starting to feel growth issues on you... by gnaritas on Tuesday September 09, 2008 @11:45PM (#300067)
Because it is. It's much easier to blow your foot off in C than in Python or Ruby. I think it's pretty well accepted that scripting languages are far more maintainable than C. Sure you can write maintainable C, but that's best case, I think it's more revealing to look at the worse case.
Re:Shoestring Budget? Starting to feel growth issues on you... by jawngee on Wednesday September 10, 2008 @08:55AM (#300328)
Yeah but C's worse case is still better than most of Perl's, PHP's, etc. best cases. Just as an example.

I don't disagree, btw, that dynamic languages are easier, but I'm really wondering if C's maintenance is really more of a perception than a reality.

Re:Shoestring Budget? Starting to feel growth issues on you... by gnaritas on Wednesday September 10, 2008 @11:38AM (#300457)
That's just an absurd statement. C's worse case is obfuscated garbage http://en.wikipedia.org/wiki/International_Obfuscated_C_Code... that just about no one could read or maintain and you think that's better that Python, PHP, Pearl, or Ruby's best case?

Or is it more likely that like most C folk, you're just stuck on execution speed as the only measure of a language or you don't know what maintainability actually means?

C's being hard to maintain is not a perception, it's a reality. If C were easy to maintain there wouldn't have been room for scripting languages to exist, everyone would have just kept using C. C is extremely low level and extremely powerful, making it hard to work in and very dangerous.

Yes you can do anything with a for loop, but I'd much rather use higher level abstractions like higher order functions, first class functions, objects, continuations, and exceptions and not be able to directly play with memory or pointers because I don't give a crap about the machine, I give a crap about abstracting and solving my problem with the least amount of necessary boilerplate or repetitive code.

Look, make it simple, assume for the sake of argument that Python and C have exactly equal execution speed under all circumstances, given that axiom, why would anyone choose C over Python? Which language do you think most people would choose?

Re:Shoestring Budget? Starting to feel growth issues on you... by barryfandango on Wednesday September 10, 2008 @03:38PM (#300681)
You reveal the primary flaw in your thinking with the phrase "C folk." Languages are not enemy camps. Just learn them both and use the appropriate tool in the appropriate situation - python for glue, prototyping, business systems, web programming, etc. C for operating systems, networking layers, database engines, etc. Try not to attach your ego to either one.
Re:Shoestring Budget? Starting to feel growth issues on you... by gnaritas on Thursday September 11, 2008 @04:28PM (#301733)
You're hand waving, and there was no flaw in my thinking. C doesn't scare me and I use many languages, and that still has no bearing on the point of the conversation. C is a maintainability nightmare compared to lighter weight scripting languages. That fact stands on its own.

There are "C folk" who won't use anything else because they're stuck in the rut of only thinking of execution speed, pointing that out is not a flaw, it's a fact.

Re:Shoestring Budget? Starting to feel growth issues on you... by barryfandango on Friday September 12, 2008 @01:42PM (#302606)
Ok, I will address your argument directly. You state that it's possible to write maintainable C in the best case, but that the worst-case is more revealing. However if we're to be fair, we must also look at the worst case for scripting languages. For example, which of these is more maintainable?

http://www.p-nand-q.com/python/obfuscated_python.html http://en.wikipedia.org/wiki/International_Obfuscated_C_Code...

I would suggest that neither one is particularly maintainable, nor are either of these styles of code likely to appear in the real world. Therefore the worst case for these languages is not really more telling, and not applicable to this discussion.

Re:Shoestring Budget? Starting to feel growth issues on you... by gnaritas on Saturday September 13, 2008 @12:21PM (#303179)
I wasn't the one who claimed C's worse case was better than Python's best. Perhaps you should reread the thread and see what I was objecting to. You can write bad code in any language, but some don't let you blow your foot off as easily. It's well known and well accepted that higher level languages are more maintainable that C, that's just a fact. If you don't agree, then you're the one making radical claims, not I. Regardless, I'm bored now, this is a dead horse.