Re: Java or C++?



Jon Harrop wrote:
CTips wrote:

Ah, now I see the problem. You're just not used to dealing with
competent programmers. As a data-point, in the distant past, I
implemented hindley-milner type inference in under a week.


That's about 300LOC in ML and is a (tiny) first step towards writing a
compiler for a FPL.

OK. I suspect that you're talking about basic type inference not the Alex Aiken et.al. "enhancements".

Second time around would probably be 2-3 days. Its pretty straight-forward, as
algorithms go.


Yes.


Hmm...I wonder whether the disconnect between people who use GC and
people who denigrate it is a matter of capability. If you find it hard
to get memory management right in C,


What if you have better things to do with your time than implement all
memory management by hand?

I haven't noticed it cutting down on my productivity at all. Of course, for the stuff we do, its the algorithms do tend to be complex, so I assume for someone who does simple algorithms and/or small programs the memory management might dominate [though I find it hard to believe]



Note that there is also a set of people who prefer C to C++ as well,
mostly because of the predictability of the language. If one knows
exactly what one wants done, one would like to work in an environment
where all the intervening steps are as light-weight as possible. ANSI C
is probably as light-weight as it gets, barring Forth.


Again, I don't contest that C is great for trivial programs where you can
actually list the "intervening steps". For anything intrinsically
complicated, C is hopelessly ineffectual.

Lets see: compilers - C. OSes - C. Real-time programs - C. EDA tools - C. Network routers - C. Care to name something that is intrinsically more complicated than those programs? (Well, I can think of a few that might be - a bunch of numerical programs, some medical imaging stuff, FEM packages, ATC, SABRE - but I suspect several of those are done in C as well)



As an aside, I have implemented a JVM and a Prolog interpreter, and
worked on both parallel and distributed GC. I've programmed
*extensively* in LISP (starting on DEC-10s) and still have vague
memories of the CLOS vs. LOOPS debate. I've used ML (SML/NJ) and Scheme
a little. I've used Smalltalk on Xerox boxes [dandelions?].  I've used
C++ since the cfront2 days. I've also written applications in SIMULA and
developed hardware in VHDL. I've developed a light-weight environment
for Forth (well, F-CODE).

My conclusion - if you're doing general purpose programming, C is the
best language to use. You can get precisely what you want.

[BTW: the list above is nowhere near complete. I have developed at least
a mid-sized program in PL/I, Ada-83, Python, Pascal, Modula-2, FORTRAN,
various shell, vasious asm, and probably a few other languages that I've
forgotten.]


Have a play with some more modern languages like OCaml and Haskell.


I don't know - what does OCaml have that, say, LISP with CLOS does not? Or (apart from the object stuff) that ML does not?


Basically - I have all the power I need in C. I've seen what can be done in other langauges. It can pretty much all be recreated inside C.
.




Relevant Pages

  • Re: why learn C?
    ... i think programming is different from Software Engineering. ... then I can find other algorithms I have needed which are ... *not* part of which ever language you choose to select. ... and you will have done at least some algorithm development whether you ...
    (comp.lang.c)
  • Re: Other than php/perl/lisp/c/c++/java, anybody have a favorite computer-programming language?
    ... Picking an element based on index makes sense for strings and other ... GCD and a few other algorithms depend on that and would ... on the basis of how well that language supports the functional and ... (data types part 1, mostly the types that can be used as literals ...
    (comp.programming)
  • Re: why learn C?
    ... programming beginner. ... Any language that allows subroutines is procedural based. ... you can learn about algorithms and data structures ...
    (comp.lang.c)
  • Re: Not this again...
    ... > speed when taking into account LOS and FOV algorithms for the character ... more computing power to a neural network to make it "smarter". ... The hardest bugs are in the logic. ... I don't know what language would be optimal for roguelike ...
    (rec.games.roguelike.development)
  • Re: Generators versus Coroutines
    ... > great generator-based servers? ... the Erlang (language + telecom platform) uses light-weight ... Especially in simulations ...
    (comp.lang.python)