« first day (298 days earlier)      last day (4650 days later) » 

12:10 AM
is there a naming convention for methods on an object in JS?
 
@ThomasShields Do you mean, camel case and stuff like that?
 
yeah pretty much
 
Above all, just be consistent in what you do.
 
yeah, gp
 
You can take that to the next level, and say, be consistent in what javascript does, looking at how the built-in stuff does it.
lowerUpper();
 
12:14 AM
right. what if the method doesn't have two words in it? just lower()?
 
But if you wanted to use polish notation (please don't), you could always do oWhateverSomething();
Correct, they do lower() and lowerUpper();
 
what's with the leading o in oWhateverSomething()?
 
The object is like this really:
UpperUpper.lower.lowerUpper();
 
so my game object should be var Game
 
o is polish notation for Object. Polish/hungarian notation died years ago.
I'd say var Game.init(); and so forth
 
12:15 AM
wow weird @notations
I hope I didn't just ping some random user
 
that's really just preference, but consistence is key.
 
Yup. consistence. I'm gonna slap a big ole giant comment reading "CONSISTENCY IS KEY!" on top my script now.
 
> No users matched your search
 
@Incognito phew.
 
Eh, if it helps you remember it's good, but you don't need to comment it. It's kind of like the whole UX stuff, if you've looked into that.
 
12:17 AM
Yeah i'm putting the comment solely for personal benefit. :) "UX stuff"?
like ux.se?
 
No no, UX as in the concept of User eXperience, we have a SE site for it.
Basically talks about making things easier to use by making them intuitive.
 
Oh, right. I thought you meant something more specific. Yeah, UX is very fascinating. I'm pretty passionate about little nuances and stuff. :)
 
lowerUpper() everywhere really helps, where as by contrast you have PHP where it might be (there's one case, so camel doesn't count) one_two(); or onetwo() or some other thing.
In computer programming, a naming convention is a set of rules for choosing the character sequence to be used for identifiers which denote variables, types and functions etc. in source code and documentation. Reasons for using a naming convention (as opposed to allowing programmers to choose any character sequence) include the following: * to reduce the effort needed to read and understand source code; * to enhance source code appearance (for example, by disallowing overly long names or abbreviations). The choice of naming conventions can be an enormously controversial issue, with parti...
The link goes to JS:
> The built-in JavaScript libraries use the same naming conventions as Java. Classes use upper camel case (RegExp, TypeError, XMLHttpRequest, DOMObject) and methods use lower camel case (getElementById, getElementsByTagNameNS, createCDATASection). In order to be consistent most JavaScript developers follow these conventions.
 
ahh. cool. thanks!
 
Also, you'll see a lot of JS code written in this indent style: en.wikipedia.org/wiki/Indent_style#BSD_KNF_style
Both are fine, but I like the BSD one.
I think ruby people prefer the allman style.
 
12:23 AM
the BSD one really ticks me off; I dunno why. I guess I feel like the code is yelling at me lol.
 
Ahahaha, it probably is ;).
 
lol :D
 
My general rule is it's function { ... not function, new line, bracket.
and I don't like indenting my break; statement inside of a switch label, even if it's inside that scope still.
But I'm coming around...
 
generally I've put the bracket on the new line (in C#) but with JS i've been keeping it up. I have no idea why I would behave differently for the different languages; I just do.
brb
okay so i'm working on this Snake game. I've not done as much with JS OO as I'd like. I've got a Game object, which has board, snake, and "stuff" objects. "stuff" is a generic object that can get used as a prototype for objects like the food, obstacles, etc. Does that sound right?
or am I completely messed up?
 
If your noun for something is "stuff" it needs to change.
The name of it, that is.
 
12:30 AM
I couldn't think what else to call it.
 
I asume it's basically a building block of sorts that you dress up with inherited objects and mutation?
 
pretty much.
 
Don't allow yourself to use ambiguious names.
 
It might be the parent object for the food or obstacles
 
stuff.implement.thing.run();
 
12:31 AM
haha gp.
 
Right, lets go with "baseObject", if that makes sense to you. Or building block.
Whatever word you think makes sense. English kind of sucks here :(.
 
ThomasShieldsCopyrightPersonal.ProjectZ.MethodA.doIt()
 
Lol.
 
yeah. good idea. thnx.
 
You have a brilliant future in enterprise programming :P
 
12:33 AM
hahahaha
 
Can snake be a type of building block?
 
not really.
The snake has multiple parts.
 
Can you manage the multiple parts via a snake?
 
what do you mean?
 
Maybe some of your building blocks should move, and a snake is moving building blocks around.
So, your snake controls multiple building blocks, rather than being it's own thing.
 
12:35 AM
Hm.
 
Yeah, snake, used to be called nibbles back in the day.
Nibbles is a simple video game and variant of Snake. It was inspired by an early 1980's game called Hustle from the Radio Shack TRS-80 micro-computer. (It was not influenced by Mozaik Software's 1984 Amstrad CPC game, Nibbler in spite of the similar names). Nibbles was written in QBasic by Rick Raddatz, who later went on to create small business companies such as [http://Xiosoft.com Xiosoft] and [http://Bizpad.com Bizpad]. Gameplay The game's objective is to navigate a virtual snake (or worm) through a walled-space while consuming numbers (from 1 through 9) along the way. The player must...
 
That just seems to be kind of unsemantic. I'm using baseObject to control stuff like a) how many points you get for hitting it b) how many the snake grows by when you hit it c) any custom method you need to run when you hit it.... none of which are approriate for the snake's pieces.
 
hrmm, can I see the source?
You might want to abstract your base object a bit.
 
I'm not too far along yet, but sure, one second. saves JSBin
Forgive what will be a use of the DOM for moving the snake. If I do the OO right I should be able to easily swap it out for Canvas afterwards.
 
If you OOP it the right way, switching between canvas and HTML shouldn't matter.
 
12:40 AM
exactly.
 
Basically, everything is abstracted to an object in classical OOP.
I foresee problems with how you've set up your pattern.
How do you plan on having one object call another if it's nested a few levels?
this.child.child breaks down after a bit if it's all in one expression like this.
 
well, I don't have to go down that far. what specifically were you thinking?
 
I could link you to an existing jquery snake clone, which might be helpful.
 
Sure.
 
He didn't make it OO like you're trying however, it's more like a series of functional calls.
You can tell when someone hasn't abstracted correctly when you see near-identical code blocks cut+paste more than a few times, with a few things changed here and there.
 
12:45 AM
that looks like a lot of code and a lot of hand-coded values.
 
It is. I'm not saying to emulate it, but it might be helpful.
 
Right. okay. thanks.
 
You could probably refactor that whole program into 200 lines.
 
I'll see how many I can do mine in :)
 
If I were to make a snake game...
let me find some paper...
 
12:47 AM
Technically you could do it in 1 line.
 
don't worry about line count, I'm only saying his program is so long because he didn't abstract it correctly.
Line count is an awful metric for code quality.
 
It took me a little bit to figure out how to actually move the snake, logically.
Yeah, true. :D
 
Have you made a simpler game before?
Pong might be a good first project.
 
I've made a game. shudders
 
It's actually neat, and if you OOP it right, you can have multiple balls, paddles, etc.
 
12:49 AM
You don't want to see it.
@Incognito ...you think I could use WebSockets to get a live two player version going?
 
I suggest pong for a first project. First graphical game I've made.
Yes.
 
awesome
 
If you OOP it correctly.
If you OOP it you need to think about interfaces to objects. I'm not sure if there's something straightforward in JS to do that, but there was in C++ and Java.
 
wouldn't I want to Prototypically OO it? not classically?
 
In JS? Yes.
 
12:52 AM
right, okay.
 
I'm just not sure how I'd translate an interface into that concept =/.
I don't think about bridges between the two very often.
But anyway, if I were doing this, I'd have five objects.
Game, which contains a block and a player.
Game contains your score, and all the blocks, etc.
Maintains your websockets through some other class too...
 
blocks as in "paddles" right? for Pong?
 
Game drops blocks and players. Blocks are anything that can be interacted with, and drawn. Blocks are inherited by walls, snake segments, and items.
 
oooh.
interesting.
 
The player controls blocks that are snake segments, the user interface controlls the player (ie, snakes)
so really, blocks that are snake segments actually are part game, part player.
 
12:56 AM
Could you guy's look at this and see if you can help:
2
Q: Redirect Plugin Not working

Shawn31313I'm trying to create a Redirect timer plugin from all JS (JQuery) but for some reason its not updating the timer since I started using a different method: (function( $ ){ $.fn.redirect = function( options ) { var settings = { 'second' : '10' }; var options=$.extend( settings...

 
Everything else is block, which is inside of game.
 
@Incognito right. and block could have a draw function.
meaning changing how rendering is done would be very easy.
 
Right.
 
That sounds like a good idea
 
And the image you render for block is part of the object that will inherit a block
so, a snake would have a property such as snake.jpg, but you'd call block.render(); in a loop over the whole game.
Concept: invisible snakes?
 
12:59 AM
but the whole point is to control the snake. what's the point of an invisible one?
 
Make it harder for the player.
Crazy bonus round.
 
wow, that would be hard.
 
two snakes
 
good idea.
two controllers.
 
They have some tetris clones with that concept
 
1:04 AM
cool
 
I hate this 128kb/s internet. 12 kills streak in tf2, lagged out.
 
This sounds cool
 
@Incognito so, for starters, something like so: jsbin.com/ewofeq/edit#javascript,html? (And I won't keep pinging you every other minute, just wanted to make sure i'm generally right before I really get going)
 
@Shawn31313 Why's all the code in jsfiddle smashed together?
 
in the .html is just alot of differant vars to setup the html for the timer
 
1:06 AM
Snake is your game variable?
 
whcih actually doesnt needs to be messed with
 
@Incognito oh i should have used Game. changes
 
and the code is messy
and i know that but i cant make it look better until I get this one thing working
 
@Shawn31313 See if you can clean it up before it works. I find working in a mess actually makes it harder.
What's the exact issue however?
 
well if you click the redirect button you will see the number 15
this should coundown
which it is not
that actually the only probably I'm facing
 
1:09 AM
@Incognito one last thing. Do you think I should have a Game.render() method that calls each object's render methods?
 
Game should initalize, which should call it's own draw processes.
So, yeah, as long as it's done in a way that makes sense.
 
okay. coolio. thanks for all your help/advice/general-awesomesauce!
 
@Shawn31313 The guy who answered your question is correct.
Try using jshint.com in the future, it'll save you headaches.
Alright everyone, I'm out.
 
OK bye
 
later @Incognito
 
 
2 hours later…
2:49 AM
RT @codepo8: I never saw the introductory video to NVDA - nicely done http://bit.ly/caMYj
 
 
1 hour later…
3:51 AM
anybodu here?
 
4:29 AM
they show empty to me
only casual and iphone/ipad have a couple people
 
 
2 hours later…
6:19 AM
RT @slicknet: Realize a bunch of you may not be familiar with my vendetta against <img src="">. Here's the 411: http://t.co/9vrSwX5
 
6:55 AM
The revolution XML didn’t bring: “Ex Em Hell” in http://goo.gl/yhdUs “still living this nightmare, with no end in sight” #htmlwin via @assaf
 
7:46 AM
@ThomasShields ugh.
everything camelcase
Only use pascal case for constructors
@Incognito an interface is an object
every object is an interface
 
Can anyone help me with this question? stackoverflow.com/questions/7006985/…
 
8:43 AM
hello world!
 
9:07 AM
@Raynos: do you know what happens if I "@" someones nickname and that person is not present in the room
does he still get noticed ?
 
@jAndy Yeah, I think they still get noticed
Pops up in the global inbox
 
yay I know thats the way you'll get noticed, I'm just wondering if that only works if the person is still present (even tho, "disabled" because of long idle times) or if that works all the time
¯\__(ツ)__/¯
 
I think it works all the time, because I've gotten notifications when I've come back to the site after a day
 
hopefully. I'm generally sceptical if a webapp overwrites native key shortcuts :p
don't have a macos client around, wondering if cmd+c is still blocked/overwritten
 
I'm running Ubuntu. :/
Why would they overwrite Command+C?
 
9:16 AM
I have no clue if it "was" (is?) by accident or intention. However you weren't able to copy selected text with cmd+c in the past
which kinda sucked in a chat
 
Wow, that's weird
 
9:47 AM
@jAndy yes
He gets notified on stackoverflow
it works at all times
remember how we annoy @NickCraver :D
 
@Raynos: ok cool
 
@NickCraver I am sorry :(
 
yaay, I thought he mentioned that this was a very special feature for him/by him :p
btw, we didn't annoy @NickCraver, we summoned him
 
@NickCraver are you special? (very special)
you can do it with everyone
you can summon whomever you want
 
;)
 
9:49 AM
@MylesGray summon summon summon
 
is there actually someone responsible for this chat ?
I mean someone who can get blamed :p
 
Well
there are room owners
and then there are mods
 
no, I mean the dev
 
Oh
ask rchern
 
I'm still befuddled about that cmd+c thing
someone has got to tell some guy who can do something about it
 
9:52 AM
@jAndy what cmd c thing
I think generally your supposed to complain on meta
and tag it
 
I don't know if it's fixed yet, but afaik its not possible to copy text from this chat on macOS with cmd+c
which is the standard shortcut for that operation
 
macs suck?
 
steve jobs and I would say, "@Raynos just got no taste!"
 
10:15 AM
jerks =P
 
Like the new expression I learned from Starcraft geeks... instead of "jerks" you could also have written
"Trolllolol" :p
 
Good morning JavaScript.
 
10:37 AM
So, uh, for all you people constantly asking, Presto 2.9.199/2.10.199 supports ES5.
 
i want to make validation for .rss file only. how can i do???
good mrng greg
 
hey @NickCraver how's it going?
 
AMH
11:21 AM
Hi all
am trying to create table that contain image but when try to display the table there're spaces between the rowa
<body>
<table width="700" align="center" style="border:0">
<tr style="border:0"> <td> <img src="images\1.png" /> </td></tr>
<tr style="border:0"> <td > <img src="images\2.png" /> </td> </tr>
<tr style="border:0"> <td> <img src="images\3.png" /></td> </tr>
<tr style="border:0"> <td> <img src="images\4.png" /> </td></tr>
<tr style="border:0"> <td> <img src="images\5.png" /> </td></tr>
<tr style="border:0"> <td> <img src="images\6.png" /> </td></tr>

</table>


</body>
any suggestion
@Aseman @Greg any idea
 
RT @ODevRel: New on dev.opera: "Microdata & the microdata DOM API", http://t.co/JbB7k6f, by @chrisdavidmills. Enjoy!
RT @sethladd: PSA: when searching for web programming reference docs, try appending MDN to your query.
 
AMH
@Darkyen
 
11:43 AM
0
Q: Request timeout

Adam LynchI'm using some jQuery to display tweets but once the Twitter API limit is reached, the request is sent but just keeps loading and loading. This doesn't look good. I want to be able to determine if the request is taking too long and then obviously do stuff, like cancel the request, change the styl...

even if you don't know for sure I don't mind suggestions/ideas
 
@AMH Sorry, I've read your quetion but I did not understand!
can you explain a little more?
 
AMH
no problem it's cellpading problem I solved it
 
ok!
 
@AdamLynch Mind adding a JSFiddle link or something?
 
12:13 PM
@AmaanCheval the demo of the plugin is linked
well the tutorial is linked and the demo can be found via the tutorial
 
@AdamLynch Ah. I thought that was a link to jQuery's site or something
 
my fault
 
Na, it's okay, I should've checked. Looks like you've already got 2 answers, though
 
Actually I think the other answer is more helpful. In a combination with that one, of course
 
12:21 PM
posted on August 10, 2011

This week’s. Or something’s. Your donation for keeping this series up and running would be much appreciated. An overview of what WebKit 2 is. Summary: not really important for web developers; it’s mostly a reshuffling of internal threads and functions. No doubt important, but in theory we should not notice anything. The only browser that I’m certain uses WebKit 2

 
Since Twitter's asking you to cache it, I think that's the way to go
 
12:35 PM
@Raynos I guess if you're complaining about my code formatting style, not much could be wrong with the actual code, right? this is good, right? :D
 
@ThomasShields Cool, you're making Snake. I planned on making it, but then got really busy
Best of luck!
 
@AmaanCheval thanks!
 
Have you made any other games in Canvas?
 
@AmaanCheval I made one game, a long, long time ago. I had no structure to it and it was incredibly long and ugly.
Recently I did TicTacToe, though not in Canvas.
 
Tic Tac Toe was my first game (in JavaScript, and in my entire life)
 
12:40 PM
nice.
 
Then I made it in Canvas and added all the animations and all
Kind of stupid
 
cool!
 
Then I made a remake of a popular iOS game called Flood It!
And started work on a platformer (inspiration = Mario). But soon gave up.
 
@AmaanCheval that animation is cool. But it doesn't do anything when I win. (tic tac toe)
 
Whoops.
I sent you the wrong one
It doesn't even play right, that one
Edited it. Try reloading the page
 
12:48 PM
aha. nice!
 
If anyone goes through the code, the parameters in the strike function are purely coincidental
 
lol
just comment //pose after it.
 
Yeah, did that
 
Hello, is this syntax allowed in javascript, and if so, what does it mean?
function XDocument::OnLoad(eventObj){}
 
12:57 PM
that looks like Java to me
 
I found it on a microsoft article.
They said it was JScript.
 
weird.
 
but I was wondering if there was any way I could implement it in javascript.
 
if you want to fire an event when the window loads, just do window.onload = function() { //stuff };
 

« first day (298 days earlier)      last day (4650 days later) »