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

 



Forgot your password?
typodupeerror
×

Comment Re:Android is not always Java (Score 1) 577

It's an application programming language, not a system programming language. Android is a Linux system written in C and C++ mostly.

The argument was that the current Python implementation wasn't good enough; the counter-argument is that neither was Java, since Google wrote their own and use a different bytecode. (Oracle sued Google because Google "java" wasn't real "Java").

Comment Re:Wake me up... (Score 1) 577

Having done both Java and C#. I choose to take the C# jobs now because the language is a lot more fun. Nothing to do with fashion. If you're managing your career well, you should eventually get to the stage where you can choose a platform that is pleasant to work on, by whatever subjective measure. I code for money, no doubt, but there's no reason to do that on an irritating platform, once you have the choice. Starting out, we all have to pay our dues, of course - someone has to do the shitwork.

For fun projects I write C++, because I can be sure that proper style is used when I'm the only coder, but professionally I cringe at legacy C++ codebases.

Comment Re:Android is not always Java (Score 1) 577

I said the package manager does it. When you run Python, it generates the .pyc and .pyo files for modules loaded:

Each time you install a Python module, the package manager runs Python to load it as a privileged user

The .pyc and .pyo files for system libraries are generated at installation time, because a non-privileged user running a Python application wouldn't be able to store those files in a system-wide location (for good reason: you could store malicious ones and jump across security zones by injecting code into other users' applications by replacing some runtime files with new ones that get loaded the next time they use that application).

Comment Re:Wake me up... (Score 1) 577

Oh, most people are innumerate these days.

Nothing to do with set theory, really. Cardinal numbers indicate a count of objects: "one, two, three". Ordinal numbers indicate an order - a position in a sequence: "first, second, third". The major usecase for unsigned numbers is really indexing into arrays/collections (you don't know the max at compile time, but you do know the min) - in a sense those are ordinal numbers - positions in a sequence.

Some people use "whole numbers" for the non-negative integers, and "counting numbers" for the positive integers, but I never heard those terms in college math classes. And anyway, I'm a programmer, I count from 0!

Comment Re:fried fish (Score 1) 214

The essence of true competence is to avoid getting into situations where continuous high levels of competence are needed; by not backing yourself into a clusterfuck of a system that is always one false move away from doing something dangerous; but if you've fucked up and done that, it's really just a matter of time until somebody gets tapped as the fall guy by the pitiless gods of blind chance.

Unfortunately, this means that you get the credit for savings due to doing the bare minimum of maintenance to keep things running until tomorrow, and whoever gets caught holding the damn thing when luck finally runs out gets the blame. That's how industrial systems are run, because that's how the incentives are set up.

Comment Re:Java and the JVM (Score 1) 577

The JVM and the CLR are fine if you want to write more managed languages. I'm not sure what need those fill, but yeah, you can.

CLANG/LLVM gives the same ability to use a "common language core" for a new non-managed language, and I'd surely like to see some new work there. C++ written in modern style can be a joy, but that style is too hard to discover, and the language is so full of cruft. A fresh language design, taking the "coder usability" lessons that can be learned from C#, Java, and Python, but unmanaged and targeting lower-level problems: that would be awesome.

Comment Re:javas not dead! (Score 4, Insightful) 577

have other java applications that are designed to explore the limits of slab allocation and heap return in memory

You remind me of far to many C programmers I've met (and projects I've been on).

"Look I've reinvented that difficult plumbing built into C++ - my language is just as good as C++!"

"Yeah. How much time did that take? How many nightmarish bugs did you overcome?"

"Lots. And a few."

"Time well spent then, I'm sure, and my best wishes that there's not one last plumbing bug that you'll find in the field".

Different tools for different jobs. C++ isn't the right tool for much, but nothing else comes close for jobs that actually need the cruft that clutters C++. Taking over memory allocation is a perfect example. (Checking an object every time it's dereferenced to make sure it hasn't been freed or worse, re-used is another - man that's a stupid problem to solve in Java or C#.)

Comment Re:Java already had closures (Score 4, Insightful) 577

That entirely misses the point. The conciseness is the entire point.

If I have a list of strings, and want to append ".txt" to each, using a for loop is just one more annoying piece of COBOLesque boilerplate.

fileNames = names.Map(n => n + ".txt");

That's what you want.

docFileNames = names.Where(n => n.StartsWith("Doc")).Map(n => n + ".txt");

You can understand what that does even though I just make up the methods. That's the damn point.

Comment Re:Wake me up... (Score 1) 577

Yes, just like COBOL. And just like COBOL, it's mostly used for the most boring sorts of "Enterpise" software (which used to be called "card-whalloping code" back in the day).

The phone thing is new, and at least gave Java a new chance at being cool. Hasn't worked out that way so far, mostly because, like COBOL, there's all this annoying wordiness and boilerplate all over the place, so it's hard to ever feel the result is "elegant". And if stuff you write on your own can't be "elegant", that just uncool.

Comment Re:Wake me up... (Score 1) 577

No, that's just wrong.

Often you have a value for which negative numbers are always wrong/senseless. An unsigned type neatly encapsulates that constraint. It trivially becomes part of the API contract that "negative values don't make sense, so you can't pass one here".

ADA of course takes it a step farther, allowing both min and max constraints on any integer. But the "non-negative integer" is a common enough special case to justify a type of its own.

Oh, and your completely misusing "cardinal number" - when you use big words to try to sound smart, but get them wrong, it's quite embarrassing.

Comment Re: Wake me up... (Score 4, Informative) 577

Characters suck. C++ and Python both allow easy 32-bit characters, which at least allows you to store one Unicode codepoint per "char". But in non-Western languages there are still glyphs that must be composited from several codepoints.

But why would anyone care? UTF-8 works fine for sorting and comparing and so on, it's well designed that way.

Comment Re:Don't forget Ananias (Score 2, Funny) 537

No. Very smart people have spent 1000+ years thinking through every detail of the bible. Before the Enlightenment, it's what geeks did in western culture.

If you read through all that stuff, you'll find quite logical and rational explanations for almost everything. There's a very important lesson there - just because you can come up with a rational explanation for a belief doesn't make it true.

Slashdot Top Deals

Our business in life is not to succeed but to continue to fail in high spirits. -- Robert Louis Stevenson

Working...