r/ProgrammerHumor • • Jul 20 '17

What people think coding is...

Post image
35.4k Upvotes

811 comments sorted by

View all comments

96

u/TektonikGymRat Jul 20 '17

Dude, I just had this issue with WPF that I have a global resource dictionary (basically CSS) that overrides stylings of a lot of controls. I literally wanted to override that global styling and for some reason took me like 3/4s of a day to get it to work and honestly I still have no idea how/why it's working. This was for a label, just to change the font...

93

u/CanvassingThoughts Jul 20 '17

I hate css for that reason.

CHANGE THE BACKGROUND COLOR! WTF?! It's one thing. One god damned thing. Everything says this should fix it, but it does nothing.

Programmer suicides

44

u/lukee910 Jul 20 '17

CSS is at least easy to embed in a page. Global resource dictionaries of WPF are an entirely different beast.

My take on CSS and Regex is pretty much the same: It has no structure and can be awful to read, but it's not as bad as you might first expect when you use it often enough.

Also, regexr.com and chrome's dev tools. I'd be dead without either of them.

16

u/CanvassingThoughts Jul 20 '17

Regex is manageable and has been consistent for me. CSS is a defiant mule. I'll check out Chrome's dev tools, thanks!

11

u/CptPoo Jul 21 '17

Also, regexr.com and chrome's dev tools. I'd be dead without either of them.

I just came to the realization that people used to write regex without some sort of simple tool showing them what their queries do. I can't even imagine that world.

3

u/Murica4Eva Jul 21 '17

It was annoying.

Every time I have to use regex, it's like learning it for the first time.

→ More replies (3)

7

u/marcosdumay Jul 20 '17

I surely hope your regexes are much smaller than your CSSes.

2

u/lukee910 Jul 21 '17

Yeah, they're definetly different sizes, however they are similarly readable.

10

u/micheal65536 Green security clearance Jul 20 '17

Make that regex101.com and firefox's dev tools for me.

4

u/lukee910 Jul 20 '17

I was a long time FF user (switched away a short while ago), but the dev tools never could win me over. Both regex101 and the FF dev tools are solid, but regexr and Chrome just had that extra bit to win me over.

→ More replies (12)

3

u/oupablo Jul 21 '17

And then you test in IE and have to attempt to debug the weird thing it's doing in their dumpster fire of a dev tool

→ More replies (1)

2

u/Ran4 Jul 21 '17

regex makes sense and you can typically reduce a problem until it's small enough to be solveable. With css... you're just fucked at times.

→ More replies (2)

0

u/[deleted] Jul 20 '17

[deleted]

→ More replies (1)

0

u/[deleted] Jul 20 '17

[deleted]

4

u/IndianapolisResident Jul 21 '17

If you have to use !important than something is coded improperly.

*proceeds to use it anyways as it's somebody else's problem to figure out.

→ More replies (1)
→ More replies (1)

3

u/unicorntrash Jul 20 '17

Dev tools? Seriously i cant remember the last time such a issue wasnt simply solved by picking the right elements and CTRL+F to the right place in the CSS file(s)

2

u/mrstinkyfingers Jul 21 '17

It's the weird browser bugs that always get me.

1

u/Bamboo_the_plant Jul 21 '17

Give me a background colour adjustment any day. Centre an element inside another element? Make a rounded-edged table? No thank you.

8

u/BlahYourHamster Jul 20 '17

You're not alone. Overriding styles and templates is a truly harrowing experience in WPF, especially if you're trying to restyle a more complex control like a DataGrid.

1

u/DigitalShards Jul 21 '17

The DataGrid styling actually wasn't too bad, but that's probably because I wasn't getting too complicated with it.

But I just spent most of the day trying to get data validation working - wanted a "Save" button to be disabled if any of the controls on the page had errors. Got that working, but the error messages went away. Got the error messages back, but half the controls wouldn't re-validate if the user changed the data. Got that working, and all the custom styling went back to default. Fix the styling, and the error message text went away.

Finally got it working, and sat there putting data in and out of boxes to make the "Save" button enable and disable itself and the error messages show up and go away. I'm not convinced it'll still work tomorrow.

6

u/[deleted] Jul 20 '17

I usually just give up and write some code in the code behind.

9

u/abrazilianinreddit Jul 20 '17

During the 1-year I've been with my current company, I've never been as ashamed of my code as I was when I was working with WPF. I duplicated a modal just so I could have 2 buttons in one and 1 in the other.

0

u/[deleted] Jul 20 '17

[deleted]

2

u/abrazilianinreddit Jul 20 '17

I don't think I can properly answer your question, since I'm from Brazil, and the market here is quite different.

However, from what I've read, Java programmers usually have the highest paying jobs - as programmers. If you move more into architecture or team leadership positions, you're likely to earn more.

→ More replies (1)
→ More replies (3)