Live data from Hacker News

One Way to Improve Your Coding

changelog.com

21–30 of 121 posts

Re: One Way to Improve Your Coding

#21

Can anyone recommend good tools for reading code? I find github.com to be very klunky for this purpose, and even emacs/vim make the task much more troublesome than it could be. Is there such a thing as a "read-only IDE" anywhere out there? (Ideally features would include click-to-definition, navigate back and forth, add bookmarks and annotations.)

Coming from Visual Studio, my impression is that a proper IDE should do all those things you mentioned. (minus annotations, but that's what comments are for)

I am curious as to why you would want a read-only IDE though. I'd like to see what would be different if the IDE's focus was for reading a large code base rather than writing one.

Re: One Way to Improve Your Coding

#22

I'm going to be "that guy" in the comments section this time, largely because I feel like I've been seeing this more recently and I've had to fix it myself: I don't really get why it seems to be a "thing" recently for websites to have low-contrast text colors. This is at least the second time in a week I've seen light gray text on white background, and to not strain my eyes I went into the CSS for the website and fix…

I've been a UX designer for 10 years and I can tell you why. (Or at least why from point of view.) It's a deprecated design practice to make font rendering looks smoother in a world where retina screens were not ubiquitous. Back in the old days (so like 3 years ago) before the majority of screens were 'retina' (aka you can't see the pixels at normal viewing distances) fonts always rendered with jagged edges. Turning…

That's interesting, I'd never even thought about something like that. Thanks for responding with that information.

Is this still something that gets taught? Or do you think that these sites are being made by people who were taught that a number of years ago and haven't taken the time to learn how to interact with monitors in a post-retina/high-dpi world? Or has it become some kind of "cult" knowledge that gets repeated by people who aren't aware of the real reasoning behind why it was done back then?

Also interesting to learn white-on-black eye strain is nonsense. Another comment mentioned that it probably looks better to have dark gray because true blacks are rare, is that accurate?

Re: One Way to Improve Your Coding

#23
Another good technique for understanding other people's code is to attach a debugger.

Find an interesting spot in the code that you'd like to examine more closely and set a breakpoint there, looking up the stack to see who called this function and who called them and so forth.

Re: One Way to Improve Your Coding

#24
This is one thing I need to do more often. I came from a school and industry segment (.Net) that very highly discourages reading other people's code, and even years later I feel guilty trying to read jQuery's source when I run into a weird edge case.

Is there projects out there that are easy for beginner code readers to grok? I've tried reading libraries you've all heard of, but even after an hour of jumping between files I still have trouble getting a view-from-10000-feet picture of how the project works.

Re: One Way to Improve Your Coding

#25
post #11

I'm going to be "that guy" in the comments section this time, largely because I feel like I've been seeing this more recently and I've had to fix it myself: I don't really get why it seems to be a "thing" recently for websites to have low-contrast text colors. This is at least the second time in a week I've seen light gray text on white background, and to not strain my eyes I went into the CSS for the website and fix…

From my limited exposure to designers, I've learned that they think lower contrast strains reader's eyes less than high contrast does. Black on white is thought to be too striking to read comfortably. Here is a post from 2012 explaining why it's important to use a dark grey instead of a pure black: https://ianstormtaylor.com/design-tip-never-use-black And I agree. Pure black often looks bad. Light gray is even worse.

I can add my anec-data: I find it really hard to read white text on any dark background, black being obviously the worst.

I also find pure white with pure black really straining on my eyes. I hate the trails of lines I get reading bright text on dark backgrounds, or with really high-contrast colours generally.

Like the parent(or grandparent?), I've edited CSS for web pages. I've got a chrome extension called change colors installed, which has shortcuts for override-colours-by-domain and on-this-page-only. Really handy.

Re: One Way to Improve Your Coding

#27
post #21

Can anyone recommend good tools for reading code? I find github.com to be very klunky for this purpose, and even emacs/vim make the task much more troublesome than it could be. Is there such a thing as a "read-only IDE" anywhere out there? (Ideally features would include click-to-definition, navigate back and forth, add bookmarks and annotations.)

Coming from Visual Studio, my impression is that a proper IDE should do all those things you mentioned. (minus annotations, but that's what comments are for) I am curious as to why you would want a read-only IDE though. I'd like to see what would be different if the IDE's focus was for reading a large code base rather than writing one.

You're right, of course. I guess what I'm really longing for is ease-of-use and ease-of-setup. For ease-of-use, the default action is navigation (just like reading a web page) so that I can drill-down and mentally execute code not unlike being in a debugger. For ease-of-setup, I don't necessarily want to clone something, create tag files, and possibly install a language mode... I just want to read.

Perhaps this seems a bit lazy, but I think of reading code as similar to reading books or articles: not everything is worth the same level of investment. Yes, some things I want to really get into, and get dirty running (or writing) tests, refactoring, and commenting. Other things I want to just (passively) read or even skim.

I feel like a full IDE, or the recommendations in the parent article, lean toward the in-depth study that I don't find appropriate for every task.

(It's been 20 years since I last used Visual Studio, so my understanding of its capabilities is obviously dated.)

Re: One Way to Improve Your Coding

#28

I'm going to be "that guy" in the comments section this time, largely because I feel like I've been seeing this more recently and I've had to fix it myself: I don't really get why it seems to be a "thing" recently for websites to have low-contrast text colors. This is at least the second time in a week I've seen light gray text on white background, and to not strain my eyes I went into the CSS for the website and fix…

This site[1] says it's because people conflate content with illustration. It also cites Hacker News as an offender (although looking at their screenshot to what I'm seeing, I think it was "fixed")

[1] http://contrastrebellion.com/

Re: One Way to Improve Your Coding

#29

Can anyone recommend good tools for reading code? I find github.com to be very klunky for this purpose, and even emacs/vim make the task much more troublesome than it could be. Is there such a thing as a "read-only IDE" anywhere out there? (Ideally features would include click-to-definition, navigate back and forth, add bookmarks and annotations.)

this chrome extension, octotree https://goo.gl/BZRqop, is very helpful for reading code on github. Reading github is how I started learning how repos are structured and how to read other people's code when I was early in my cs degree.

Re: One Way to Improve Your Coding

#30

I'm going to be "that guy" in the comments section this time, largely because I feel like I've been seeing this more recently and I've had to fix it myself: I don't really get why it seems to be a "thing" recently for websites to have low-contrast text colors. This is at least the second time in a week I've seen light gray text on white background, and to not strain my eyes I went into the CSS for the website and fix…

I agree, I've found myself tweaking site CSS often lately as well. To some designers' argument that there's no such thing as true black I say that this is a limitation, not an ideal. https://bestmotherfucking.website/#grey-text

Were my JS fundamentals a little stronger, I'd work on a browser add-on to detect low-contrast body text and improve it automatically.

Post reply on HN