Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×

Comment Re: DirectX is obsolete (Score 1) 135

Actually, a lot of these games just use WINE's implementation of DirectX. This either translates the calls to OpenGL or implements a DirectX state tracker directly if you have Gallium drivers configured correctly. The same is true of a lot of Mac games. Good luck getting WINE to run on a console though...

Comment Re:DirectX is obsolete (Score 1) 135

Your typical GPU driver is about 10MB of object code. It contains a complex optimising compiler and controls a device that has complete DMA access to your computer. It is written with speed as the only significant goal. Making a GPU driver 1% faster contributes enough to sales to pay the salaries of several driver developers. Making the GPU driver more secure generates zero additional sales.

The shader code that's fed into this stack from WebGL is sanitised and is completely safe to run, assuming that your driver stack is 100% bug free. Still feel safe?

Comment Re:DirectX is obsolete (Score 1) 135

If you write a game that uses Direct3D, you can easily target Windows, XBox, and Windows Phone. If you write a game that uses OpenGL, then you can easily target all of the major desktop, mobile, and console platforms. If your game runs on a generation-old console, then it will run on current-generation mobiles as well. This gives you three markets: First release for high-end PCs, second for consoles, third for mobiles. You can get a solid revenue stream out of each one. You don't lose the Windows marked by choosing OpenGL, but you do lose every other market by using Direct3D.

That said, the APIs are so similar these days that you'll typically use some middleware to provide the abstraction. All of the important code is written in the shaders and these are much easier to port between GLSL and HLSL than they are to port between different GPUs and maintain performance.

Comment Re:Modula-3 FTW! (Score 2) 492

Implementing this in the standard library means that the language needs to support pass-by-reference (which Pascal and C++ do, but C doesn't). This single feature does a lot to reduce readability. In C, I know that inc(x) is a function that does not modify the value of x, without reading any additional code[1]. In Pascal or C++, I need to look at the definition of inc() to know if x will be the same before and after the call.

An important idea at the core of readability for a language is the amount of code that I have to read to understand a single line. In any language that has pass-by-reference, this amount is larger than a language that doesn't. To achieve the same thing in C, I'd have to write inc(&x), and then everyone reading that code would know that x may be modified. (Note: the almost-equivalence of array and pointer types in C is a good counterexample where Pascal wins massively in readability).

[1] It could be a macro, but most coding conventions require macros that can't be used as if they were functions to be all-caps.

Comment Re:Modula-3 FTW! (Score 2) 492

This would be true, except for two things:
  • Lines with more than 66 non-whitespace characters decrease readability.
  • Statements with more than 66 non-whitespace characters are common in most programming languages.

This means that you end up either with lots of continued statements or lots of overly-long lines in Python. If you have the former, then it's hard to see the indentation. If you have the latter, then you can see the indentation but the overall readability suffers. This can be fixed by using tabs for semantic indentation and spaces for alignment and an editor that supports highlighting tabs, but the Python style guides tell you not to do this.

Comment Re:Modula-3 FTW! (Score 1) 492

There are some simple things where C is far more readable to a moderately experienced programmer. Consider the beginning and ending of blocks. In pascal, these are signified by begin and end. When you look at a chunk of Pascal code, they can be hard to pick out because they're just words in a sea of words. In C, you use the { and } symbols. These are symmetrical and the human brain has spent a lot of time evolving to be trivially able to spot symmetry because symmetry normally means 'predator about to try to eat me'. You can very quickly spot a column that has a { at the top and a } somewhere later (much more easily if they're aligned together and there's nothing else on the line). There were some studies done in the '80s that confirmed this, though sadly a lot of C coding conventions specify brace placement in a way that reduces readability.

The main strength of Pascal is that it forces you to think more than C. If you don't write what you mean in Pascal, it usually fails to compile. C will happily do... something. This level of redundant verbosity makes Pascal both quite a frustrating language for experienced developers and a great language for teaching. I find that people who learned Pascal tend to write better C code than those that didn't, but neither group has a strong desire to write Pascal.

Comment Re:Really? (Score 4, Interesting) 192

Not even remotely the same thing. Of course you would get in trouble for making Internet Explorer Plus. However, these are users. They did not MAKE Whatsapp Plus. They merely used it. Some of them, perhaps most of them are unaware that they are not affiliated. The appropriate target is the creator of Whatsapp Plus. Targeting the user is detrimental to WhatsApp's cause.

Comment Didn't hit "Send" yet (Score 2) 304

a third of 2013's police-reported car accidents were the rear-end crashes and a "large number" of the drivers either didn't apply the brakes at all (what?!)

That is because they didn't hit send yet. They were still staring at their phone and not concerned whatsoever with the innocents in the car with them, or the innocents in the car in front of them.
Another poster said that texters have worse response time than drunks. That is probably not true, because drunks at least have a response time. You can't respond to something when all of your sensory input is focused on something else. For texters, the response comes after the crash.
I have noticed a trend for years that rear end collisions have been getting more prevalent and the damage more severe. It was like people weren't even hitting the brakes. I blamed it on texting while driving. Now the statistics are saying the same thing.
However, I am NOT in favor of the new devices to apply the brakes when the driver doesn't. Automation in the cockpit will only lead to stupid people becoming MORE complacent in the car and will increase their irresponsible behaviors. Instead of looking up every other character to see what is going on, they will just stare continuously at their phone until they have finished their message.
Perhaps I could see having such a braking system if, after a single auto-braking incident, the car disabled itself except for low speed travel so it could pull over to the shoulder, and then, travel over 10 mph was disabled until the car was reset by a qualified driving instructor.

Comment Re:Good news (Score 1) 422

Even when he was out of the loop on TNG, Roddenberry still managed to screw with early Ron Moore screenplays like The Bonding, loudly insisting that "children in the 24th century wouldn't morn their parent's death."

Apparently he forgot about the TOS episode "And the Children Shall Lead" when he said that. It was one of Freiberger's episodes, so I guess he could argue that he wasn't too involved.

Comment Re:Good news (Score 1) 422

I remember reading about it in Starlog magazine a year or two after the first movie came out (although it was told as Vader falling into a volcano after fighting Obi-Wan), and the story of the Emperor being a senator that maneuvered himself into unlimited power was in the prologue to the original movie's novelization back in 1977.

Comment Re:Good news (Score 1) 422

I actually didn't have much of a problem with the cast of the sequels, with the notable exceptions of Jake Lloyd, Hayden Christensen, Natalie Portman, and Ahmed Best. In fairness to them though, it would have been hard for anyone to pull off the insipid dialog they were often given - in particular the love scenes with Anakin and Padme were just painful to watch, as was any scene with Jar Jar. I did think that Ewan McGregor and Ian McDiarmid were outstanding in all three, though.

Slashdot Top Deals

Any circuit design must contain at least one part which is obsolete, two parts which are unobtainable, and three parts which are still under development.

Working...