Domain: cprogramming.com
Stories and comments across the archive that link to cprogramming.com.
Comments · 21
-
Goldstine - Computer from Pascal to von Neumann
The C Programming Language - Kernighan and Ritchie: http://www.cprogramming.com/bo...
Herman Goldstine, The Computer from Pascal to von Neumann: https://muse.jhu.edu/book/2981...
-
Re: Very much so!
If multiplication of your objects doesn't make sense, then why on earth would you overload the * operator?
If bit shifting your object doesn't make sense then why on earth would you overload the << operator
I can't really make up my mind on operator overloading. On the one hand it can make custom types far more pleasant to use. On the other hand because operators are more concise than function calls and you can't add new ones it's very tempting to abuse operators to mean something other than their original meaning. Heck it's so tempting that even the authors of the standard library did it.
-
Re:C++ is C
(There are a few gotchas moving in either direction - http://www.cprogramming.com/tu... - but it's not hard to avoid them.)
Like having to create a cross-compiler for your target platform.
The C standard is intentionally kept small and with certain functionality kept undefined to ensure that it is easy or at least possible to write compilers for everything.
C++ is a great alternative to C in the field where Java, C# or Python are contenders.
It's not a catch all replacement for C. -
C++ is C
Modern, best-practice C can be compiled with a C++ compiler. (There are a few gotchas moving in either direction - http://www.cprogramming.com/tu... - but it's not hard to avoid them.) For all its object-oriented impurity and spec-bloat, the one thing I love about C++ is that you can write relatively high-level code when that makes sense, but you always have the option to grapple with all the fine detail when that's useful.
-
Re:Classes/Templates are not a magic bullet ...
erm, I think you need to learn more about it. You're trying to apply C semantics to C++ programs assuming that the C style is the only way to achieve performance and efficiency. Its not the case.
Most compilers will happily optimise and remove a lot of redundant code, things like RVO (for an example) shows how you can return a full object from a function yet no copying of that object takes place - the compiler optimises it so the returned object occupies the destination space directly.
Even for template code that is instantiated for different types, this isn't much of an issue. Strongly typed code is a tradeoff worth having, code is tiny anyway compared to data.
Now there are cases where you do need a collection of pointers to heap-based objects. You can still have such a thing, even using the STL - a list of void* is still valid, but you can also have a list of shared_ptr types, so you get everything you want (no bloat, no object copy) and everything I think is good (type safety and object semantics) at the same time.
There's also C++ move semantics to in the new C++11 standard. Even Microsoft supports that
:) -
GOTOs
I like GOTOs... and so does this this guy, and this guy and the book on writing Linux devices drivers
Can you take your dogma out back and shoot it? 8-)
-
Re:Stop trying to make the browser more than it is
Do you realize the amount of work and back-and-forths you need to do only to perform an action when you click on something on a page?
Good morning and yes. What's your point, that it's simpler to do it without? It's not set in stone that you need to do it this way, it's merely another option with pros and cons. Alternatively you may use a traditional POST. The caveat is the entire page is reloaded which is often unnecessary, one often only needs to update specific information on the page like an image or a text field. This is more of an architectural issue. If you want a pre-2000s website you may stick with the POSTs however a great many people tend to like the interactivity which JS provides on top of HTML - look at the popularity of Google's web offerings.
Do you realize the amount of work spent cross browser testing (and the back and forths with CSS)? Or do you know how much back-and-forth is required with traditional desktop development? For example look how much cruft is involved handling windows messages when creating a Windows application for say an OpenGL project. -
Re:the best.
Exactly, I agree about the abstract nature of Object oriented languages. In fact: http://cboard.cprogramming.com/c-programming/130159-why-so-many-typedefs-same-thing.html#post971331
I, however, am against most of the companies that support and force others to endorse C# and its evil friends. Call me fundamentalist -- it's what I call myself -- but Human Rights apologists were also called fundamentalists when it all started. -
Re:Two things
It's actually a 30D, but there's no way I'm selling it, it should be decent quality for quite a few years to come at least. Perhaps will lend it to my sister if she has problems with her 400D or whatever she has, she's studying photography at college this year. I only have one decent prime lens and a mediocre zoom lens so far, was going to buy a better zoom that cost more than the camera, but until I start using the camera regularly that would be a total waste! When I was taking photos regularly I did everything with a Sony Cybershot W1 - it took great pictures but I still wanted something with more aperture control and so on (I did was a couple of courses in high school with some old black and white SLRs, and I kinda hankered after the control we got with those, though I love the immediate results you get with digital).
My deviantart id was Kermon (a lot of my photos are still up there) but my account got banned when I created a different account to speak to my Canadian ex (who came over here for 5 months to be with me but then we had a pretty nasty breakup) after she blocked me, as it's against the terms of service. I could get around the block easy enough and start another account for photos, but I think it's best to just keep myself away from there for a while, maybe forever, because it's not a nice reminder (we met through deviantArt). That's part of the reason I haven't started doing photography properly again, I don't know anywhere as good as dA for uploading art, getting comments on it (and favourites - they're addictive
:s ).I like your crazy psychedelic styles, and the chalk stuff is impressive to me since I've not drawn anything since early high school. I never studied art, so I always think I'm no good giving actual critique. I don't envy you having to look at a topless old lady anyway! Eww.
I never explicitly 'learned' C++. I learned a lot of C from a book, but the template code for the bots I wrote (just a bunch of DLL hooks to get it connected into the game, but you had to do the AI yourself) was in C++ so I just kind of picked it up as I went along. I still wouldn't know the syntax for creating a class for example, but I just look that kind of thing up when I need to... I've used a few different languages in my time, ranging from BASICs on the Amiga, to C and C++, Delphi (Pascal), JavaScript, PHP, Perl.. it's all the same stuff (apart from when we did functional languages at University, they're pretty crazy
:) ). I don't think it's sad that you haven't learned different languages yet, sounds like you've done a good variety of projects at least. I've never done any proper cryptography or anything (read a little about it but never done any practical stuff). Classes and stuff shouldn't be that much of a big deal. Well I say that, but I probably still don't think enough in object oriented terms when coding, as I started off using languages that just didn't have a notion of objects. I think I've got the ideas down okay though. It was interesting looking through stuff like the Half Life and Quake III SDKs because then you see how each entity (like the players and enemies, and even just weapon pickups and the like) in the game is derived from a common class, so they all have 'die' routines and so on. That's a fun way of seeing object oriented coding in practice. It may be a bit weird getting used to have to use different variable types, and pointers though. I remember pointers were one of the weirdest concepts to get my head around in programming, but once you get the idea it's great, they let you do a lot. I'd recommend a good book for you to learn C++ but I don't really know any, sorry! This site looks pretty good to start with though. -
Re:Excellent Post
Here's what I got, so far. Sorry it's not tabbed and cross-referenced...
http://ask.slashdot.org/article.pl?sid=08/09/17/224230 -- in case anyone wants this page, too
http://www.quickref.org/
http://gotapi.com/
http://www.regular-expressions.info/ -- regular expressions
http://www.perlmonks.org/
http://www.rosettacode.org/wiki/Main_Page
http://perldoc.perl.org/
http://www.perlbuzz.com/
http://java.sun.com/reference/
http://forums.sun.com/index.jspa
http://developer.mozilla.org/ -- javascript
http://www.w3.org/MarkUp/Guide/
http://www.w3.org/MarkUp/Guide/Advanced.html
http://www.w3.org/TR/html4/
http://www.w3.org/TR/xhtml1/
http://www.w3.org/Style/Examples/007/
http://www.w3.org/Style/Examples/011/firstcss
http://www.w3.org/Style/CSS/learning
http://en.wikibooks.org/wiki/Programming:Tcl
http://www.acm.uiuc.edu/webmonkeys/book/c_guide/
http://cprogramming.com/
http://www.cplusplus.com/
http://cm.bell-labs.com/cm/cs/cbook/
http://www.parashift.com/c++-faq-lite/
http://en.wikibooks.org/
http://developer.apple.com/
http://cocoadev.com/
http://www.cocoabuilder.com/ -
All +5 moderated links
http://www.perlmonks.org/
http://en.wikipedia.org/wiki/Scheme_(programming_language)
http://www.schemers.org/Documents/Standards/R5RS/
http://srfi.schemers.org/
http://mitpress.mit.edu/sicp/full-text/book/book.html
http://www.quickref.org/
http://java.sun.com/javase/reference/api.jsp
http://www.rosettacode.org/wiki/Main_Page
http://cprogramming.com/
http://www.stackoverflow.com/
http://cm.bell-labs.com/cm/cs/cbook/
http://yutaka.is-a-geek.net/
http://www.gotapi.com/
http://www.open-rsc.org/
http://www.users.bigpond.com/robin_v/resource.htm
http://www.geocities.com/orion_blastar/contact/
http://en.wikibooks.org/ -
C/C++
http://cprogramming.com/ - best site for beginners in my opinion.
-
The visual cortex is huge!
What to teach? Video games and graphics.
In a nutshell: Point him to,
Gamedev.net (The forums are the best I've found anywhere.)
cprogramming.com (Going through the C tutorials is a great, grea way to get started with the language.
Also give him one (or both) of these:
1 - A pointer to the framebuffer.
2 - Nice OpenGL initialization code.
In fact, I'd say that there is almost nothing as rewarding as starting with just a "putpixel(x, y, color)" function and finishing with a 3d cube spinning around. Programming graphics teaches so much: Math [motivation to learn linear algebra! A concrete way to understand parametric functions... and calculus (If you start coding before you take Calc I, you will reinvent Euler integration yourself)... and functions... and recursion/induction... and... well, everything...], abstraction (putpixel is inside drawscanline which is inside drawtriangle which is inside drawmodel which is inside drawbadguys which is inside...), etc, etc, etc. And since it requires speed (you want to run at interactive framerates), it'll motivate efficient algorithms, too.
And -- I should really emphasize this -- people are visual. Nothing taught me math like watching it draw pictures. Concepts that confused my classmates came intuitively to me (me! The kid who couldn't memorize his times tables in third grade! The kid who kept making sign errors! The kid who everyone thought was bad at math! The kid who's now a PhD student in Control Theory!) -- because I'd seen them draw pictures. The visual cortex is a huge part of our brains, and harnessing it does incredible things. So teaching graphics programming is bigger than just teaching graphics programming: It's making connections so that your son can visualize math. And that is huge.
Graphics and games. Give your son a pointer to the framebuffer. The rest will follow.
-
Memory "leak" (was: Re:The 9 Reasons)
5). Memory leak: I often run Firefoxes for a whole week long. Yes, you read that correctly. I often just leave important links open when I leave work, then I login back from home and continue useing it, then again tomorrow from work, and so on. After a week it often eats up around half a gigs of memory, true. But really, how many of you do such things ?
Sorry, I'm gonna rant now
...What, a whole week? My computer (running Ubuntu 6.06LTS) is up all the time. Basically it goes down when there's a power cut. Current uptime is 55 days (reflects the fact that I moved house 55 days ago). X hasn't been restarted in all that time.
Why does Firefox need so much memory to display a few web pages? And why doesn't it at the very least return the memory when I, say, close all but one web page? I mean, I know C++ is an awful computing language to write anything in, and modern languages have garbage collectors, but still there's enough memory checking tools out there so they can catch these memory leaks by now.
Or is it a misguided attempt to "cache" stuff in memory, which is about the stupidist thing you can do given that today memory is very slow versus processors, so usually it's faster just to recompute what you need when it's needed. Typical C++ programmers wouldn't know that though - they're still reimplementing reference counting on every one of their classes, when a central, optimized garbage collector would be a lot faster.
/rant over
Rich.
-
How To Resolve Links!
You might notice that if you click a link with a swgemu.com base, it redirects you to Crayola, Teletubbies or Lego's site. This is because of how the hosting service is implemented. Almost all the swgemu sites I go to require me to cut and past links into the browser and to make sure they are preceded with http://./ So for instance, paste "http://forums.swgemu.com/viewtopic.php?p=24081#2
4 081" into your browser and you should see the linked forum.
This is, of course, with the exception of the screenshots hosted by gamerspace or the video (which really just seems to be a transition of the stills). Note, I'm not sure if the YouTube video is the same as the one from the mirrors, I'm still downloading that.
I should also point out that the forums are tightly moderated as swgemu is not looking for trouble with legal issues regarding SOE. I think they've had tangles with them in the past and don't enjoy discussing it. I don't actively post on swgemu but am thrilled by the idea of what they are trying to create. The concern by SOE is not only stealing paying customers but also the fact that if this is open sourced, then anyone will be able to see the reverse engineering work which means a whole lot more attempts on hacking the servers.
Most importantly, there are no dates set whatsoever for this project. I am just sitting back and waiting for hopefully a chance to play a game I once knew and loved. A game that exists no more. Pre-CU SWG.
I guess it had such a huge client that most of the functionality had to be sitting on each client machine and the server required some interaction. Hopefully this reverse engineering provides a stable alternative. If you'd like to contribute, help them with the datapack done in a Wiki format! If you're interested in development for the team and know C/C++, check out this post. -
Re:skillset
I agree wholeheartedly with the parent. This is a hobby project, right? The point is to have fun, and to learn something? In that case, I think you'll have more fun if you don't start with a premade "game engine."
Start from scratch. It sounds intimidating, but that's just because you haven't tried it: You will be amazed at what you can do.
You don't need to spend any money. Compilers are freely-available. Between that, the web as a reference, and your own intelligence and creativity, that's all you need!
Do you know a programming language? If not: You say you can write scripts. If you can learn to write scripts, you can learn to write code. If you need to choose a language, I'd recommend C++ or Java; C++ is probably the most commonly-used language in game development. This site was an important reference for me when I was getting started. Go through all the tutorials. Don't rush to get out of the console: It's a great place to focus on your logic and your algorithms without worrying about interfacing with graphics APIs. It's where you learn how to think about programming.
Then, graphics! I'd suggest you start with some OpenGL programming. That's for a number of reasons. It's not just that OpenGL code is widely portable: Compared to Direct3D code, it's a breeze to write. Carmack himself wrote a piece about how OpenGL programming is a straightforward, enjoyable experience.
Where to start? Try NeHe's tutorials, and its parent site, gamedev.net. That's how I started writing OpenGL code, and I had a lot of fun doing it.
Then, think about what sorts of worlds you want to represent. Landscapes? Indoors? Look up the relevant algorithms and data structures. You care about spatial partitioning schemes, occlusion culling, and LOD. This is where it starts to get advanced. Here, you'll learn more than just to code; you'll learn some actual Computer Science.
You don't need to worry about this now, but when you get to the point where you're ready for it, there's stuff you can google. Spatial partitioning: BSP (older algorithm, computationally beautiful, generally used for indoors), Octtrees (more modern approach, conceptually simpler, lets you efficiently throw stuff at the graphics card), Quadtrees (variant for outdoor environments where the map extends mainly in two dimensions), K-D trees (special case of BSP which behaves more like Oct or Quad-trees). LOD: For outdoor scenes in particular: ROAM, geomipmapping. Occlusion culling and visibility: Portals, precomputed PVS, image-space techniques with occluders.
Just explore, experiment, and have fun. You'll learn a lot.
-
Me thinks thou doth protest too much...Hello Dante, let me introduce myself. I'm Lord Kano, and I'm about to expose you.
Your post caught my eye because it was really funny. Then I started to wonder what else you talk about in your posts.
Looking at your recent posting history I have found the following.
Negroponte says Linux too 'Fat'- I have enough problems without slashdot starting to sound like my girlfriend.
Startup Webaroo to put the 'Web on a Hard Drive'?- Would the downloadable content include porn?
Er, I'm asking this in order to, er, protect my girlfriend's sensibilities. Can't have her unwittingly downloading such naughty stuff you know. =)
Two Unofficial IE Patches Block Attacks- Are you related to my girlfriend? Because she asks smart questions like you. =)
So many references to your "girlfriend" in so short a time aroused my suspicions so I decided to google for '"Dante Shamest" girlfriend' and guess what I found.
THIS proof that you are a liar with no girlfriend.- I fooled somebody into thinking that I had a girlfriend.
But...I don't.
You've been using the same bullshit ruse for over a year now. It's ok if you're celibate, but it's just plain pathetic to lie about having a girlfriend.
LK -
More programming challenges...
Just looked on google and there's a ton of stuff. Quite interesting was Cprogramming.com's C++ Programming Challenge, but there's loads more....
-
links
-
The right place
Try posting on the Borland message board at cprogramming.com.
-
The right place
Try posting on the Borland message board at cprogramming.com.