Tag Info

Hot answers tagged

81

As Linus writes in the debate, it's with tongue in cheek (i.e. not to be taken too seriously). Then, he goes on to explain that while portability is good thing, it's also a trade-off; unportable code can be much simpler. That is, instead of making the code perfectly portable, just make it simple and portable enough ("adhere to a portable API"), and then if ...


33

Java is compile once run anywhere. C++ is write once compile anywhere.


28

If you want to be future proof, the best advice I can give you is not enclosing yourself into a technology. So don't learn APIs blindly. Learn how they are conceived. What are the philosophies behind the scene? What are their advantages and flaws? Think software in general, not a specific technology. You can also work on good program conception, going to ...


25

"writing a specific JRE for each platform" is not something you do everytime. Porting the JRE to a new platform is something you need doing only once. This task is generally done by the core maintainer/developers of the program and/or the platform. A lot of factors may come into play when deciding who and how the JRE would be ported. Among other things, it ...


14

It's not just the language -- it's the libraries. Both Java and C++ provide cross-platform libraries. Java provides a richer set.


13

What's the best way (and location) to store non-BLOB settings? On Windows, it seems acceptable to use the registry. In my opinion, the registry was a poorly-devised system, and instead a simple text file in the Users\Username\AppData directory should be preferred. This is easier to back up, less dangerous for users to modify, and easier to clean up. On ...


12

Unless computers start using some break-through technologies which do not exist yet even in laboratories, having more than 264 addressable space is just not physically possible with current silicon technology. The technology is hitting the physical limits. The speed (GHz) limit was hit already few years ago. The miniaturization limit is also very near. ...


12

I don't think we're going to have machines with more than 2^64 bytes of RAM in the foreseeable future, but that's not all that address space is useful for. For some purposes, it's useful to map other things into the address space, files being an important example. So, is it reasonable to have more than 2^64 bytes of any sort of storage attached to a ...


11

I think it means that each program should be written specifically for the hardware and operating system it runs on. I think what he's driving as is that general purpose code that can run on several platforms is less efficient or more error prone than code written specifically for and tailored to one platform. It does, however, mean that when you develop ...


10

The super computer Thorbjoern linked has about 2^47 B of physical memory. Assuming Moore's Law holds for memory of super computers, it will become 2^64 B of physical memory in only 34 years. This is like "OMG, we will live to see that!!!!". Maybe. And indeed, it is fascinating. But just as irrelevant. The question is, do I need 128 bit address space to use ...


8

IMHO (old programmer; work at Microsoft but this is a personal opinion): before I can answer this question, you have to anwser this other question: Where is the code moving to? If you're sticking with a single platform (in this case, WinRT), then be close to the platform -- and that means using the existing abstractions. Per your example, your code would ...


7

Under Windows, use %APPDATA%\appname. Under *NIX, use ~/.appname. Don't use fixed directory names under either platform, since the user's home directory can be different from the default (it could be on the network, for example). As for the format, use whatever you think is best. That is a decision that only you can make in the context of your application. ...


7

Back when Linux was first written, it used features available only on the i386 CPU, which was fairly new and expensive at the time. That is exactly what linux does: it just uses a bigger subset of the 386 features than other kernels seem to do. Of course this makes the kernel proper unportable, but it also makes for a /much/ simpler design. ...


7

As someone who's done a lot of Java, and experienced the "write once, debug everywhere" phenomenon on a weekly basis for years, I can fully relate to this. And Java is probably a mild example. I can't even begin to imagine what people go through who try to while a portable code base in a language/toolkit which wasn't even designed to be portable in and of ...


7

The difference is that Java will run on any platform without recompiling. Having a C++ compiler for each platform isn't the same at all.


6

All the answers starting with "The difference is...", or anything very similar, are basically wrong (sorry, but such is life). There are really two separate differences between the two. One (that's been mentioned a lot) is that a compiled Java program can (or least should) run on any conforming implementation of Java, so even after being compiled, you can ...


6

There is sometimes a reason to do so, however <stdint.h> (in C99) or <cstdint> (in C++03 or beter) make them less obvious. First, there is a readability issue. If you define typedef unsigned myhash_t; and later always use myhash_t for numbers which are in fact hashes, you ease the understanding of your code. This does not help much against ...


6

You are right that using different setups for your tests can increase the chance of accidentally stumbling on some bugs. However, you should consider whether setting up a another testing rig makes sense from a business perspective of things – I suspect you want to sell or distribute useful code, rather than crafting The Perfect Code in your ivory tower. ...


5

Well, we could definitely use a large address space. Imagine this: The address space is not limited to a single computer. Instead, an address uniquely identifies a memory cell in a universal address space. So you can have a pointer to a memory cell on any computer in the world. There will need to be some protocol to enable reading from remote memory, but ...


5

TBB is pretty much all there is that comes close. boost::thread is much too low level. You're looking in the wrong place at the TPL, by the way- Microsoft ship a separate library called the PPL for native code. It, of course, only supports Windows. However, if you find TBB to be complicated to use, I'd question whether or not the developers you're thinking ...


5

Yes. You can advertise in Windows Store, but you need to handle payment, deployment and installation yourself.


5

Aside from the technological breakthroughs, Microsoft Marketed the Dot Net framework by making it so easy for the developers to use that it became their first choice when being asked to develop new applications. Just look at Microsoft loves to spoil developers with Visual Studio. Microsoft sold the idea to developers first then they sold it to the business. ...


4

In Windows, I would keep the application setting in AppData folder


4

I try and keep out of the registry, it is way over used. I wish everyone would. I like keeping xml config files or a bin file or occasionally a local database (SQLite).


4

Although some people view/treat portability, following standards, etc., as morally superior, or something on that order, what it really boils down to is economics. Writing portable code has a cost in terms of effort to make the code portable, and (often) foregoing some features that aren't available on all targets. Non-portable code has a cost in terms of ...


4

Android is not a language or a subset but an API The Android API is written for the java language. The android developers system requirements can be found below. Which outlines the specific version of java and eclipse, etc that you will need to be able to build android applications. http://developer.android.com/sdk/requirements.html Supported ...


4

Without the translation, every Unix text-processing program would recognize just '\n' as an end-of-line marker, and every Windows text-processing program would recognize '\r' followed by '\n'. (And pre-OSX Mac programs would recognize '\r'.) And any program that writes text would have to explicitly write the local end-of-line marker, which means it would ...



Only top voted, non community-wiki answers of a minimum length are eligible