Best features of pastebins and repository web interfaces?

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

User avatar
Pesto
Posts: 737
Joined: Wed Sep 05, 2007 5:33 pm UTC
Location: Berkeley, CA

Best features of pastebins and repository web interfaces?

Postby Pesto » Mon Sep 05, 2011 6:13 am UTC

I'm in the middle of writing a web interface for browsing git repositories. I'm beginning work on the UI portion, and would like some general input.

What are the essential features for displaying code on the web? (Note: I'm only talking about the displaying code portion for the moment, so these could be features of any repository web interface or pastebin like site.)

Here's what I have so far.

* Line numbers
* Copy and paste without line numbers coming along for the ride
* Anchor tags to link to specific line numbers
* Syntax highlighting (on the list for later)

Any other big ones I've missed?

User avatar
headprogrammingczar
Posts: 3072
Joined: Mon Oct 22, 2007 5:28 pm UTC
Location: Beaming you up

Re: Best features of pastebins and repository web interfaces

Postby headprogrammingczar » Mon Sep 05, 2011 12:35 pm UTC

http://hpaste.org/ has an IRC bot that can announce recent pastes to an entire channel.
<quintopia> You're not crazy. you're the goddamn headprogrammingspock!
<Weeks> You're the goddamn headprogrammingspock!
<Cheese> I love you

User avatar
RoadieRich
The Black Hand
Posts: 1037
Joined: Tue Feb 12, 2008 11:40 am UTC
Location: Behind you

Re: Best features of pastebins and repository web interfaces

Postby RoadieRich » Tue Sep 06, 2011 1:09 am UTC

I'm a big fan of Codepad, because it executes the code, thereby including any error messages be default.
73, de KE8BSL loc EN26.

User avatar
Steax
SecondTalon's Goon Squad
Posts: 3038
Joined: Sat Jan 12, 2008 12:18 pm UTC

Re: Best features of pastebins and repository web interfaces

Postby Steax » Tue Sep 06, 2011 3:15 am UTC

Make sure you set it to overflow with scrollbars on desktop machines, but wrap on mobile devices. Please, I beg you. How many times have I not been able to see code off my phone because it wants scrollbars but apparently my device can't scroll them properly... Just use media queries for low resolutions.

Also, alternate line backgrounds, I find that helps a lot with pastebin-type things. If you can, please preserve tabs as tabs, don't convert them to spaces (so they copy over to a text editor properly) and ensure the input box allows users to enter tabs.
In Minecraft, I use the username Rirez.

User avatar
BotoBoto
Posts: 191
Joined: Mon Mar 09, 2009 9:31 pm UTC
Contact:

Re: Best features of pastebins and repository web interfaces

Postby BotoBoto » Tue Sep 06, 2011 7:16 am UTC

Steax wrote:Make sure you set it to overflow with scrollbars on desktop machines, but wrap on mobile devices. Please, I beg you. How many times have I not been able to see code off my phone because it wants scrollbars but apparently my device can't scroll them properly... Just use media queries for low resolutions.

Also, alternate line backgrounds, I find that helps a lot with pastebin-type things. If you can, please preserve tabs as tabs, don't convert them to spaces (so they copy over to a text editor properly) and ensure the input box allows users to enter tabs.


Amen to that.

User avatar
Mat
Posts: 414
Joined: Fri Apr 21, 2006 8:19 pm UTC

Re: Best features of pastebins and repository web interfaces

Postby Mat » Tue Sep 06, 2011 8:53 am UTC

I've always found it annoying that graphical diff viewers don't highlight the syntax as well. I'm not sure how to nicely do both at the same time though.

You should be able to git blame each line and go to that commit. Would be great if you could mouseover and see the commit message.

User avatar
PM 2Ring
Posts: 3715
Joined: Mon Jan 26, 2009 3:19 pm UTC
Location: Sydney, Australia

Re: Best features of pastebins and repository web interfaces

Postby PM 2Ring » Tue Sep 06, 2011 10:52 am UTC

Steax wrote:If you can, please preserve tabs as tabs, don't convert them to spaces (so they copy over to a text editor properly) and ensure the input box allows users to enter tabs.


Or maybe offer tab conversion as an option on upload & download. (I'm not a big fan of tabs in source files, but I don't want to start a religious war on that topic). But having some sort of basic Indent facility would be nice. That way users can upload & download stuff in their preferred format and you don't have to worry about mandating a style to make code in the repository look nice & uniform.

When you get around to doing the syntax highlighting, another (related) feature that would be cool: if you click on an identifier it links to where that identifier is defined (or where it's first used for languages that don't require declarations). And conversely, if you click on an identifier definition you get a menu / list of links to places where it's used. That'd be especially handy for functions & global variables.

User avatar
BotoBoto
Posts: 191
Joined: Mon Mar 09, 2009 9:31 pm UTC
Contact:

Re: Best features of pastebins and repository web interfaces

Postby BotoBoto » Tue Sep 06, 2011 1:19 pm UTC

PM 2Ring wrote:
Steax wrote:If you can, please preserve tabs as tabs, don't convert them to spaces (so they copy over to a text editor properly) and ensure the input box allows users to enter tabs.


Or maybe offer tab conversion as an option on upload & download. (I'm not a big fan of tabs in source files, but I don't want to start a religious war on that topic). But having some sort of basic Indent facility would be nice. That way users can upload & download stuff in their preferred format and you don't have to worry about mandating a style to make code in the repository look nice & uniform.

When you get around to doing the syntax highlighting, another (related) feature that would be cool: if you click on an identifier it links to where that identifier is defined (or where it's first used for languages that don't require declarations). And conversely, if you click on an identifier definition you get a menu / list of links to places where it's used. That'd be especially handy for functions & global variables.


Its mostly because tabs give more of a readable document. Ever tried removing the indentation of 4 tabs? 16x backspace Isn't all that pretty.

User avatar
Steax
SecondTalon's Goon Squad
Posts: 3038
Joined: Sat Jan 12, 2008 12:18 pm UTC

Re: Best features of pastebins and repository web interfaces

Postby Steax » Tue Sep 06, 2011 2:23 pm UTC

I really think they should just leave tabs alone. People can use it if they want, and most good text editors have a tabs-to-spaces function (but almost never vice-versa).

Honestly though, it's not about tabs vs spaces, it's about being allowed to indent in the code editor (I assume by spaces you mean that hitting tab produces X space characters instead of a tab character). This one bugs me to hell.
In Minecraft, I use the username Rirez.

User avatar
Mat
Posts: 414
Joined: Fri Apr 21, 2006 8:19 pm UTC

Re: Best features of pastebins and repository web interfaces

Postby Mat » Tue Sep 06, 2011 5:27 pm UTC

I think you should reject all files that use spaces for indentation :)

somebody already took it
Posts: 310
Joined: Wed Jul 01, 2009 3:03 am UTC

Re: Best features of pastebins and repository web interfaces

Postby somebody already took it » Mon Sep 12, 2011 5:28 am UTC

Adjustable tab-width. In some cases I like to use spaces for alignment, for example:

Code: Select all

foo(arg1, arg2,...
    argn-1, argn);

but I've found if I happen to use a online code browser with a different tab-with than my text editor the alignment will be messed up. (I suppose using pure spaces whenever going past the indentation level would fix this, but it's nice to have other options.)

Unparallelogram
Posts: 336
Joined: Mon Jul 28, 2008 4:16 am UTC

Re: Best features of pastebins and repository web interfaces

Postby Unparallelogram » Mon Sep 12, 2011 6:25 pm UTC

Contextual links are great. If the source is referencing another file or another place in the file (includes, function calls, even just variables), it's a ton easier if it's just clickable.

User avatar
Dason
Posts: 1311
Joined: Wed Dec 02, 2009 7:06 am UTC
Location: ~/

Re: Best features of pastebins and repository web interfaces

Postby Dason » Tue Sep 13, 2011 12:11 am UTC

somebody already took it wrote:(I suppose using pure spaces whenever going past the indentation level would fix this, but it's nice to have other options.)

If others are going to be reading your code you should probably do this anyways.
double epsilon = -.0000001;


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 10 guests