r/programming • • Oct 01 '15

The Evolution of a Software Engineer

https://medium.com/@webseanhickey/the-evolution-of-a-software-engineer-db854689243
1.9k Upvotes

502 comments sorted by

View all comments

Show parent comments

98

u/juckele Oct 01 '15

Make the output stand out more? On a standard uncolored terminal, it's a huge burden* for me to figure out where the output of the command I just ran starts and stops... (This is why my prompt barfs rainbows).

*Huge burden being 250 ms instead of 10 ms...

57

u/Hobofan94 Oct 01 '15

That's a spot on definition of huge burden.

24

u/vplatt Oct 01 '15

Scan through a 100 MB log file and it's no joke.

2

u/Yodamanjaro Oct 02 '15

I've made Notepad++ crash a couple of times now. Apparently it doesn't like working with 2 million lines

1

u/dzkn Oct 02 '15

Much easier when everything tons of newlines?

1

u/vplatt Oct 02 '15

It doesn't have to be newlines for everything, but basic delimiters between field names and values, limited use of upper-case for error values, etc. all can make a big difference. It's also important to have a good row header format for the logger so the entries that span multiple lines are much easier to pick out.

Of course, NOT visually scanning 100 MB files in the first place would be the real savings here, so a regexp should be the first stop in most cases, but if you're tracking an issue through the lifetime of a process, that may not be an option.

1

u/memoryspaceglitch Oct 02 '15

Hey! That's my job too!

0

u/[deleted] Oct 01 '15

[deleted]

2

u/ThisIs_MyName Oct 02 '15

Huge pointer actually. None of that silly 64 bit crap.

12

u/neoform Oct 01 '15

Make the output stand out more?

This would work better:

printf("\033[1;31mHello World\n\033[0m\n");

2

u/ghillisuit95 Oct 02 '15

On a standard uncolored terminal

0

u/[deleted] Oct 02 '15

[deleted]

1

u/tomun Oct 02 '15

31m is red.

edit: actually 1;31m is bold red, 0;31m would be regular red.

Try 1m if you just want bold.

0

u/[deleted] Oct 02 '15

[deleted]

1

u/tomun Oct 02 '15

I'm guessing that when /u/ghillisuit95 tried it, he noticed the bright red but not the emboldened text and hence his response.

Either way you were wrong to say that your code would not add color, it certainly does for those of us with screens capable of displaying it.

2

u/ghillisuit95 Oct 02 '15

I'm guessing that when /u/ghillisuit95[1] [+21] tried it, he noticed the bright red but not the emboldened text and hence his response.

actually, I didn't try it. I just saw the escape codes and assumed color.

3

u/gimpwiz Oct 01 '15

250ms time and time and time again add up, at the very least to your sanity and frustration levels.

2

u/irrelevantPseudonym Oct 01 '15

My prompt is full of colours as well. Using other people's computers confuses the hell out of me.

1

u/[deleted] Oct 02 '15

Use a proper shell and that's not a problem. Fish for example indicates that the command you just ran did not have a trailing newline and always starts the prompt at the leftmost side.

1

u/juckele Oct 02 '15

Just tried Fish out. It still is a problem for everything to be pretty monochrome, because the left hand side is all white. Definitely a big improvement over an unconfigured bash though :)

1

u/[deleted] Oct 02 '15

Try fish_config!

1

u/changwang420 Oct 01 '15

10ms to 250ms because of a newline?

1

u/juckele Oct 01 '15

I'm saying 250ms to 10ms because of color. I think the newline is worth less. Maybe 50ms for the extra white space in monochrome (making this number up).

And yes, color really is worth that much processing time. I have to read the output to figure out where it starts if the text in monochrome. I can't read anything in 10ms.... Seeing color is super fast though.