Slashdot Mirror


User: Destrius

Destrius's activity in the archive.

Stories
0
Comments
19
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 19

  1. Its about Types on Null References, the Billion Dollar Mistake · · Score: 2, Insightful

    I think the main issue here is that when you're developing a type system, you generally want the types to classify objects into certain categories that tell you things about them. So if I define some kind of a reference type, what I am saying is that an object of that type is a kind of a pointer to something.

    So now, if I allow null references, then my reference type is really saying that "objects of this type are pointers to either something or nothing". That's all well and fine, but it makes the type less precise, in that it conveys less information about the object it is categorizing.

    As it turns out, this lack of information is quite important because one of the most common things you have to check when you're given a possibly-null reference is whether or not it is null. You need to insert "if (ptr == NULL)" all over the place. Thus reference types which allow null references ultimately give me less expressive power.

    Most of the time null references are created because either an error condition must be reported (e.g. malloc fails), or it is unclear at some point in time whether or not an object exists. Error conditions can be better signalled using exception handling. As for cases where you're not sure if the object exists or not, then one possibility is to use an option type like in Standard ML:

    datatype 'a option = SOME of 'a | NONE

    This is a polymorphic type that says that either the object exists or it doesn't, and you can find out what the situation is by using a "case" statement on the datatype constructors:

    case foo of
        SOME(x) ==> ... [do something with x] ...
    | NONE ==> ... [the object doesn't exist] ...

    Thus by combining a reference type without nulls with an option type, you can create "reference option" types, which have all the flexibility of "with-null" reference types.

    But the cool thing is, you only ever need to check the "null-ness" of the object only once; once you do the check, you're handed a reference object which is guaranteed to be non-null. Thus you can easily partition your code into parts that will do the non-null check and those that assume all references handed to it are valid.

    This is why a good type system can make programming so much cleaner and easier :)

  2. Graphics Programming on How To Encourage a Young Teen To Learn Programming? · · Score: 4, Insightful

    Being able to produce pretty pictures is always fun. I learnt programming by spending all my time drawing bouncing balls that changed colour in 320x200 VGA. Of course nowadays kids can use a lot more powerful graphics libraries like the aforementioned SDL, which can let them make a lot cooler stuff.

    If he gets the hang of it, you could even teach him how to write a raytracer. That would also be good for his math, and be a nice project where more advanced programming techniques (e.g. data structures, recursion) and more advanced math (calculus, 3D geometry) have practical uses.

  3. ssh + vnc on Persistent Terminals For a Dedicated Computing Box? · · Score: 5, Informative

    You could use VNC, but set it up so the vnc server is only accessible via localhost, and then use ssh to create a secure tunnel back to your client. Alternatively I sometimes use vnc and ssh with X11 forwarding, i.e. the actual graphical data being sent over the network is over X11 as opposed to VNC's protocol.

    screen is cool and pretty easy to use, RTFM. But its command-line only, so not applicable if you need GUI as well.

  4. Re:Low ID Roll call on A Brief History of Slashdot Part 1, Chips & Dips · · Score: 1

    I'm still alive. No idea when I registered though... is there some way we can check? Perhaps there's a timestamp in the database?

  5. Great Theoretical Ideas on Math And The Computer Science Major · · Score: 1

    Carnegie Mellon's CS program has a required course called Great Theoretical Ideas in Computer Science I, which is basically a hodge-podge of different forms of mathematics. Mainly discrete math. Basically, it was designed to give CS majors the minimum level of mathematical knowledge they'd need for further majors.

    You can check it out at: http://discretemath.com

  6. Re:Eternal Life Web Ringhttp://switchblade.cyberpu on Alex Chiu on Science, Religion, and Politics · · Score: 1

    Erm... most people say the same thing about trolls as well you know. No matter how much fact you throw at their feet they won't change their convulted opinions one bit.

    Of course he doesn't strike me as a troll. Just weird. But I've seen worse on the net. :P

  7. Hmm.... on First Arcology? · · Score: 1

    Wow. The world's biggest phallic symbol. :P

  8. Why 3D doesn't seem to make sense... on The 3Dsia Project: More Than A 3DWM · · Score: 1

    I think unless somebody comes out with a really different and useful paradigm for computer data, 3D shells won't take off.

    Let's start by looking at mathematics. Math is a highly abstracted "environment", where there are real dimensions. In fact I think this is true for all the higher-level sciences; physicists start with complex situations and reduce them down to relatively simple equations to solve and interpret.

    So, in most of our history, what humans have been doing is reducing the number of dimensions we need to view things in. Particles colliding in a 2D world are reduced to x and y components on a piece of paper. In order to be better able to analyse situations, we aim at reducing the number of dimensions we need to think in. Einstein may have been able to think in four dimensions, but he had to simplify that to math to do anything useful.

    Now, we have a computer. The computer traditionally stores its data internally as you would store data on a piece of paper. The data has already been abstracted. In the beginning, we had text-based interfaces, which were natural extensions of the way data is stored in a computer. GUIs popped up next, because they offered benefits such as easier visualisation of data.

    However visualisation seems to always come at the cost of manipulation. While it is very useful to be able to "see" the data to understand it better, you can't do as much with it as you could if the data was represented in a more abstract form. Which is why you can do much more complex file operations in the console then in a graphical file manager; in the same way you'll find it easier to solve a mechanics problem if you express it in equations than if you imagine moving particles.

    If we move on to 3D systems... we may be able to visualise even better. But what will the cost be? Perhaps from selecting files matching "d*s.c" in console, to selecting all files starting with "d" from a GUI, we're left with clicking on all the green colour blobs we see.

    I know 3Dsia is "not a file system visualiser", but the example should still hold in most applications.

    And even worse, note that because data in a computer is stored in an abstract form, converting it "back" into a concrete 3D form would not make much sense. Everytime you abstract something, you get rid of the unneccessary details. When you have an apple on a table, it becomes a sphere on a plane, and then a set of numbers. So now I want to get back to the apple. But I can't, because I got rid of the unneccessary information that made it an apple. What do I do then? Add in my own arbitary information? What use is that? Things will just get more complex without any benefits.

  9. Re:Diablo II on Worst Games Of the Year · · Score: 1

    Perhaps this will be construed as flamebait also, but what I'm giving here is really my personal opinion on Diablo II.

    Diablo II is one of the worst games I've played this year. One of the reason probably being that I haven't played a lot of games this year, and my tastes are generally towards RPGs; I've never enjoyed any FPS at all. So obviously my comments are biased, but hey, its always good to see things from a different perspective, no? :P

    Anyway, the thing I hate most about Diablo II is that it is being marketed as an RPG, and in some reviews I even read about it being the best RPG title of the year. That's quite an insult to the genre, because Diablo II is as much as RPG as the cheap D&D hack 'n slash game you can find at arcades.

    It lacks a good storyline, consists of nothing but killing and more killing, and in fact compared to the original Diablo, its even lost one of the things that made me play the game in the first place.

    The original Diablo had much more of a sense of gothic horror than the sequel. The game felt dark, there was a smell of evil in the air, and as you went down the dungeons you'd feel slightly nervous and wishing for some kind of holy protection.

    In Diablo II, I don't feel much of that at all! It truly felt like a third-person shooter; zero immersion. The concept of waypoints and the way you save games is also very un-RPG like.

    So basically Diablo II ranks as the worst game of the year for people who like to play RPGs. :P

  10. Re:SDMI on Slashback: Imagination, Evasion, Watermarks · · Score: 1

    Creative's SB Live! can record output from the soundcard easily; in fact, the default setting for "recording device" is "what-u-hear". I use it often to record MIDI output to wave files, so basically anything that can be played to the speakers can be recorded at the original quality.

    I don't think the recording industry is ready to take down Creative on this. :P

  11. Re:No Thanks. on Baldur's Gate 2 Gold · · Score: 1

    Try Planescape: Torment. The goals in the game are far more complex than just killing everybody and becoming a superhero.

    And with regards to Torment 2, I think perhaps it would be more fun if instead of using the same characters in the first game, the sequel should feature an entirely new character, that in the course of the game may meet up with the Nameless One's companions and have them join him/her. The story in Torment 1 is already complete; extending it any further is likely to spoil the story.

  12. What about the keyboard? on Building Nautilus: Behind The Scenes · · Score: 3

    One thing I've noticed is that most of the file managers nowadays go on and on about how good their graphical interface is, how well implemented drag-and-drop is and so on, but almsot none of them touch on how the keyboard can be utilised.

    I understand that some people would prefer to use the mouse to do everything, in which case something like Nautilus would be ideal, but how about those of us who prefer the keyboard? Adding in a good set of keyboard mappings is quite easy to do, but sometimes its sorely neglected.

    I almost never use gmc. When I want to work with the filesystem, I open up an xterm. When I work in Windows, however, I use Explorer all the time, and one of the reasons for this is that its very easy to do everything with the keyboard. I can select a set of files, Ctrl-x them, Alt-Tab to another window, and then Ctrl-v them into the new directory. To me this seems much faster than arranging the windows and then dragging the set of files to the other directory.

    One reason why I don't like dragging and dropping with the mouse is that I find it a bit stressful on my hand after doing that for too long. If somebody has a physical disability that prevents them from using the mouse in such a way, can he/she still use Nautilus?

  13. Re:Any advantage in PHP over mod_perl on Two Books On Programming With PHP · · Score: 1

    Would it be possible to add in better support for general scripting, maybe in some patched php binary? I'm not too sure, but when you run a php script from the command line, you'll get the HTTP headers in the output. And data seems to be outputted only when php completes execution of the script.

    I've been trying to learn perl for some time, but can't get the hang of it. I love PHP, however, so I'd like to use it for general-purpose scripts and not have to use too many tricks to get it to work.

  14. Re:Representation, labelling, and what a geek is on Anime And The Tech Lifestyle · · Score: 1

    I don't exactly think that it's a great thing to be "different" at all costs, and be proud of that. Geeks are different from most people because they work differently, but I would hope that this is because they have a different set of principles, visions, ideals, etc. from everybody else.

    Being different should be a side effect... the geek which society shuns because he spends all his time typing away on a computer should be doing that because he enjoys coding and not because he wants to be different. If you keep trying to be different for the sake of being different, then I'm afraid you're no different from all those people out there who wear all sorts of weird clothes just to show off their "individuality".

    So... if a whole bunch of geeks end up on an island together, are all of them supposed to behave differently because geeks must be different? Or should they work together and enjoy being part of a group, because everybody in the group shares the same way of thinking as them? If you are in a situation where you _aren't_ different, then you're a lucky person, no need to be different just so you can become a real geek.

  15. Re:Unfortunately true on Games: The Boundary Of Open Development? · · Score: 3

    Art doesn't mean just the graphics. It could mean the storyline. What license does the plot go under? If I create my own RPG based on a story I wrote myself, and then release it under the GPL, what happens to the storyline? Since the story and the characters are figments of my imagination, and maybe I feel emotionally attached to them, is there any way I can prevent people from warping the story into something I do not like?

  16. Re:Single CD Games on Slashback: Attenuation, Maturity, Packaging · · Score: 1

    It depends on your game, really. If you're playing something which requires the gamer to have a bit of background knowledge in order to get into the game (like some RPG titles, for example), the documentation/manual is pretty important. And for most RPGs while the gamers don't tend to reach the technical docs, they do read the "storyline" parts of the manual.

    Imagine a person who has never read any fantasy to start a fantasy RPG title and wonder what's a mage, what's a cleric, what's an elf, etc. Explaining everything within the user interface is going to be messy, and like other people said, its harder to read online. I can't go to sleep reading the manual of my favourite game either. :P

    Some games do ship with trinkets and other stuff too, and those would require some kind of manual. The Ultima series of RPGs are usually shipped with a cloth map and some trinket. Can't squeeze that into a CD box.

  17. Re:based on AD&D on Neverwinter Nights Coming to Linux · · Score: 1

    The restriction on mages has some historical background in certain worlds. IIRC, in some, mages are required by law (of the source of their powers) to only use daggers to act as a check to their power, and also because it is possible that carrying too many metallic items may dampen the magical field around them.

    Fighters can't use magic, because they don't know magic.

    Diablo was a big step backward, I think. What sort of mage can stand there casting fireballs non-stop? Very unrealistic and too arcade for my tastes.

  18. Finally! on Neverwinter Nights Coming to Linux · · Score: 1

    At last a big RPG title for Linux, a AD&D one no less. If the sales for this game are big enough, I believe that the impression that there are no games for Linux will fade away. Almost all possible genres have been covered already.

  19. AMD's getting married? on AMD Athlon (K7) Ships · · Score: 1

    Hee... :P