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
xtal
Jan 9, 2011

by Fluffdaddy
http://www.phpsadness.com/sad/52

quote:

Let's examine the rules for comparison in PHP. Here is a digraph of a variety of values and how they compare; a green line means ==, and an arrow from A to B means A < B:

http://www.phpsadness.com/static/pages/sad/52/order-full-eq.png

(can't embed cause HTTP)

Adbot
ADBOT LOVES YOU

Thermopyle
Jul 1, 2003

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

PHP apologists are always like "yeah, PHP was bad but modern PHP is pretty good".

I haven't used PHP in a very long time, so I never know how much credence to give that argument.

Soricidus
Oct 21, 2010
freedom-hating statist shill
the name stands for “polished horse poop”

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

Soricidus posted:

the name stands for “polished horse poop”

no it's actually "Pretty Horrible PHP"

SupSuper
Apr 8, 2009

At the Heart of the city is an Alien horror, so vile and so powerful that not even death can claim it.

Thermopyle posted:

PHP apologists are always like "yeah, PHP was bad but modern PHP is pretty good".

I haven't used PHP in a very long time, so I never know how much credence to give that argument.
It's a tough sell for any language because if you take too long, the damage is already done (see: PHP, Javascript, OpenGL, etc). The new doesn't instantly supplant the old, 90% of people and resources will be working with existing old bad code, not new modern code.

PHP in particular has had slow adoption because the new modern version isn't backwards-compatible, and there's a world of legacy to support. Any new web stuff just moved on to Node/Ruby/.NET/etc.

Gibbon
Feb 22, 2004
chang chang!

DaTroof posted:

Maybe he snuck in a back door that depends on a collision.

Hanlons razor, it was actually a run once data import script lol, just slowed it down slightly!

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

SupSuper posted:

It's a tough sell for any language because if you take too long, the damage is already done (see: PHP, Javascript, OpenGL, etc). The new doesn't instantly supplant the old, 90% of people and resources will be working with existing old bad code, not new modern code.

PHP in particular has had slow adoption because the new modern version isn't backwards-compatible, and there's a world of legacy to support. Any new web stuff just moved on to Node/Ruby/.NET/etc.

whoa, don't lump OpenGL in with there...

it still doesn't have a modern form that's actually good

Xik
Mar 10, 2011

Dinosaur Gum
git log
wip
merge from develop
wip
wip
general fixes
wip
wip
merge from develop
wip

:mad:

OddObserver
Apr 3, 2009

Suspicious Dish posted:

whoa, don't lump OpenGL in with there...

it still doesn't have a modern form that's actually good

Curious, does that include Vulkan?

Though old GL is kinda similar to PHP in that the easy way is the bad way.

FlapYoJacks
Feb 12, 2009

Xik posted:

git log
wip
merge from develop
wip
wip
general fixes
wip
wip
merge from develop
wip

:mad:

I started putting my foot down a few months ago in regards to poo poo like this.

git rebase -i HEAD~ is a thing, and I made our developers learn it.

Goreld
May 8, 2002

"Identity Crisis" MurdererWild Guess Bizarro #1Bizarro"Me am first one I suspect!"

The real horror is the steaming pile of rubbish that is git. Unfortunately the alternatives are also garbage fires. None are particularly easy to use, and git experts seem particularly proud of it as if that’s a good thing.

tak
Jan 31, 2003

lol demowned
Grimey Drawer

Goreld posted:

The real horror is the steaming pile of rubbish that is git. Unfortunately the alternatives are also garbage fires. None are particularly easy to use, and git experts seem particularly proud of it as if that’s a good thing.

Git is actually a Very Good Thing

Bongo Bill
Jan 17, 2012

git is hard to learn, but it's good.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Xik posted:

git log
wip
merge from develop
wip
wip
general fixes
wip
wip
merge from develop
wip

:mad:

Hold up

Do your developers actually get to push commits called "wip" to your main branch?

What the actual dick?

Xik
Mar 10, 2011

Dinosaur Gum
Well there is a PR process for merging from feature branches into the primary dev branch but it seems these sort of commit messages are being approved.

I used to be full time here and this would have been something I'd make a bunch of noise about but I took a break and now I'm a contractor here too so can't really stick my neck out. While I was gone many of the old permanent employees left so the place has been running on mostly sub-par contractors. I mean, they're not all bad, some are top quality (a couple better then me for sure) but it's like a handful of diamonds in a swimming pool of feces.

Athas
Aug 6, 2007

fuck that joker

OddObserver posted:

Curious, does that include Vulkan?

Normal disclaimer that I use graphics API for compute not actual graphics, but we did investigate Vulkan a bit. It's better than OpenGL in the sense that you can also remove the bullshit from C by just using assembly instead. Everything seems pretty sane and predictable, but you have to do everything yourself. I can't imagine anyone using Vulkan for anything but building a higher-level abstraction on top, whereas people use OpenGL directly to write (relatively) simple graphical demos and such.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

ratbert90 posted:

I started putting my foot down a few months ago in regards to poo poo like this.

git rebase -i HEAD~ is a thing, and I made our developers learn it.

Oh man, I didn’t know about tilde thing, thanks.

Xarn
Jun 26, 2015
I don't think I've ever used tilde without number. What has been working nicely for me is git rebase -i master.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

OddObserver posted:

Curious, does that include Vulkan?

Though old GL is kinda similar to PHP in that the easy way is the bad way.

Vulkan is low-level, unfriendly, and prone to break in weird ways, and the tooling around it sucks but is slowly getting better (hopefully LunarG stops existing soon, at least)

The expectation was that serious engine developers would use it and then everybody would use those serious engines, but they misunderestimated how many people consider themselves to be "hardcore pro low-level programmers" and are basically playing with knives

McGlockenshire
Dec 16, 2005

GOLLOCKS!

Jewel posted:

PHP is garbage and "0wordshere" == 0 is true because "The string has a number in it! It failed the exact equality check so lets try and parse it as a number instead"

the """answer""" is to use === so it doesn't do the fuzzy comparisons which are horrible every time but the actual answer is gently caress php

No, the correct answer is to use hash_equals, which eliminates a hypothetical timing attack based on the lengths of the hashes.

repiv
Aug 13, 2009

Suspicious Dish posted:

(hopefully LunarG stops existing soon, at least)

What's the problem with LunarG?

Kuule hain nussivan
Nov 27, 2008

code:
For index = 1 To Len(text)
    char = VBA.Mid$(vText, L, 1)
    If IsNumeric(char) Then
        numbers = numbers & char
    End If
Next index
I mean, it's not a massive horror or anything, but using Mid to get that char sure is a weird loving habit.

Edit: I've also found at least 5 methods for parsing dates in this crap.

ChickenWing
Jul 22, 2010

:v:

Xik posted:

git log
wip
merge from develop
wip
wip
general fixes
wip
wip
merge from develop
wip

:mad:

People who do this make me irrationally angry because that sort of poo poo leads to "thou shalt squash-merge" and gently caress all of you my commit history is useful

swear to god companies that use git need to have mandatory lunch and learns about proper git use because all I ever see is one of:

[ticket] ALL THE WORK AT ONCE WHAT'S INCREMENTAL PRECIOUS

or:

wip
wip
wip
merge
wip
wip
[ticket] did a thing
merge
fix pr comments

or, almost even worse:

[ticket] ticket description
[ticket] ticket description
[ticket] ticket description
[ticket] ticket description
[ticket] ticket description
[ticket] ticket description
[ticket] ticket description
merge

necrotic
Aug 2, 2005
I owe my brother big time for this!
I'm fine with squash commits because they should include the PR number where you can see all of the iterative progress if it's actually important.

It's invariably better than a mix of good commits and wip bullshit.

ChickenWing
Jul 22, 2010

:v:

necrotic posted:

I'm fine with squash commits because they should include the PR number where you can see all of the iterative progress if it's actually important.

It's invariably better than a mix of good commits and wip bullshit.

I prefer being able to pop through blame annotation history in my IDE, makes things a whole hell of a lot simpler

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...
Best is to rebase and massage the sausage into something nice. If that can't be done, squish it all together rather than having a bunch of useless garbage commits that don't mean anything.

necrotic
Aug 2, 2005
I owe my brother big time for this!

ChickenWing posted:

I prefer being able to pop through blame annotation history in my IDE, makes things a whole hell of a lot simpler

Yeah, if everyone writes good commits this is better but I've never found that to work out.

ChickenWing
Jul 22, 2010

:v:

necrotic posted:

Yeah, if everyone writes good commits this is better but I've never found that to work out.

So long as people are even writing mediocre commits it's still handy.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
Yeah, it takes very little for commit messages to be useful. Even half-assed descriptions of what the commit changed with no attempt at saying why sometimes accidentally tell me what I wanted to know.

JawnV6
Jul 4, 2004

So hot ...

ChickenWing posted:

People who do this make me irrationally angry because that sort of poo poo leads to "thou shalt squash-merge" and gently caress all of you my commit history is useful

swear to god companies that use git need to have mandatory lunch and learns about proper git use because all I ever see is one of:

[ticket] ALL THE WORK AT ONCE WHAT'S INCREMENTAL PRECIOUS

or:

wip
wip
wip
merge
wip
wip
[ticket] did a thing
merge
fix pr comments

or, almost even worse:

[ticket] ticket description
[ticket] ticket description
[ticket] ticket description
[ticket] ticket description
[ticket] ticket description
[ticket] ticket description
[ticket] ticket description
merge

proper git usage is the first one, the problem with 18 commits having ‘wip’ isn’t solved by typing out ‘fixing white spaces based on review feedback’ and needlessly bloating bisect

Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!


when i'm working on a branch, commits exist to help me make progress

when i'm merging the branch, commits exist to explain the changes

the ideal commits for each phase are completely different

Ola
Jul 19, 2004

"Progress saved to cloud because I'm wary about losing all my work"

Volguus
Mar 3, 2009

Doc Hawkins posted:

when i'm working on a branch, commits exist to help me make progress

when i'm merging the branch, commits exist to explain the changes

the ideal commits for each phase are completely different

Which is why you work in different branches. One for the work in progress and one for the entire feature. merge --squash and you're golden. In the WIP branch, "wip" comments are fine if you really really like them, since you're the only one ever seeing them. In the feature branch ... nah.

Soricidus
Oct 21, 2010
freedom-hating statist shill
git commit -am 'asdf' && git push -f

Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!


Volguus posted:

Which is why you work in different branches. One for the work in progress and one for the entire feature. merge --squash and you're golden. In the WIP branch, "wip" comments are fine if you really really like them, since you're the only one ever seeing them. In the feature branch ... nah.

uh

or just rebase the one branch to group and order the changes logically with useful messages

Presto
Nov 22, 2002

Keep calm and Harry on.

tak posted:

Git is actually a Very Good Thing

Provably false.

xtal
Jan 9, 2011

by Fluffdaddy

Soricidus posted:

git commit -am 'asdf' && git push -f

git commit --allow-empty -m''

Tarezax
Sep 12, 2009

MORT cancels dance: interrupted by MORT

Presto posted:

Provably false.

Sounds like someone needs to... Git Gud™

I think I may actually have grabbed it from this thread, but I've aliased man git as git gud

Volguus
Mar 3, 2009

Doc Hawkins posted:

uh

or just rebase the one branch to group and order the changes logically with useful messages

Uh

or just merge squash and have one commit with one message for the entire thing. Easy, peasy, lemon squeezy.

Of course, this does crumble when the "feature" was a 6 months project with 100 contributors from 20 countries. Yes, a merge --squash in that case may not be easy to review.

Volguus fucked around with this message at 02:02 on Sep 28, 2019

Adbot
ADBOT LOVES YOU

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
just don't use long-lived branches if you can at all help it.

if your feature is going to take several months to develop, it's better to have it in master, with integration tests making sure it still works, but with a compiler flag or similar turning it off in the final build.

Avoiding the hell merge at the end has many advantages. For example, other developers are allowed to actually do refactorings and pay down tech debt without worrying about making your merge even more hellish.

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