Hacker News new | ask | show | jobs
by DrTung 4501 days ago
I also find comfort in C/C++, it's something about that closeness to the metal that does it.

In most other languages (recently I've done a bit of Python) you feel like your walking in someone else's shoes. But with C/C++ it's just you and the machine.

1 comments

Totally! I read another blog post, not long ago, that describe it pretty well... He said something like: You need to know what every single line of your code does and when to clean up after yourself - in turn, you know what every single of your code does! :)

That makes the code so much more robust and you are less likely to make wrong assumptions about what a function or piece of code does.

I do a lot of JS at the moment - node.js and jQuery - what I hate the most, is all the wrong assumptions I have, when somebody makes a function called "clone" (this particulalry one copies the reference) or when jQuery has chained functions, that does not "inherit scope"...

I wish I had the time and patience to learn assembly - but then again... C or C++ is close enough and probably way faster to get anything done in :)

Re. JS: "Standing on the shoulders of giants" can have its perils, when the giants exhibit a different mind set about scope or so.

Re. assembly, I'm pushing 60 so I've written a lot of assembler in the days, most of it on PDP11 and AppleII. Last time I coded in assembly was 1993, so if you're not writing your own BIOS you're good without it.

Funny, though. The other day I missed something from assembler, and I'm not taking about speed or lowlevel stuff. No it was the ability to switch text segments, in C++ it would be equivalent to be able, in a single .cpp file, to switch from one translation unit to another.

Re. giants - that was very well put! :) It seems like the wealth of new languages is creating a new breed of programmers, who think it is possible to know a language, after having developed in it for 1/2 a year or so...

I think that's dangerous as each language has a syntax, that is usually very easy to learn, a set of functionality and maybe some libraries, that takes some time to get used to... But then there is all the pitfalls, the bugs that you need to learn about, the need for a way to organise the code, so it doesn't become a mess...

I tend see this as "getting into the mind of the creators".

Re. assembly, I think the reason I would like to learn it, is to get a better understanding of "the metal" - not so much actually developing in it, unless it has to do with embedded computers.

It's funny how you always seem to miss something from language x, when you are coding in language y :)

So... If you are pushing 60 - what is your thoughts on all the new languages and, in my opinion, the extremely slow progress we are making, when it comes to how we "command" computers to do stuff?

I think you have spend enough time creating DB connection libraries, web servers and other networking code, forking/threading models... It should be time to make use of existing code in way that makes it extremely fast to create very well-functioning programs.

Basically: shouldn't it be possible to (more or less) create a set of test cases and have the system create the actual program, by combining existing blocks of code? Isn't that what we are striving to do all the time, by collecting more and more base code we re-use?

Yeah, agree about learning assembly for the sake of grokking the hardware, bluescreen texts, and it helps when configuring bootloaders like Grub.

If you have a Windows XP installed somewhere, you can learn some assembler just by playing/poking the video memory with the old DEBUG.EXE program, like this:

1) Switch to fullscreen/DOS mode by running CMD.EXE and pressing ALT+RETURN. 2) Start DEBUG.EXE 3) Check you're on the right track by entering df000:0, it should display ... IBM COMPATIBLE... something 4) Fill the video memory, e.g. fb800:0 888 1 2 3 4 5 6

Try to understand what you just did :-) then try to enter some assembly code, start with the command a100

Re. our progress with computers, I think actually things have progressed rather nicely, ok maybe not so much with JS but look at Go for example, they're really trying to fulfill the old dream from the 80's of "sofware ICs". I've just written some small test programs in Go, but it's remarkable that once I've built an .EXE file, I can copy and run it on other Windows computers, no installation or other configuration necessary.

BTW, I'm testing out Qt right now, in that framework there are some great promises of code reuse.

Nice! I have an XP running in VirtualBox for testing, so I just tried what you wrote - that was fun! :) I have no idea what I just did, just that it felt good, to make that impact on the screen with that little code, knowing it was done directly ;)

I will have to set some time off to understand it (better)!

Re. progress, I just have this feeling, that we are just doing the same, over and over again - then creating another language to do the same over and over again. In electronics we have components that does 1 thing, usually with different values. In the worst case, we take a standard component and program it.

I would really like to have a process, where I can architect a system and the data flow and finally code a couple of non-standard functions/classes/methods/whatever and be done :)

Good or bad, Apple is trying to do it in Xcode and several IDEs, give you a glimpse of this. Maybe they just create your HTML for you, but that's a step in the right direction. Of course it would be best to be able to re-use your own code, for the "automated" parts, instead of relying on someone else's idea of what HTML and other code should look like. These guys are trying to do it for Node.js: http://noflojs.org I think it looks really promising. It would be great to be able to concentrate on solution specific code, rather than "everything".

Re. Go, it is my one big regret, I chose Node.js over Go, a couple of years ago. I didn't have the time to understand enough of both languages, so the choice was Node.js, due to the fact "it's javascript" and that it seem good, when I did some prototypes.

The reality is, you client-side developer, should probably never touch your server-side code! It is far from the same. Same syntax, same way of creating classes, less scope problems, there is only 1 environment, so you can remove some code. But from there, it's totally different! Which of course should make sense, since it is two completely different purposes.

Currently we are maintaining our code in a way (APIs), that ensures we can change either side without problems. So they future will probably be Go, as that seems like the best fit for multi-platform (BSD/*NIX) web-service development.

I ran into Qt years ago, when I was trying to get away from Java for a desktop app. I actually ended up with Python and Qt :) It was really a much horrible experience, than I would have thought! :) Qt just worked as supposed, with it's limitations (at that time at least), which wasn't to big of a problem. Have you tried on Mac?..... :)

(had some trouble posting on Hackernews earlier)

Re. Qt on Macs: sure, matter of fact I prefer to work with Qt on my MBP, the fonts are prettier etc.

I first tested Qt one year ago, they are really making progress, you should check out the recent release 5.2.

BTW, I've started a blog (mostly) about Qt: http://tripleboot.org