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
Novo
May 13, 2003

Stercorem pro cerebro habes
Soiled Meat

Monkeyseesaw posted:

This may be unpopular but I think git is a bit of a coding horror in the fact that it fails to really hide any details of its implementation and makes source control more complicated than it should be. I really didn't grok git until I realized my branches were pointers and my commits were nodes in a graph. I've never had to understand the internals of any source control system like that before.

This is coming from someone who uses git at work and likes git and understands how it's more empowering than, say, SVN but the learning curve on it is much sharper than it could (and should) be.

I'm confused, you think Git is a coding horror because it doesn't support the Subversion mental model?

Adbot
ADBOT LOVES YOU

Crosscontaminant
Jan 18, 2007

No, he thinks Git is a coding horror because it fails to abstract away enough of the problem space. I'm inclined to agree, which is why I prefer Mercurial.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Monkeyseesaw posted:

This may be unpopular but I think git is a bit of a coding horror in the fact that it fails to really hide any details of its implementation and makes source control more complicated than it should be. I really didn't grok git until I realized my branches were pointers and my commits were nodes in a graph. I've never had to understand the internals of any source control system like that before.

This is coming from someone who uses git at work and likes git and understands how it's more empowering than, say, SVN but the learning curve on it is much sharper than it could (and should) be.

I agree... it seems like it's way more difficult than it should be to effectively use Git.

Cosmic Horror
Feb 2, 2009

DON'T BRING A GUN TO A SHELBY FIGHT MOTHER FUCKER, THAT'S RIGHT YOU GOT KNOCKED THE FUCK OUT
Got to ask this question today.

"Wait, are those references to user-defined fields hard coded into the system?"

"...yes."

The person who originally wrote the file was relying on the fields that the end user could change at will always representing very specific data.

Factor Mystic
Mar 20, 2006

Baby's First Post-Apocalyptic Fiction

Monkeyseesaw posted:

This may be unpopular but I think git is a bit of a coding horror in the fact that it fails to really hide any details of its implementation and makes source control more complicated than it should be. I really didn't grok git until I realized my branches were pointers and my commits were nodes in a graph. I've never had to understand the internals of any source control system like that before.

This is coming from someone who uses git at work and likes git and understands how it's more empowering than, say, SVN but the learning curve on it is much sharper than it could (and should) be.

This is why, I continue to believe there's an opportunity for a killer git UI out there. It doesn't exist yet, but there are several okay ones like Github's clients, and Sourcetree.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



The last time I used SourceTree, I think it outright told me to drop to the command line to do something or the other.

Monkeyseesaw posted:

my branches were pointers and my commits were nodes in a graph

IDK why but the first thing that popped into my head after reading that was

Crumpet
Apr 22, 2008

Factor Mystic posted:

This is why, I continue to believe there's an opportunity for a killer git UI out there. It doesn't exist yet, but there are several okay ones like Github's clients, and Sourcetree.

TortoiseGit's pretty good, but it's sadly windows only...

On topic: yesterday I witnessed some old legacy code that did 3 full table scans (of the same table), joined it to itself, stored the resulting table in another table, then did 3 or 4 checks around some input, before finally inserting the user-inputted data back into the first table. Thankfully, the person who wrote this monstrosity was fired a long time before I got here, but this isn't the first time I've come across some awful code, that, when history checked via Git, points entirely to them.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
I'm not sure that git is a horror for presenting a low-level view of the world, especially if some people want that. It's certainly not a tool that's designed for anybody but programmers, that's for sure. Everybody has their own quirky ways of managing their source code that it's hard to accommodate everybody.

If there's one thing I'd like to fix up about git's UI, it's all the tiny inconsistencies in its command line UI. How do you delete something? git branch -d foo, git remote rm foo. For a while I was thinking of writing a new command line client around libgit2 that fixed all of this.

As for a more visual UI, it's not the best thing in the world, but I manage to work effectively inside magit. It's a fairly decent way of staging only some hunks of a file or things like that.

xtal
Jan 9, 2011

by Fluffdaddy
To say git's CLI is "a bit" of a horror is an understatement. If somebody built an alternative UI I'd be all over that in a second -- and I'm sure lots of other people would be too. Right now I just alias everything to things that make sense.

Even still, some things are critically wrong with git (or, in other words, critically right with Mercurial.) Plugin and extension architecture to name one. Extending git is a total mess.

xtal fucked around with this message at 23:07 on Sep 6, 2013

Thermopyle
Jul 1, 2003

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

The only reason I stuck with git over hg over the years was because I've always really liked github.

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe
Can anyone comment on how bitbucket compares to git nowadays?

Suspicious Dish
Sep 24, 2011

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

Hard NOP Life posted:

Can anyone comment on how bitbucket compares to git nowadays?

Nope.

Posting Principle
Dec 10, 2011

by Ralp
No one attacks Bitbucket so mirror your github repos there just in case.

xtal
Jan 9, 2011

by Fluffdaddy

Hard NOP Life posted:

Can anyone comment on how bitbucket compares to git nowadays?

GitHub is far superior to BitBucket. The margin between the two is only getting bigger.

Posting Principle posted:

No one attacks Bitbucket so mirror your github repos there just in case.

I recently set up a VPS that I store my repos on, which asynchronously syncs to GitHub. It's loads faster connecting to a VPS in the same city as me, and I'm protected if GitHub goes down or they decide to delete my repository because somebody didn't like it. Highly recommended and easy to set up.

xtal fucked around with this message at 00:09 on Sep 7, 2013

Arcsech
Aug 5, 2008

xtal posted:

To say git's CLI is "a bit" of a horror is an understatement. If somebody built an alternative UI I'd be all over that in a second -- and I'm sure lots of other people would be too. Right now I just alias everything to things that make sense.

Even still, some things are critically wrong with git (or, in other words, critically right with Mercurial.) Plugin and extension architecture to name one. Extending git is a total mess.

I haven't used it but for what it's worth, there is Legit for an alternative git CLI.

Crosscontaminant
Jan 18, 2007

Thermopyle posted:

The only reason I stuck with git over hg over the years was because I've always really liked github.
hg-git is pretty drat good in my admittedly limited experience.

Sinestro
Oct 31, 2010

The perfect day needs the perfect set of wheels.

xtal posted:

Extending git is a total mess.

That's why git gives you access to its lower lever workings. Almost any reasonable addition can be formed from a suitable composition of git's pre-provided tools. What is wrong with giving you the same tools that are used by git itself?

Flobbster
Feb 17, 2005

"Cadet Kirk, after the way you cheated on the Kobayashi Maru test I oughta punch you in tha face!"

xtal posted:

GitHub is far superior to BitBucket. The margin between the two is only getting bigger.

I'm a heavy Github user but I had to use Bitbucket earlier this year to hand off a project at an old job (needed a free private repo). My biggest complaint was the way that teams are managed. Is there any good reason for a team to also be a user account (instead of just a way of grouping other users) with its own unique e-mail address? it caused a huge pain when I first tried setting all the organizational stuff up, mainly because there wasn't an obvious e-mail to associate with the team that wasn't already one of the members'.

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!
100% BitBucket user here, not because it's better, but because our company's budget is close to $0. The UI is pretty atrocious, especially when you have over a few dozen repositories in it and names get long. I'd use GitHub if they were free for private repos. BitBucket however seems just fine if you never use the website and you just care about having somewhere safe to dump your code. Again, having paid them a total of $0 over years, I'm in no position to complain about anything.

IT BEGINS
Jan 15, 2009

I don't know how to make analogies
In a file called reportTemplateDynamicLibrary.php, formatted exactly as you see here:

What the hell does this even do?

php:
<?
function clean_driving($driving){
if(empty($driving)) return"";
$driving = trim($driving);
$driving = substr($driving,strlen($driving)-1) =="," ? substr($driving,0,-1): $driving;
$driving =str_replace(",",",\n\t",$driving);
return "$driving,\n";
}   
?>
Do you like globals? Like extract()? We've got plenty:

php:
<?
function output_line(){
global $schema, $last_invoice_row,$comma_pipe,$table_storage,$report_type,$library;
foreach($schema as $fields => $attributes){
    $lookup = strtolower($fields);
    extract($attributes);
    $value =
    (isset($last_invoice_row[$lookup]) ? $last_invoice_row[$lookup] :
            ($table ==''? $field :
                ((strstr($format,"varchar") || strstr($format,"date")) ? "" : "0.00"
                )
            )
        );
    $value = is_array($value) ? $value[$report_type] : $value;
    $output .=$value.$comma_pipe;
    }
insert_storage($output);
echo substr($output,0,-1)."\n";

    return;
}   
?>
What is a commapipe?

php:
<?
    if($comma_pipe =="|")    print_footer();
?>
php:
<?
function round1 ($string) {
return round($string,1);
}
function round2 ($string) {
return round($string,2);
}
function round3 ($string) {
setlocale(LC_MONETARY, 'en_US');

return money_format('%.3n', $string);
}
function round4 ($string) {
    setlocale(LC_MONETARY, 'en_US');

return money_format('%.4n', $string);
}
function round5 ($string) {
    setlocale(LC_MONETARY, 'en_US');
return money_format('%.5n', $string);
}
?>
:wtc:

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice

Sinestro posted:

Using ClearCase is like volunteering to get mugged so you can then have a icepick jammed in your eye socket.

And then the entire city is leveled by a nuclear explosion, instantly incinerating your lifeless husk of a body.

I can't decide if the fat client "NFS share masquerading as a repo using flaky custom NFS drivers" or CCRC "gently caress your loving discordance detected fucker" is worse. What I can say is if you ever wanted to apply C's manual header and #include management to your source control system, config specs are right up your alley.


I am trying to check in about 5000 updated files for a fairly big upgrade of a third party library right now. I have been doing this for over a week now and it still isn't done. If I try to do too many at once, java consumes 1.2GB of memory, hits the 32-bit limit, and dies. It takes about 4-6 seconds per file, not including other overhead. No one else can touch that branch because commits aren't done as a transaction so the whole thing is hosed until I'm done. That also includes merges so using separate branches doesn't help.

Mercurial or git could have done it in two minutes.

gently caress.

Sinestro
Oct 31, 2010

The perfect day needs the perfect set of wheels.

Ender.uNF posted:

And then the entire city is leveled by a nuclear explosion, instantly incinerating your lifeless husk of a body.

I can't decide if the fat client "NFS share masquerading as a repo using flaky custom NFS drivers" or CCRC "gently caress your loving discordance detected fucker" is worse. What I can say is if you ever wanted to apply C's manual header and #include management to your source control system, config specs are right up your alley.


I am trying to check in about 5000 updated files for a fairly big upgrade of a third party library right now. I have been doing this for over a week now and it still isn't done. If I try to do too many at once, java consumes 1.2GB of memory, hits the 32-bit limit, and dies. It takes about 4-6 seconds per file, not including other overhead. No one else can touch that branch because commits aren't done as a transaction so the whole thing is hosed until I'm done. That also includes merges so using separate branches doesn't help.

Mercurial or git could have done it in two minutes.

gently caress.

https://github.com/charleso/git-cc helpful?

Pythagoras a trois
Feb 19, 2004

I have a lot of points to make and I will make them later.

Vasja posted:

What is a commapipe?
At first I was trying to treat clean driving like some sort of riddle, but when I saw this I just lost it.

xtal
Jan 9, 2011

by Fluffdaddy

Sinestro posted:

That's why git gives you access to its lower lever workings. Almost any reasonable addition can be formed from a suitable composition of git's pre-provided tools. What is wrong with giving you the same tools that are used by git itself?

Mercurial does too, but with a sane API. Extending git is done with a collection of bash scripts and aliases. Its hooks/events functionality is also a lot worse.

Coffee Mugshot
Jun 26, 2010

by Lowtax
I really don't understand why anyone would find git harder to use than any other VCS or DVCS. Like, what are you guys doing? Cloning, merging, forking, pulling, cherry-picking, and blaming are dead simple. And all git UIs suck save for Github/Bitbucket because a simple alias is nicer than a totally different UX workflow. Even github talks about a bunch of features it has available but find difficult to expose through the UI.

ToxicFrog
Apr 26, 2008


Rainbow Pony Deluxe posted:

I really don't understand why anyone would find git harder to use than any other VCS or DVCS. Like, what are you guys doing? Cloning, merging, forking, pulling, cherry-picking, and blaming are dead simple. And all git UIs suck save for Github/Bitbucket because a simple alias is nicer than a totally different UX workflow. Even github talks about a bunch of features it has available but find difficult to expose through the UI.

It's because the UI is an inconsistent clusterfuck, basically. Some commands use foo add and foo rm, some use bar -a and bar -d. Checkout and reset do at least three different things each - and both of them are what other VCSs call revert, depending on how you use them, while git revert is everything else rollback. Pull looks like what you want but you probably wanted fetch+merge instead and now you're confused because your remote tracking branches don't seem to have the right head commits.

I do like git and use it every day, but the UI is inconsistent with both other version control systems and with itself, and its design as a huge pile of bash, perl and python scripts with no proper API means that writing frontends for it or other programs that communicate with it is way harder than it should be.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
It emits some pretty hilarious errors sometimes too:

code:
$ git diff path/to/file.c --staged
fatal: bad flag '--staged' used after filename

Flobbster
Feb 17, 2005

"Cadet Kirk, after the way you cheated on the Kobayashi Maru test I oughta punch you in tha face!"
The best kind of error handling is when you detect enough context to know exactly what the user wanted to do, but you still just don't do it.

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
code:
red:~ ij$ python
Python 2.7.2 (default, Oct 11 2012, 20:14:37) 
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> exit
Use exit() or Ctrl-D (i.e. EOF) to exit
>>> 

poopgiggle
Feb 7, 2006

it isn't easy being a cross dominate shooter.


I don't think I can post the code but I recently reverse-engineered an encrypted file format where each byte is encrypted by switching the nibbles and XORing with a constant value.

If an algorithm was good enough for Julius Caesar, then by God it's good enough for us!

poopgiggle fucked around with this message at 17:02 on Sep 7, 2013

FrantzX
Jan 28, 2007

Flobbster posted:

The best kind of error handling is when you detect enough context to know exactly what the user wanted to do, but you still just don't do it.

Command line processing can be enough of a pain in the rear end. Why add context guessing heuristics to the mix? I can only see that ending in madness.

ToxicFrog
Apr 26, 2008


code:
<noscript>
Your browser does not have
<a href="help/help_javascript.asp"
   target="popuphelp"
   onclick="wopen('help/help_javascript.asp', 400, 460); return false;"
   onkeypress="wopen('help/help_javascript.asp', 400, 460); return false;"
   title ="JavaScript info (launches new window)">JavaScript
</a> enabled.
</noscript>

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

ToxicFrog posted:

code:
<noscript>
Your browser does not have
<a href="help/help_javascript.asp"
   target="popuphelp"
   onclick="wopen('help/help_javascript.asp', 400, 460); return false;"
   onkeypress="wopen('help/help_javascript.asp', 400, 460); return false;"
   title ="JavaScript info (launches new window)">JavaScript
</a> enabled.
</noscript>

:bravo:
That's beautifully stupid.

Captain Capacitor
Jan 21, 2008

The code you say?
Mercurial subrepos are so much better than Git submodules.

Submodules can go to hell.

xtal
Jan 9, 2011

by Fluffdaddy

Captain Capacitor posted:

Mercurial subrepos are so much better than Git submodules.

Submodules can go to hell.

In fairness they're both really terrible.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

ToxicFrog posted:

code:
<noscript>
Your browser does not have
<a href="help/help_javascript.asp"
   target="popuphelp"
   onclick="wopen('help/help_javascript.asp', 400, 460); return false;"
   onkeypress="wopen('help/help_javascript.asp', 400, 460); return false;"
   title ="JavaScript info (launches new window)">JavaScript
</a> enabled.
</noscript>

Can we award this entry some sort of prize? Are we fresh out of blue ribbons?

gibbed
Apr 10, 2006

poopgiggle posted:

I don't think I can post the code but I recently reverse-engineered an encrypted file format where each byte is encrypted by switching the nibbles and XORing with a constant value.

If an algorithm was good enough for Julius Caesar, then by God it's good enough for us!
That sort of thing is painfully common.

evensevenone
May 12, 2001
Glass is a solid.
code:

// TODO: replace constant with PRNG stream

Hammerite
Mar 9, 2007

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

Internet Janitor posted:

code:
red:~ ij$ python
Python 2.7.2 (default, Oct 11 2012, 20:14:37) 
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> exit
Use exit() or Ctrl-D (i.e. EOF) to exit
>>> 

This doubtless seems bizarre when you first encounter it, but there is a reason it does that, and it has to do with the Python designers' efforts to keep to a clean and consistent design. "exit" is not a keyword in the language, rather it's a callable object (a kind of function, if you like) that has its string representation overloaded to produce that message. That is why that message prints when you enter its name as an expression statement in the command-line interface. Of course they could instead make it an additional keyword for the command-line interface only, but that's messy. And they can't really cause evaluation of its string representation to make the interpreter exit, because well, I shouldn't have to explain why that would be a bad idea. See:

code:
Python 3.3.1 (v3.3.1:d9893d13c628, Apr  6 2013, 20:25:12) [MSC v.1600 32 bit (In
tel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> __builtins__.exit
Use exit() or Ctrl-Z plus Return to exit
>>> str(exit)
'Use exit() or Ctrl-Z plus Return to exit'
>>>

Adbot
ADBOT LOVES YOU

Volmarias
Dec 31, 2002

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

Hammerite posted:

This doubtless seems bizarre when you first encounter it, but there is a reason it does that, and it has to do with the Python designers' efforts to keep to a clean and consistent design. "exit" is not a keyword in the language, rather it's a callable object (a kind of function, if you like) that has its string representation overloaded to produce that message. That is why that message prints when you enter its name as an expression statement in the command-line interface. Of course they could instead make it an additional keyword for the command-line interface only, but that's messy. And they can't really cause evaluation of its string representation to make the interpreter exit, because well, I shouldn't have to explain why that would be a bad idea. See:

code:
Python 3.3.1 (v3.3.1:d9893d13c628, Apr  6 2013, 20:25:12) [MSC v.1600 32 bit (In
tel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> __builtins__.exit
Use exit() or Ctrl-Z plus Return to exit
>>> str(exit)
'Use exit() or Ctrl-Z plus Return to exit'
>>>

Well, thank you for explaining what's going on, but I still don't buy that it's a good idea. Let "exit" be a keyword that exits the interpreter immediately, perhaps with a "goodbye!" message for clarity.

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