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
pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Hammerite posted:

I don't see what you mean. Yes, do { ... } while (false) is another good example, although as far as I am aware it only provides the same functionality as goto.

Sorry, I thought we were playing "seemingly odd but legitimate uses of loops", not "heh everything is a goto".

PS How is what you quoted a goto?

Adbot
ADBOT LOVES YOU

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Hammerite posted:

php

I had no idea we were talking about PHP. My apologies.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Yeah I hate when the browns mess up my code.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Argue posted:

randomized http responses

I think this ties for best in thread with Duff's Enigma.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

GrumpyDoctor posted:

With operator overloading, all bets are off. Unary ! could reformat your hard drive.

So two of them should bring your hard drive right back.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
And after a couple of years, to me I'm other people.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Munkeymon posted:

Naming your release after the last movie you saw isn't totally unreasonable. I could see it giving a movie buff some context to help pull up associated memories.

So long as that context includes the missing year of a date and missing version numbers, and said movie buff still works there, I'm with you.

Maybe the Click release worked around something really annoying.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Zombywuf posted:

Short answer: IE.

Long answer: When Firefox or Safari detect a long running script they do it by wallclock time, whereas IE does it by statement count

Ahahahahahahahahahahahaha IE is the greatest thing ever made ever.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
PHP's as good a conversation subject as it is a programming language.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Munkeymon posted:

This counts as a horror, right:
http://www.pcreview.co.uk/forums/thread-1061043.php

If the first two characters of a text file (like a CSV) are 'ID', Excel assumes its a symlink file and refuses to open it.

:bang:

Wikipedia article on SYmbolic LinK (SYLK) posted:

Not to be confused with symbolic link.

...

Composed of only displayable ANSI characters...

...

Microsoft does not publish a SYLK specification.

Not so sure that's such a horror, though they could probably have chosen something a bit less likely to appear at the start of a csv file than "ID".

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Xenogenesis posted:

Some Rails controller action from a photo site:

What an obnoxious way to write.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Minecraft is the new PHP.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
C++'s fault for overloading bit shifts in iostream, giving this poor guy two different assignment operators to choose from seemingly arbitrarily (because one of them is completely arbitrary). The other two errors are very forgivable.

I guess what I'm saying is why shouldn't he expect the bit shift by area to be an assignment? Now I just feel bad for him. He's not the problem here. His language has failed him.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

YeOldeButchere posted:

You never know what future versions will do. Better safe than sorry.

I realize you're joking but surely an assertion would make more sense if that was the goal.

I've definitely seen assertions for e.g. C++ STL containers, like this:

code:
someVector.resize(5);
assert(someVector.size(), 5);
which is silly in my book but doesn't harm anyone.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Hammerite posted:

The main argument against using it from a functionality perspective, as far as I can see, is that it doesn't let you do anything you can't already do with an associative array.

That's a silly reason. Take that argument far enough and we'll all use assembler whose only instruction is subtract and branch if less than or equal to zero.

I haven't touched PHP in a solid decade so I don't know how this particular feature works but does it help make something clearer or easier to use?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Ryouga Inverse posted:

A tab can be defined by the viewer to be an arbitrary number of spaces

Don't tabs mean "go to the next tab stop", and it's the tab stops that are defined as an arbitrary number of spaces apart?

[/pedantry]

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Tux Racer posted:

converting a tab to spaces as to not gently caress up the formatting really isn't a huge deal

So do it. Problem solved.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Thermopyle posted:

No. I wasn't being disparaging anyone.

I was saying that from what he said, I didn't get how it would be encouraging.

Person 1: "I spend lots of time trying to come up with names"

Person 2: "Spending lots of time on naming is a bad sign."

Person 1: "I find that encouraging!"

Me: "What?"

Dren's belief that naming is important was independently echoed, and Dren is encouraged by this.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Wait why does that compile?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

yaoi prophet posted:

some_id implicitly gets converted into bool.

Oh, now I get it. Thanks!

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Shame about the typo.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

yaoi prophet posted:

Fortunately nobody is going to be searching for stuff including backslashes in our data. :v:

Remember where you were when you said this.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Janin posted:

It's standards-compliant code that has different output depending on whether the compiler is in C89 or C99 mode.

That's not a horror, it's a specification check at runtime.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Lexical Unit posted:

They only have one request, that we change all Imperial units to SI. This is a nightmare...

Calmly explain to your boss or the customer that this is how spacecraft explode.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Munkeymon posted:

It works because (.*) can match nothing (as in, a zero-length string) without error. At least, that's the best way I can think to put it. I'm sure someone will correct me if I'm not stating it perfectly.

Dot is "any one character", star is "zero or more times". So the empty string is indeed matched by .*.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
It's pretty boring.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

shrughes posted:

Babby didn't like milliseconds so he created a library that parses strings instead.

Alright, I'll be that guy. What makes this a horror? OK, it's not implemented how I would have implemented it, adding 1.7KB of someone else's code to your page doesn't seem worth it for what little is gained, and the parsing of strings isn't even done very well:
code:
$.after("10 minutes", function(){ console.log('hi');}); // throws an exception
But keep in mind that, for a lot of people, "jQuery" and "JavaScript" are synonymous, and are also synonymous with "this lovely code I have to write so this stupid website works the way I want it to and I hate coding I'm a designer oh god kill me".

I guess I'm saying I have zero desire to use this guy's code but what's horror-worthy about it?

Also setTimeout's arguments are backwards, so at least this guy got that right.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
I never liked January much, so I applaud that date printer for it's bold step.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Pardot posted:

code:
  (0..99).map {|i| srand(46308667) if (i%15).zero?; ["FizzBuzz", "Buzz", i+1, "Fizz"][rand(4)]}

bwahahahahahahaha

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

pseudorandom name posted:

I don't see what's so bad about marking up data so that search engines can identify, extract and index it.

1. It's ugly.

2. That's the whole job of a bloody search engine!

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Brecht posted:

Not really. It's extra, meaningful data provided in a canonical, straightforward way.

I see HTML as markup that's meant to be almost as human-readable as computer-readable. To my mind, that's why manually editing XML is usually hopeless, and why browsers interpret HTML so leniently. "Extra, meaningful data provided in a canonical, straightforward way" can be, and in this case is, done in an ugly way.

quote:

If search engines can know the context of data, they get a lot better. I don't see why this is controversial.

Nowhere did I say otherwise, your controversy is imagined.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

1337JiveTurkey posted:

Instead it's separating the data's logical structure from the document's structure so you don't have spans, divs, tables and the like cluttering up the biographical information of a film director.

This admirable goal has nothing to do with the posted example, which in fact adds one div and one span that were not present in the original.

quote:

Removing semantically meaningful data is something that should only be done with a reason. ... Removing metadata which is in a standardized format makes it harder for search engines and other tools to use the remaining data effectively.

We're talking about a new specification that adds data. As of a month ago, precisely zero websites were using it. What data is being taken away here?

Just as data should be removed only with reason, so should data be added only with reason. There is such a thing as too much.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Aleksei Vasiliev posted:

writing code without looking at it is some seriously zen poo poo

I write like this:

code:
read -s && echo $REPLY | gcc -x c -

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Brecht posted:

So you're saying if I'm writing a movie website, and I know this H3 contains the director's name, signaling that context with a type="director" tag is too much information?

Not necessarily, I'm saying adding ten attributes, a div, and a span to signal that context is too much.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

1337JiveTurkey posted:

HTML doesn't do structured data very well and it shows. XML with client-side XSLT does much better in that regard since then you can just have an XML document.

HTML does documents very well, and I'm not sure it was ever seriously offered as a language to describe structured data, so why should it do that very well? As you point out, there are better tools for that job. Yet another attempt to bolt some attributes on to HTML and call it a data description language seems wrongheaded. And ugly.

<structured data store> + <store to html transformation> will generally be better than HTML for any values of the two variables, if your problem is storing and presenting structured data.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Vanadium posted:

Go has it too, but when I tried to google for a description I only found a yahoo answers page about why ghosts do not fall through floors if they can go through walls. :raise:

The golang spec is pretty readable, including its section on switch statements. But yeah, break is implicit in cases, fallthrough overrides it.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

wwb posted:

just about every other language I can think of defines boolean "true" using the keyword TRUE and boolean "false" using the keyword FALSE.

I actually quite like how YAML defines true, yes, and on all as boolean true.

code:
correctResponse: yes
ignition: on
editable: true

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

benitocereno posted:

I'm convinced there's a whole subset of programmers that do this kind of thing just to gently caress with you.

Maybe it's a canary. When you see one you're supposed to figure out who wrote it, ask them what the hell they were doing, and they say "ahh, you've actually read the code! Excellent!"

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

baquerd posted:

The issue is the number of programmers who think it's just another language to use instead of a substantially different cross-disciplinary skill.

The other issue is CSS isn't a proper language, with no support for variables or functions, so it's a huge pain in the rear end to use if you are a programmer. If CSS had started out like less or sass maybe it wouldn't be so horribly abused.

quote:

I still use tables for layout

Can't fault you for that one. Why CSS doesn't have a columns: 2 is beyond me.

Adbot
ADBOT LOVES YOU

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

_aaron posted:

Not to derail too much, but I'd like to get into some web development, and I'd like to avoid these bad tutorials. Any suggestions for where to start learning? I've been learning Python lately, and I like it, so maybe something where I can put that to use?

Your intuition regarding derails is spot on! Hit up the web dev thread for more. But basically, figure out the box model (box = size + padding + border, margins don't count towards size, margins collapse each other) and positioning (absolute, relative, and fixed all start their own coordinates for child elements) and you can figure most of it out. Also you can make shapes!

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