Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Soricidus
Oct 21, 2010
freedom-hating statist shill

awesmoe posted:

Yeah, I'm not used to java so I'm not sure how common it is to put related functionality into the equivalent of unnamed namespaces. Are private classes a thing that people use? I'm not a java guy.
I've only once seen an actual software package that put multiple top-level classes in single files, and it was written by someone who apparently didn't know how to build a Java program that was spread over more than one file.

Three related programs doing slightly different things, four files, thousands of lines of copy-pasted code. The fourth file turned out to be a template for further copy-pasting, should the three provided programs not do quite what one needed. (Code reuse!)

Did I mention all the lines of code that were several hundred characters long? The longest nearly hit four figures. It's easier to do than you might realise when the only data structure you ever use is nested Vectors and you're allergic to storing common subexpressions in variables.

Oh god the flashbacks :gonk:

Adbot
ADBOT LOVES YOU

Soricidus
Oct 21, 2010
freedom-hating statist shill

Golbez posted:

Updates consisted of him looking at my dev directory over the network and running a merge program to his directory which was the master directory and oh god :(
Still better than ClearCase.

Soricidus
Oct 21, 2010
freedom-hating statist shill

shrughes posted:

There's also the fact that old people are dumber than young people.
While young people don't know poo poo.

It's loving tragic how brilliant young programmers waste their best years reinventing all the same loving wheels over and over again because they think they're so drat smart they shouldn't have to build on the crap those stupid olds wrote.

Soricidus
Oct 21, 2010
freedom-hating statist shill

Volmarias posted:

You're right that it's easier to create a small prototype or client in Python, but no one has seriously used Java as a client language in years.
I seriously use Java to write client software today. :(

It can have some genuine advantages in that space, when you don't have any control over the target environment. For example, deploying a JAR is trivial compared to C++ (compile a different version for every user platform? no thanks) or Python (it's much more likely that a random computer will have a JVM than a Python interpreter). I can literally email a single file to a new user and be confident that they can just double-click on it and the application will appear on their screen. I don't know of any other technology that offers that.

Basically, if you still need to write desktop software at all, Java isn't actually a terrible choice for that.

Soricidus
Oct 21, 2010
freedom-hating statist shill

qntm posted:

Perl does this as well. Except sometimes they're treated as subroutine calls.
Perl hasn't done this in nearly 20 years. Unless you're an idiot who doesn't use strict, in which case you deserve everything you get.

Soricidus
Oct 21, 2010
freedom-hating statist shill

Suspicious Dish posted:

I can imagine that if you know somebody used urandom without entropy for a very long, you can see repeating patterns in the PRNG output which would allow you to predict keys and other sorts of things.
In a practical timeframe? Only if urandom uses a very insecure PRNG, and in general these algorithms are adequately secure - the published attacks I can think of have relied on accessing the entropy pool or predicting its state soon after startup. If the entropy pool is random and secret then you really don't really need to add more, unless there are weaknesses that haven't been published yet.

Soricidus
Oct 21, 2010
freedom-hating statist shill

Zemyla posted:

fputs(fp, buf)
That really wouldn't be an improvement.

Soricidus
Oct 21, 2010
freedom-hating statist shill

Manslaughter posted:

Languages that automatically insert semicolons, the true horror.
There's more than one? :ohdear:

Zopotantor posted:

I wasted the entire day yesterday because ClearCase
You can stop there. My condolences.

Soricidus
Oct 21, 2010
freedom-hating statist shill

contrapants posted:

Yes, indents are 3 spaces.

As I've previously posted, each variable starts with "j" to include Jesus.
Do the 3 spaces represent the Trinity, by any chance? Has the author considered the possibility that 7 might be a holier number?

Soricidus
Oct 21, 2010
freedom-hating statist shill

contrapants posted:

Looking at the resulting code, God did not answer his prayers.
Ah, the age-old question: how can a loving god allow such awful things to exist? We may never understand it, but we must trust that this is the best of all possible codebases.

Soricidus
Oct 21, 2010
freedom-hating statist shill

Dicky B posted:

What's the Rust semicolon thing?
In languages that use semicolons as separators, it is often not mandatory to put a semicolon after the last entry in a block.

In Rust, however, this is not a purely stylistic decision: the presence or absence of a final semicolon changes the semantics of the block.

Soricidus
Oct 21, 2010
freedom-hating statist shill
And they won. The new C standard makes most of the useful parts of C99 optional purely for the benefit of lazy vendors like Microsoft.

Soricidus
Oct 21, 2010
freedom-hating statist shill
It's almost like someone can have good social skills while simultaneously holding views that are entirely (if regrettably) typical of the society he lives in.

Soricidus
Oct 21, 2010
freedom-hating statist shill
tl;dr: accessibility is really important. That's why we've released a framework that doesn't support it.

Soricidus
Oct 21, 2010
freedom-hating statist shill

Jewel posted:

Huh? I thought that was correct too but on trying it it's not. What's the right way to write that one-liner? I can't work it out for some reason.
Don't.

Soricidus
Oct 21, 2010
freedom-hating statist shill
If there was a point in your adult life when source control didn't exist, you're due for retirement.

Soricidus
Oct 21, 2010
freedom-hating statist shill
This is in the right thread, but I'm not sure why you didn't post the whole spec.

Soricidus
Oct 21, 2010
freedom-hating statist shill

1337JiveTurkey posted:

There's one particular place in our codebase that drives me up the wall. It's someone being pretentious and deciding to pluralize status as statii. If you're going to be clever with pluralizations, first the sense that the word's being used in is fourth declension, not second declension. Second, even if it were second declension, statius isn't a word. Third, the plural of status is status, just the emphasis is on the second syllable when you pronounce it. Fourth, I took four loving years of Latin and even then I don't waste peoples' time with that bullshit.
I think I love you.

Soricidus
Oct 21, 2010
freedom-hating statist shill

Strong Sauce posted:

Use javascript, get yelled at for using the wrong programming language.

Switch from javascript to a hipster language because you're too stubborn to use something popular and well-supported like Python, Java, or C#, get yelled at for being a programming hipster...

Soricidus
Oct 21, 2010
freedom-hating statist shill
That sounds really fun actually. Take it to the embedded programming thread, it doesn't belong here until you've hosed it up properly.

Soricidus
Oct 21, 2010
freedom-hating statist shill
If all you know how to use is a hammer ...

Soricidus
Oct 21, 2010
freedom-hating statist shill

nielsm posted:

Reminder that this regex discussion was spawned by this:

An example of a DFA implemented in an ugly way, which would have been more readable as a regular expression.
Yeah, I don't think anyone same disagrees that they make sense for simple cases. But input validation is rarely simple, and often unnecessary.

Soricidus fucked around with this message at 21:45 on Jul 17, 2014

Soricidus
Oct 21, 2010
freedom-hating statist shill

shrughes posted:

Guess what folks, sometimes you've just got to validate phone numbers, and also email addresses, and regexes are a great way to do that.
:laffo:

Email address validation with a regex doesn't get you anything. It's very likely you'll reject valid addresses, and likewise it's very likely users will input "valid" addresses that have typos in them. The way to validate an email address is to accept whatever the gently caress the user types and then send it an email with a validation link in it.

Phone numbers? gently caress landlines, send them a validation SMS.

Soricidus
Oct 21, 2010
freedom-hating statist shill

shrughes posted:

You're just repeating something that some retard wrote that you read somewhere. If you can't imagine a situation where you don't want to be sending emails, try thinking of ten of them. Then maybe you'll fall short and think of a few.
Tell us more about these situations where it is incredibly important that an email address be well-formed, but you don't give a gently caress whether or not it actually exists. :allears:

(And even in a situation like that, you still shouldn't be writing a regex. Use a library.)

Soricidus
Oct 21, 2010
freedom-hating statist shill

shrughes posted:

Let's say you find a document with some text in it and you want to recognize email addresses.

Let's say you've got an address book with some text in it and you want to recognize email addresses and also recognize which are the same email addresses from multiple people's address books.
So ... we're suddenly going to completely change the subject from input validation to entity extraction and data mining?

shrughes posted:

No, you should roll it yourself, because when a customer complains that you're not recognizing certain email addresses properly, you'll need to fix it.
Then use a library with a license that lets you modify or extend it. You'd have to be an idiot to wilfully reinvent the wheel when there are already dozens of open source and commercial libraries dedicated to the task.

Soricidus
Oct 21, 2010
freedom-hating statist shill
Multiple passes of manual search and replace: definitely the first option that should enter a programmer's mind when the program they have written is not producing the desired output.

Soricidus
Oct 21, 2010
freedom-hating statist shill

Westie posted:

I love PHP...

Perhaps I'm the horror?
Don't worry, it's not terminal. You can beat this. We're all rooting for you.

Soricidus
Oct 21, 2010
freedom-hating statist shill
Who writes "x == true" anyway, when in every widely used language that means exactly the same as just "x"?

Soricidus
Oct 21, 2010
freedom-hating statist shill

Bonfire Lit posted:

Except it doesn't in Python, C, Ruby, Javascript, etc.
Sorry, I shouldn't have made the mistake of being even slightly ambiguous on the internet. I nearly edited my post as soon as I posted it, but I dared hope that for once people would manage to find the obvious sensible interpretation of my words.

Allow me to rephrase it, then, for the benefit of literal-minded pedants:

Who, ignoring newcomers unfamiliar with standard idioms, discounting the possibility that bad coding standards might mandate the use of unidiomatic code, and ignoring a handful of unusual edge cases when one might actually care about the distinction between "true" and other values which evaluate to true in a boolean context, writes "x == true" when in the context of a conditional expression, i.e. the only situation in which the vast majority of programmers will ever check whether a value is "true" or "false", it means exactly the same thing expresses exactly the same intent as just "x"?

Soricidus fucked around with this message at 20:32 on Aug 6, 2014

Soricidus
Oct 21, 2010
freedom-hating statist shill
Picture, if you will, a codebase in which the .h files are all symlinks to the corresponding .c files, most of which then #include themselves recursively.

Soricidus
Oct 21, 2010
freedom-hating statist shill
Different bits of the files are used each time they're included, depending on which symbols are already defined.

I wish I was joking.

Soricidus
Oct 21, 2010
freedom-hating statist shill

Volmarias posted:

Purify your code base and coworkers with cleansing fire.
We were thinking of sticking the code on a spike above the front door as a warning to others. We'd do the same to the perpetrator, but curiously enough he doesn't seem to work for us any more.

Knyteguy posted:

There was a discussion last page on "if (x == true)" being bad form because generally "if (x)" is the better alternative.

What about "if (!x)" versus "if (x == false)"?
The same arguments mostly apply. The explicit comparison is safer with false values than it is with true values, but it still has no real advantages, and there are still plenty of cases in many languages where its semantics may not be immediately obvious. So the shorter form is usually more idiomatic.

Soricidus
Oct 21, 2010
freedom-hating statist shill

Westie posted:

And yet when PHP is used properly it's amazing.
Agreed, I too am amazed whenever someone manages to take PHP and produce something good.

Soricidus
Oct 21, 2010
freedom-hating statist shill

Subjunctive posted:

What doesn't depend on declaration order? Java's imports do, python/Perl/ruby/JS do.
Under what circumstances will switching the order of two import statements in Java affect the behaviour of the rest of the file?

e: I guess maybe if they're both "import *" or some poo poo but that's not the usual case and certainly isn't the same kind of effect you get from textual inclusion or imports that can execute arbitrary code.

Soricidus fucked around with this message at 22:59 on Aug 19, 2014

Soricidus
Oct 21, 2010
freedom-hating statist shill

nielsm posted:

How does anyone manage to reach the conclusion that running a major public-facing site on Sharepoint is a great idea?
listening to too many microsoft sales pitches?

Soricidus
Oct 21, 2010
freedom-hating statist shill
Today I discovered that the SAX XML parser bundled with the Oracle JVM sometimes returns junk values for attributes if someone gives you a large XML 1.1 document, and probably always has done. The solution is to use a third-party XML parser instead of the default one. Or just to pray nobody ever sends you a large XML 1.1 document.

I love XML, Java, and having feces rammed down my throat with a rusty iron pole.

Soricidus
Oct 21, 2010
freedom-hating statist shill

Vanadium posted:

How do I tell whether I'm doing XML right, then?
Validate it against a schema. If it doesn't validate, you're not doing XML right. If you don't have a schema, you're definitely not doing XML right, because schemas are the main reason to use XML.

Soricidus
Oct 21, 2010
freedom-hating statist shill

Nickopops posted:

Also teaching first year university students Python is fun. Comments are denoted by a hashtag!
rm -rf / #yolo

Soricidus
Oct 21, 2010
freedom-hating statist shill

Edison was a dick posted:

The little gobshite's got no loving clue what it takes to make an operating system.
I am shocked, shocked, to discover that the guy who thinks it would be a good idea to base an OS on Javascript is not a highly-skilled engineer.

Adbot
ADBOT LOVES YOU

Soricidus
Oct 21, 2010
freedom-hating statist shill

Edison was a dick posted:

I just hope it doesn't catch on
I'd say it has roughly the same chance as all the other attempts to build an OS with every trendy-language-of-the-month ever, which is to say: lol.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply