HNHacker News
TopNewBestAskShowJobs

thedigitalengel

490 karma · joined March 4, 2010

http://playingwithpointers.com @SCombinator
submissionscomments
thedigitalengel··on I hate computers. But I love what you can do with them.
The author did not think carefully about the easy-first-use vs. more-productive-in-the-long-run dichotomy. Usually, you can't have both.
thedigitalengel··on Sega says hackers stole data of 1.29 million users
Hackers?

Cliched argument; but every time I see such a misuse, I get a little sadder.

thedigitalengel··on Microsoft refuses to comment as .NET developers fret about Windows 8
We should have something like GWT that compiles .NET to whatever Microsoft thinks developers should use.
thedigitalengel··on The Dark Side of C++ (2007)
Writing a decent C++ compiler is /really/ hard, but why bother about a solved problem!

http://news.ycombinator.com/item?id=2549657

thedigitalengel··on The Dark Side of C++ (2007)
That was an uninformed ad-hominem from my side. My bad, I apologize.
thedigitalengel··on The Dark Side of C++ (2007)
What I meant was that unless you're writing a C++ compiler, these reasons should not longer bother you. Even if you are, you're free to leverage off clang's lexer and parser.

Otherwise it is a lot like saying Java is bad because it is hard to write a good VM.

thedigitalengel··on The Dark Side of C++ (2007)
Firstly, half of the time the guy bitches about flaws with the compiler, and not the languages (Page 0 to 6).

Most of the bitching is about language features which exist. If you don't like auto_ptr then DON'T use auto_ptr! C++ at least allows you to ignore features without paying a penalty. Which is why it has a virtual keyword; and does not make every method virtual like Java.

The at() versus operator[] is also an example of the above: bounds checking can get expensive in a tight loop.

It seems that the author has never seen a large, well-written C++ project. In fact, that is the case with many such C++ bashers (I used to be one too). Once one sees how C++ makes it easy to manage a 500000 line project, they will probably think again.

thedigitalengel··on Why C++ is vastly superior to C
Can you be more specific?

I have a counter example (assuming I've understood you):

/* C /

int foo () { FILE x = fopen("bar"); return 0; }

/* C++ */ int foo () { ifstream in("bar"); return 0; }

thedigitalengel··on Why C++ is vastly superior to C
To put that in perspective, 128 bytes is an x64 program's stack's red zone. :D
thedigitalengel··on Why C++ is vastly superior to C
Most projects have a set of coding guidelines. I don't see why it cannot specify things like: "Don't use operator overloading!".

Google does, for one thing.

Without discipline both C and C++ will blow you up completely. With some discipline both the languages are manageable, and C++ more so; which is what the OP points out.

thedigitalengel··on Why C++ is vastly superior to C
C and C++ have considerably overlap in use cases, which is what makes this argument valid.

Comparing C or C++ to Ruby or LISP is stupid.

thedigitalengel··on Why C++ is vastly superior to C
You don't get a warning because the program is doing exactly what you asked it to do. You said a C with x = 0 is equal to 'true'. And you said a D with f = 0.0 is equal to 'true'. By transitivity of equality ...
thedigitalengel··on Why C++ is vastly superior to C
Most of the points mentioned in that particular link pertains why both C and C++ are inferior to languages like LISP and Python which have garbage collectors, weak type system and the like.

The bitching about bad compile time errors has been mostly fixed in clang.

Then only _inconsistency_ (in the correct sense of the term) in C++ I am aware of is the unordered initialization of static objects. So if you have "class A { ... A () { } };" and have a "A foo;" declared somewhere with static linkage, it can be hard to pin down exactly _when_ that constructor will be called. It will be called before control is transferred to main, but you may want even finer control.

If you have noticed other inconsistencies I'd love to know.

thedigitalengel··on Easing into SICP
This is obviously not a universal formula, but I started out with "Practical Common LISP"; and then went on to SICP, translating the Scheme code into CL code as I went along. I then followed this by "On LISP".

For someone who does not know programming at all, I'd recommend SICP first. The text is dense, no doubt there; but, IMHO, not dense enough to deter reading.

Of course, I'm more of a "learn-it-the-hard-way" person; mileage may differ for more easygoing people.

thedigitalengel··on Ask HN: Who Is Hiring Remote Workers? (January 2011 Edition)
Please mention if you're interested in hiring a remote intern.
thedigitalengel··on Ask HN: Favorite pointer tricks in C?
x86 is cache-coherent; we can directly modify code at runtime and expect things to work.
thedigitalengel··on Ask HN: Who Is Hiring Remote Workers? (December 2010 Edition)
Please mention if you're willing to hire a remote intern.
thedigitalengel··on Ask HN: Favorite pointer tricks in C?
You may want to show them how you can generate code by emitting assembly hex-codes into a block of memory and then _call_ the block of code after casting it into a function pointer.
thedigitalengel··on Ask HN: Show me your Half Baked project
http://github.com/sanjoy/L

A call-by-name untyped lambda calculus evaluator. I have no clue what to do with it.

thedigitalengel··on Microbenchmarking Mono's new GC
That imposes an uncalled for runtime overhead. A better way would be to implement it using code-patching, by overwriting the instructions at specific pre-determined locations which will then cause the thread to halt when executed.
thedigitalengel··on Microbenchmarking Mono's new GC
Even with the threads possibly stopping at unsafe points, a mostly precise scan (saving the last stack frame) can be done if the stack maps are maintained for all the call-sites.
thedigitalengel··on Microbenchmarking Mono's new GC
What happens if the native code enters, say, an infinite loop?
thedigitalengel··on Poll: When do you usually go to bed?
The early to bed and early to rise paradigm works incredibly well for me - there is something about being up before sunrise that boosts my productivity.

I sleep 5 hours when I'm not working out and around 8 hours when I am; which means my sleeping hours are either [12 AM, 5 AM] or [10 AM, 6 AM].

thedigitalengel··on I don't like Python. Does that make me a bad person?
> It'd probably be more accurate to say that Java deliberately limits its expressiveness, in order to make it harder for people to shoot themselves in the foot, and to make it easier for one programmer to understand what another has written.

That is exactly what I meant.

Bad programmers exist. They will write bad code, no matter what language they're made to use.

thedigitalengel··on I don't like Python. Does that make me a bad person?
I'm not really not complaining about anything - the shortcoming clearly lies within me and not in Django or Python.

The purpose of this thread was merely to gauge what kind of paradigm shift people who were used to programming in C or C++ generally experience when they move to Python. Some people seem to find making the jump easier than others - I personally have found it difficult and have made little progress so far. Since I generally consider myself good with computers, I find this a little unnerving.

thedigitalengel··on I don't like Python. Does that make me a bad person?
What I implied was that it was not immediately obvious what the class was.

def foo (self, stream): What is stream here?

void foo (std::ostream &out) { out << "bar" << endl; }

Hope you get the point.

thedigitalengel··on I don't like Python. Does that make me a bad person?
As I said earlier.

"Secondly I don't mean to criticize Java. By calling it a toy language, I was simply referring to the fact that Java tends to make writing bad code difficult, and in doing this takes away some of the flexibility and power that you tend to associate with other languages."

Judging from the general reaction it seems I should not have used the term "toy language". My apologies if I ended up implying that Java has little practical use.

thedigitalengel··on I don't like Python. Does that make me a bad person?
I think the header-file and source-file distinction was more of an architectural decision (so that you could implement an efficient compiling and linking system) than a language design decision.

Just an opinion, though.

thedigitalengel··on I don't like Python. Does that make me a bad person?
Would it not be better this way:

for (i = 0; i < 1000; i++)

     printf ("%d %d %d\n", i / 100, (i % 100) / 10, i % 10);
IMHO, such patterns (multiple nesting with empty outer loops), in most cases, are really an indication of just one real loop. Using multiple counters might also be an option.

In case the loops are doing something different, they should be indented separately. For instance, the following makes little sense:

for (i = 0; i < 10; i++) {

foo (i);

for (j = 0; j < 10; j++) {

     foo (i + j);
for (k = 0; k < 10; k++) {

foo (i + j + k);

}

}

}

thedigitalengel··on I don't like Python. Does that make me a bad person?
It seems some of the HN eats up some of the asterisks. But you get the idea.
← PreviousPage 2 of 3Next →