Slashdot is powered by your submissions, so send in your scoop

 



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:Salary versus cost of living in each city (Score 2) 136

Well, not necessarily true. You are ignoring the costs to maintain the home, a myrid of utilities you have to pay every month that renters often don't, insurance, and property taxes. I'm a home owner but I don't think there is such a huge gap between owning and renting. A lot of older owners are faced with having to sell their homes after retirement and moving somewhere cheaper when they would rather stay where they are. It's more like a safety net and less like a nest-egg, frankly.

That said, I prefer to own.

-Matt

Comment Might be difficult (Score 1) 431

Mice are so mass-market these days that it is hard to find one that actually performs properly. I've gone through a lot of mice over the years, always preferring the hardwired mice over the wireless (dead battery == unhappy), but in the last round I simply couldn't find a wired mouse that worked well. Everything being sold was wireless.

Of late, many of the mice I've tried have simply been too big and bulky, stretching my fingers and generally uncomfortable.

I wound up going with a Microsoft Sculpt 1569 wireless mouse (w/ Nano Transceiver). The Logitech M325 wireless also works but its middle-button-scroll wheel isn't ratcheted. These small mice are nice, my thumb and two right fingers hang over the edge and stay relaxed.

Also I recommend buying a non-rechargable alkaline AA for it, which will last 6 months. The rechargable NiMH batteries usually only last 1-2 months before they have to be replaced/recharged due to nominal leakage, which is too annoying (though I suppose one could buy low-leakage NiMHs).

The middle button scroll wheel isn't a problem. Most of them can also be clicked left and right which IS a problem because it's trivial to accidently click left or click right when you are just trying to push down on it as a middle button. So I disable the mouse-wheel left/right action entirely via:

xinput set-button-map Mouse1 1 2 3 4 5 6 7 0 0 10 11

For the transceiver I find that (obviously) the closer it is to the mouse the better. The best solution is to buy a keyboard that has a USB extension on its right or left side and plug the transceiver into that. Then the transceiver is right next to the mouse with no extra cabling. The Razer (mechanical) gaming keyboards are my favorite... very heavy so they don't move around and have the same feel as the old IBM mechnical keyboards had. 80 WPM is a breeze on them.

-Matt

Comment Re:Choose a CMS you like (Score 1) 302

- No security issues (other than bad Javascript or the web server itself): there's nothing to hack, and if someone were to hack the web server itself, restoring the site is as easy as re-uploading the files (all of which can be maintained in version control like git).

For something like Jekyll, this also applies to the input. I use it for a couple of sites and, in both cases, the sources are Markdown files (easy to edit with your favourite text editor) stored in a git repo. When I'm working on updates, I run 'jekyll serve' locally and get a copy of the site on the loopback. When I want to push them, I can do jekyll build and then rsync the results to the web server (or do something more clever if I'm less lazy and want atomic updates). The entire change history of the site is stored in revision control and the revision control system contains everything necessary to recreate the site at any point in its history.

I've yet to see a CMS that allows trivial rollback to earlier versions of the site or which makes it easy to store the content in such a way that a compromised web server can't damage it.

Comment Re:HTML = programming (Score 1) 302

I'm not sure I agree with your first premise. There are fairly trivial combinators that you can write in lambda calculus that are conditional flow control (i.e. reduce to either the left or right lambda expression based on a value). The implementation of ifTrue in Smalltalk (loosely) follows this model.

More mundanely, the statement is obviously false because a language constructed with the basic arithmetic operators and unconditional branches is also turing complete.

Only if the unconditional branch is a computed branch. Otherwise how would you implement a program that either terminates or does not terminate based on user input? The example that comes to mind is the x86 MOV instruction which, with a single unconditional backwards branch is Turing complete, but this relies on several other aspects of the surroundings that allow you to implement a conditional branch (or, at least, a select, which is morally equivalent).

The simplest Turing-complete instruction set is a subtract-and-branch-if-not-negative instruction, but this is a conditional branch.

I agree that conditional flow control is slightly too broad a requirement, as it depends on an imperative model. Conditional execution depending on input data might be a better way of phrasing it.

Slashdot Top Deals

No man is an island if he's on at least one mailing list.

Working...