So everyone, to get a little discussion going, what is everyone's most favorite snippet of code. Doesn't matter the language or it's functionality. Just what is everyone's favored code snippet.
To start, I guess I should tell mine. It's in javascript, and it's not so much a snippet but a technique. Personally, I don't like having many variables that are only used once then never touched again, so I do something of the following:
Code
I like this for a few reasons. The first being the single call to getValues(). the 2nd being that there isn't a "touched-once" variable
@Hawkee the thread/comment system is quite cumbersome to navigate in my opinion, threads are ordered descending in the order of creation(?) and collapsed and then we have comments to those threads that are collapsed... And then when we get a notice, on those threads/comments, it takes us to our notice page, which then takes us to the 'snippet'(for this example) but does expand the thread/comment that the 'notice' occured on
A few things I've spotted real quick
1: why is the 7 escaped in your regex @ gopher)\72
2: HTTPS, FTP and gopher, afaik, is a competely different protocol from http, meaning the GET ... Host: headers are invalidly used.
3: Instead of coding the 'redirect' for puu.sh, why not just have your sockets follow redirects?
@Hawkee I don't really like the newest to oldest comment order you've implemented. I know it makes getting to the new comments easier but makes reading conversations a bit difficult
1: Draw a few random shapes
2: Select the filled-circle tool
3: Click the center of the canvas and hold
4: While holding the mouse down make the circle huge then small again
5: Notice that when shrinking the circle-size, what would have been under it is erased
Now on to my suggestions:
JSlint your code: I know it's a hassle, but it really does make reading code easier.
You can use '<tag class="something">' instead of having to escape double quotes. Another way to make things easier to read
Q: Im looking for a specific site. Its sort of a forum based type deal, where logical/prgramming questions are asked. You can solve the questions with any method you wish so long as you come up with the correct answer.
Well, Started looking through posts just to see what I could find, and a gem in a big pile of shoot is what this is. I do a bit of AHK coding myself and have something similar to this. Though your's is quite a bit cleaner than mine.
I'm not trying to troll you; just giving some constructive critism.
It's ugly:
For starters the colors aren't pleasing to the eye; they clash. If you want a light theme, use more pastel colors for the background. if you want a dark theme, go the opposite. As of right now, the colors make everything hard to see.
It's cluttered. It seems like you stuck everything where ever you had room. I'd suggest dividing it up a bit. Maybe tabs or menus. Right now there's no direction or unity between the elements.
It's unclear what each element is/does. What does each box under transparency do and what does it apply to?
@Hawkee Just a suggestion. for the code tags, maybe add in a few language-specific syntax highlighters to the code bbc, to be used as such: [ code=languageHere]...[/code ]
The basics:
$base(input,baseIn,baseOut)
input -> number representation to be converted
baseIn -> the base of the input (2 for binary, 8 for octal, 10 for decimal, 16 for hex, but can be any base)
baseOut -> the base to convert 2 (2 for binary, 8 for octal,...)
Example:
Binary to Decimal: $base(10,2,10) = 2
Octal to Decimal: $base(10,8,10) = 8
Hex to Decimal: $base(10,16,10) = 16
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.