HNHacker News
TopNewBestAskShowJobs

qwph

412 karma · joined February 17, 2008

language geek
submissionscomments
qwph··on Overview: C++ Gets an Overhaul (C++0x)
Something like that. It makes the following invalid in C++ but valid in C:

  int *ptr = NULL;
qwph··on Overview: C++ Gets an Overhaul (C++0x)
I remember one early version of a C++ compiler which had NULL #defined as (( void* )0), which caused all manner of fun trying to compile some legacy C code.

This was in 1999, I think.

qwph··on Overview: C++ Gets an Overhaul (C++0x)
Let the ignorant C++ bashing begin...

Speaking as someone who's spent the last 6 years maintaining large C++ applications, I'd like to think that any C++ bashing I indulged in was at least informed C++ bashing... ;)

qwph··on Overview: C++ Gets an Overhaul (C++0x)
It was an interesting exercise. (It gratified my intellectual curiosity, you might say...)

How do you suppose memory management works in high-level languages? Magic?

qwph··on Overview: C++ Gets an Overhaul (C++0x)
There's no law that states that you have to litter your code with calls to malloc()/free() when writing C. If reference counting won't do, there's more than one garbage collector freely available, and they're not all that hard to implement from first principles if the mood takes you.
qwph··on Overview: C++ Gets an Overhaul (C++0x)
C always winds up with huge functions and lots of hard to grasp state up in your face.

That's something I've never found to be the case. Most of my C functions are 5-15 lines long. Anything more than 20 lines long is a candidate for refactoring - the unit tests will tell you if you've broken anything.

qwph··on Overview: C++ Gets an Overhaul (C++0x)
(Speaking as one of those people who did choose to write C over C++...)

People choose C over C++ because C is a simpler language than C++, something which this new standard does nothing to address.

qwph··on Slurping a file in Common Lisp
Enjoyable read. I especially liked the conclusion.
qwph··on Of course MS Windows is better It has Visual Studio
Firstly, learning more than one programming language will make you a better programmer.

Secondly, you are at liberty to write code in your free time, where you can experiment with whatever language/IDE/OS combinations you deem fit. I'd argue this will also make you a better programmer.

qwph··on Don't be afraid to delete code
For the specific example given, yes, that is true. But I think the general principle still holds.
qwph··on Don't be afraid to delete code
How about it?
qwph··on 10 Worst Web glitches of 2008 (so far)
I suppose that's because it didn't result in a user-visible 404 error screen or similar.
qwph··on XML Backlash?
He also said this (I don't think he's much of an XML fan):

"Structure is _nothing_ if it is all you got. Skeletons _spook_ people if they try to walk around on their own. I really wonder why XML does not."

qwph··on How the Large Hadron Collider proton beam is turned off
"Please do not place hands in path of beam."
qwph··on Gearheads don't get it
I guess we'll have to conclude that the "world of guitar" meanings of the terms are substantially narrower than those used by laymen.

http://thesaurus.reference.com/browse/tone

http://thesaurus.reference.com/browse/style

qwph··on Gearheads don't get it
Maybe what he means by "tone" is what you mean by "style".
qwph··on Calloc or Malloc? Any thoughts?
...unless you're writing code for an embedded system which has (say) 16K of RAM and a 1MHz processor, in which case that will cause you more problems than it solves.
qwph··on Calloc or Malloc? Any thoughts?
( void* )0 is NULL, in that NULL is (most usually) #defined to be ( void* )0. But the literal 0 in a pointer context doesn't guarentee that the null pointer is actually all bits zero.

To put it another way, if you have a literal zero in a pointer context, the compiler will replace it with the machine's representation of a null pointer, which may or may not be a machine word with all bits zero.

I think that's right...

qwph··on Ask PG: What are your thoughts on current YC News community?
I wonder how many people who think the quality is going down try to do anything about it?
qwph··on Why the lucky stiff: when you don't create things...
Since when does using a Mac mean you're an aspiring artist who fails to actually create anything?

That would be when someone makes a generalization. I'd suggest that it's always dangerous to generalize when talking about people's lifestyles and habits.

qwph··on Dying baby saved when doc designed & built dialysis machine from scratch in garage
I said "design", not "build".
qwph··on Hyperion’s Nuclear-In-A-Box Ready By 2013
Fair enough. I probably did misunderstand your point - I thought it was that people might endanger themselves, I didn't consider the terrorism angle.

But it's probably a bad idea to have a nuclear reactor in an earthquake zone anyway, regardless of whether it's underground or not.

qwph··on Hyperion’s Nuclear-In-A-Box Ready By 2013
Surely people can get at the electricity powerlines "just by digging" too?
qwph··on Dying baby saved when doc designed & built dialysis machine from scratch in garage
I couldn't see any mention of the time it took to build the device, but I'd hazard a guess that the lifespan of a 6lb baby with failed kidneys could be measured in hours, which would seem to imply that the design was reasonably straightforward.

Not to devalue the doctor's work though. He did save someone's life.

qwph··on Wearing Out My Delete Key
I think people used to do that in the days of punched cards.

More seriously, I have been known to spend weeks thinking about the code I'm about to write, but I only really think about the general form and structure of the code. I don't really get too into issues of the precise syntax until I start actually "putting it into the editor".

qwph··on Ten commandments for developers
I wish all the apps on my work PC obeyed these commandments. There's a certain popular spreadsheet application that damn near reduces me to tears every time I attempt to use it.

("What do you mean, you can't open 2 files with the same name? They're in different folders! For the love of God, why?!")

qwph··on Meet the Rich
"The gap between rich and poor is wider than ever. But that doesn't seem to bother Britain's wealthiest earners."

How surprising... ;)

qwph··on Optimizing Dynamically-Typed Object-Oriented Languages With Polymorphic Inline Caches
I don't think I can edit it now. I'd guess it's because it's not a direct link, so it bypassed the pdf logic. Apologies.
qwph··on Quantity Always Trumps Quality
When learning to play a new piece of music on an instrument, one of the recommendations I heard was this:

Focus first on playing all the notes in the right order. Don't worry about the timing at all, even if it takes several seconds to move from one note to the next. Once you can play all the notes, then you start to work on the timing, playing gradually faster and faster until you have both the melody and the rhythm mastered.

The idea is that once you have memorized the correct movements, it's much easier to work on the timing. If you start playing too fast and make mistakes, you'll start to memorize the mistakes.

qwph··on About the Cruft
Heh, Perl is no match for J! ;)

http://www.jsoftware.com/jwiki/Studio/IdiosyncraticIntroduct...

← PreviousPage 4 of 6Next →