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
Melted_Igloo
Nov 26, 2007

Aleksei Vasiliev posted:

.bold {font-style:italic;}

ahaha

.bold {font-weight:normal}

Adbot
ADBOT LOVES YOU

Zombywuf
Mar 29, 2008

Wheany posted:

Best way to separate content and presentation using CSS?

<td class="bold">

e: Not a horror, but pretty dumb anyway.

Are you new to web development? Don't worry, you get used to it eventually. Here's a whole stylesheet full of this kind of crap http://www.airfrance.co.uk/FR/common/common/css/global.css

NotShadowStar
Sep 20, 2000

Melted_Igloo posted:

ahaha

.bold {font-weight:normal}

code:
strong, b { font-weight: 100; }

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.
I know it's a common one, but after staring at a 3000 line class with 100+ lines of imports, then seeing this poo poo:
code:
private Float getOrderTax()
I... am going to stop working for now.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

NotShadowStar posted:

code:
strong, b { font-weight: 100; }

This is the reason I called it a non-horror. It's still styleable, even if it's stupid and misleading.

Because while you can have a dumb class like <span class="underlined-red-text-with-yellow-background">, it's still better than <span style="text-decoration:underline; color:red; background:yellow">.

That latter is basically a font tag.

Heey, can you do span[style="text-decoration:underline; color:red; background:yellow"] in a style sheet? Because that would rule.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Wheany posted:

Heey, can you do span[style="text-decoration:underline; color:red; background:yellow"] in a style sheet? Because that would rule.

Holy poo poo, yes you can:
code:
span[style="text-decoration:underline; color:red; background:yellow"]{
	color:green !important;
	background:blue !important;
	text-decoration:none !important;
}

Tad Naff
Jul 8, 2004

I told you you'd be sorry buying an emoticon, but no, you were hung over. Well look at you now. It's not catching on at all!
:backtowork:

Wheany posted:

Holy poo poo, yes you can:
code:
span[style="text-decoration:underline; color:red; background:yellow"]{
	color:green !important;
	background:blue !important;
	text-decoration:none !important;
}

I am so going to do this to my UX guy the next time he annoys me.

wellwhoopdedooo
Nov 23, 2007

Pound Trooper!

TRex EaterofCars posted:

I know it's a common one, but after staring at a 3000 line class with 100+ lines of imports, then seeing this poo poo:
code:
private Float getOrderTax()
I... am going to stop working for now.

Eh, governments are usually pretty understanding about accumulated rounding errors.

TasteMyHouse
Dec 21, 2006

wellwhoopdedooo posted:

Eh, governments are usually pretty understanding about accumulated rounding errors.

I think he was referring to the fact that it is a private getter method?

raminasi
Jan 25, 2005

a last drink with no ice

TasteMyHouse posted:

I think he was referring to the fact that it is a private getter method?

That could easily be some sort of internal calculation thing.

Impotence
Nov 8, 2010
Lipstick Apathy

NotShadowStar posted:

code:
strong, b { font-weight: 100; }

I know one of those SEO spammer retards loves doing stuff like
code:
p,strong,b,h1,h2,h3{font-weight:normal!important;font-size:14pt!important}
Then throw their entire keyword-packed paragraph inside a <h1> because "headers are important to google"

wellwhoopdedooo
Nov 23, 2007

Pound Trooper!

TasteMyHouse posted:

I think he was referring to the fact that it is a private getter method?

I'll take private getters over money in floats any day of the week.

NotShadowStar
Sep 20, 2000

Wheany posted:

This is the reason I called it a non-horror. It's still styleable, even if it's stupid and misleading.

Yeah I'd much rather have the option to set intellectually conflicting properties, like a light font weight on a strong tag than have some convoluted bullshit in the CSS specification saying 'you can set this on this tag, but not these tags!' since that always leads to cases where you want to do something that's valid but can't. The horror is people just abusing the poo poo out of these things to where it doesn't make any sense at all.

nielsm
Jun 1, 2009



Wheany posted:

Holy poo poo, yes you can:
code:
span[style="text-decoration:underline; color:red; background:yellow"]{
	color:green !important;
	background:blue !important;
	text-decoration:none !important;
}

Hey, you could also use that to make nonsensical style= attributes in your HTML and still have them do something. CSS classes go home!

Factor Mystic
Mar 20, 2006

Baby's First Post-Apocalyptic Fiction

yaoi prophet posted:

If I ever write a language this will be a compile-time error.

I have discovered exactly one useful case for an empty exception handler: on Windows when you attempt to launch a process with elevated privileges (such as, relaunching yourself from standard user -> admin with some state parameters) and the user hits cancel, the C# process class throws an exception. But it's very possible you don't want to do anything if they hit cancel. So just swallow.


~~~TMYK~~~

NotShadowStar
Sep 20, 2000
Why can't you just catch the exception that's thrown when they hit cancel, instead of capturing everything?

Incoherence
May 22, 2004

POYO AND TEAR

Factor Mystic posted:

I have discovered exactly one useful case for an empty exception handler: on Windows when you attempt to launch a process with elevated privileges (such as, relaunching yourself from standard user -> admin with some state parameters) and the user hits cancel, the C# process class throws an exception. But it's very possible you don't want to do anything if they hit cancel. So just swallow.
I don't think that was quite what that post meant, but the obvious example of an empty catch statement is unit testing a method that's supposed to throw an exception.
code:
try {
  doSomething(...);
  fail("Did not throw BogusInputException");
} catch (BogusInputException e) {
  // this is supposed to happen
}
It's when you swallow EVERY exception for the whole program that you start having problems.

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.

wellwhoopdedooo posted:

I'll take private getters over money in floats any day of the week.

The "private getter" is a function of how loving large this class is. Seriously, lines 3-106 are imports.

While being pissed about that I ran into the money as float thing I posted and it took the rest of the wind out of my sails :(

wellwhoopdedooo
Nov 23, 2007

Pound Trooper!

TRex EaterofCars posted:

The "private getter" is a function of how loving large this class is. Seriously, lines 3-106 are imports.

While being pissed about that I ran into the money as float thing I posted and it took the rest of the wind out of my sails :(

Yeah, I get same thing here, and when I run into something that's just hosed on a conceptual level, to where I know it's wrong everywhere and there's tons of code that depend on it being wrong so "fixing" it would involve either practically rewriting everything or putting in enough simulations of wrongness that it's effectively just as broken as it ever was, and even if I was feeling masochistic enough to do either one I'd have to do it on overtime because I'd never get approval for the extra time because there's no "business case" for it other than "it won't make everything that touches it worse", I get bummed right out and it gets hard to even think of working anymore.

Zombywuf
Mar 29, 2008

Last Tuesday a retarded multi-layer caching system that I've argued needs fixing for well over a year now took down our site and cost us a shitload. To be fair I never foresaw the particular failure mode but being an arcane nightmare something was bound to happen.

The solution has been to catch the problem as a special case, thus adding to the complexity.

*le sigh*

I'm now writing a super fast log parser for no particular reason, but it means I'm writing savagely optimised C for kicks.

Dooey
Jun 30, 2009
code:
extern unsigned int i;
extern unsigned int j;
Someone put this in our global variables file. If I find out who, I will kill them.

pseudorandom name
May 6, 2007

I'm trying to think of a SCM without a blame command and drawing a blank, so the real horror here is that your code isn't in any kind of version control system.

shrughes
Oct 11, 2008

(call/cc call/cc)

Dooey posted:

code:
extern unsigned int i;
extern unsigned int j;
Someone put this in our global variables file. If I find out who, I will kill them.

Don't you use source control? Doesn't it have a "blame" feature?

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
A "global variables file" sounds sort of horrifying on its own.

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

pseudorandom name posted:

I'm trying to think of a SCM without a blame command and drawing a blank, so the real horror here is that your code isn't in any kind of version control system.

I know of one. Or at least, I haven't been able to find it yet. And ugh.

Dooey
Jun 30, 2009
I've been trying to convince my boss to let us use source control since I started this job 2 weeks ago. I've got about half the people on board, and two of us are starting to use a git repo in the hope that it will catch on with everyone else. (This shop primarily does electrical engineering so they aren't really familiar with common software development methodologies.)

The global variables is bad, but its a mistake I might have made before I knew better, so I can forgive it. extern unsigned int i; is just terrible though.

Malloc Voidstar
May 7, 2007

Fuck the cowboys. Unf. Fuck em hard.

Dooey posted:

I've been trying to convince my boss to let us use source control
:stare:

So is your boss like insane, or something

zeekner
Jul 14, 2007

Aleksei Vasiliev posted:

:stare:

So is your boss like insane, or something

Dooey posted:

(This shop primarily does electrical engineering so they aren't really familiar with common software development methodologies.)

This is pretty much the case, EE's tend to commit some pretty major coding horrors. Hell, sometimes horrors are even required by the device/IDE/platform. And I've never seen a good IDE for embedded devices. Ever.

zokie
Feb 13, 2006

Out of many, Sweden

Dooey posted:

methodologies
This, this is also a horror. "Here at Company we have a very advanced methodology". Ugh!

Malloc Voidstar
May 7, 2007

Fuck the cowboys. Unf. Fuck em hard.
My programming methodology is often programming by permutation. I can code fast as hell sometimes though :buddy:

Milotic
Mar 4, 2009

9CL apologist
Slippery Tilde

Aleksei Vasiliev posted:

My programming methodology is often programming by permutation. I can code fast as hell sometimes though :buddy:

Doesn't everyone do some programming by permutation when working with poorly designed or 'enterprisey' third party libraries? Stuff like Office OpenXML SDK (or hell most stuff to do with System.XML) springs to mind.

Malloc Voidstar
May 7, 2007

Fuck the cowboys. Unf. Fuck em hard.

Milotic posted:

Doesn't everyone do some programming by permutation when working with poorly designed or 'enterprisey' third party libraries?
I do it even when I'm writing my own code. Like trying to implement replace(String target, String replacement) for StringBuilders, or trying to implement Pattern/Matcher regex support for them.


Anything I've done with web scraping ever has been done by permutation though. I tried to write a parser for an HTML-based forum and my god

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
Everyone does Programming by Permutation when they find themselves trying to write/debug code and the only information available is "it's broke" or "it worked". The Worst Kind of Debugging. I think in these circumstances extensive test suites are the only way to stay remotely sane. If it's something I can't easily test or instrument, gently caress me.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
Someone set up a redirect from "Shotgun Debugging" to that article tia

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe
Sometimes I do that when I find i have an off-by-one error and I'm confident the code is otherwise correct. I know I shouldn't really do it, though.

BigRedDot
Mar 6, 2008

zokie posted:

This, this is also a horror. "Here at Company we have a very advanced methodology". Ugh!

There's definitely a diminishing return on process, but I've never worked any place that was anywhere near that end of the spectrum. My last job was working on certain systems for billion-dollar submarine platforms and there was no process whatsoever. So of course our software was fragile, barely functioning garbage. But lots of people at the lab had no basis for comparing it to robust, documented, or maintainable software, so they all thought our stuff was hot poo poo, as opposed to steaming poo poo.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

BigRedDot posted:

So of course our software was fragile, barely functioning garbage. But lots of people at the lab had no basis for comparing it to robust, documented, or maintainable software, so they all thought our stuff was hot poo poo, as opposed to steaming poo poo.

It seems like that's often the case when a company doesn't view software as their product but as something they have to do to make their awesome widget work.

Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!


Thermopyle posted:

It seems like that's often the case when a company doesn't view software as their product but as something they have to do to make their awesome widget work.

That makes sense: the widget may compete in an open market with widgets from other companies, but the software has a monopoly on the widget-platform. :v:

BigRedDot
Mar 6, 2008

Thermopyle posted:

It seems like that's often the case when a company doesn't view software as their product but as something they have to do to make their awesome widget work.
Oh, this was 100% the case there. "But we're a research lab, you see!" Or "We make sonars, not software!" Nevermind everything past the actual physical sensor is all built with software nowadays...

Adbot
ADBOT LOVES YOU

nielsm
Jun 1, 2009



BigRedDot posted:

Oh, this was 100% the case there. "But we're a research lab, you see!" Or "We make sonars, not software!" Nevermind everything past the actual physical sensor is all built with software nowadays...

Cut the amount of solder in half, we make sonars, not electric circuits.

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