Programming |
![]() ![]() « Citoyen » 1359831780000
| 0 | ||
Methusalah a dit : I usually do the same, or sometimes "i+ = 5" for example. It saves my time, and it isn't that weird. :p |
0 | ||
Cptp a dit : This has never, EVER happened to me nor anyone I know. Nor have I ever heard of it happening period. |
0 | ||
"Hasn't happened to me so I can continue writing sloppy code" |
0 | ||
>it's sloppy because it differs from your personal practices ok also, last I checked, adding pure useless junk that doesn't help reading but only adds clutter is sloppy, not cleaning it out. |
![]() ![]() « Citoyen » 1359832140000
| 0 | ||
Before a while, I made a javascript program (I don't know how correct it is :o), but still it works good. I don't usually javascript by the way. http://www.khanacademy.org/cs/paint/1338284994 |
![]() ![]() « Citoyen » 1359833040000
| 0 | ||
My other car is a cdr! |
0 | ||
Fxie a dit : It's sloppy because it differs from professional practice. For example, http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml |
0 | ||
You mean preferential practice. If it was a legitimate standard, it would be required. It is not. And please explain why would you add something unnecessary to begin with? What purpose does it serve? Would you add "123" to the end of every line of code simply because someone tells you even though it doesn't affect your code at all (assuming it didn't)? p.s. http://mislav.uniqpath.com/2010/05/semicolons/ javascript isn't python, consider that please |
![]() « Citoyen » 1359836760000
| 0 | ||
In every piece of javascript code I have ever read, semicolons are present. Should you ever work with a team on a project, it may cause an issue if you insist on not putting semicolons since a lot of people do use them. Plus, using them avoids any possible ambiguity. It will be beneficial in the long run too, since a lot of other languages do require them. I guess it could be considered personal preference; I'd rather stick to using them like most others do. Oh, that link you edited in shows a nice example of where not using a semicolon can mess things up a little too. |
![]() ![]() « Censeur » 1359836880000
| 0 | ||
Isn't programming pretty much the same thing in a TFM map XML code? |
![]() ![]() « Citoyen » 1359837300000
| 0 | ||
Mousechris a dit : ^ |
![]() ![]() « Citoyen » 1359837660000
| 0 | ||
I'm afraid you have no clue what programming is chris :') |
![]() ![]() « Citoyen » 1359837780000
| 0 | ||
what baas said ive been using scratch for a while now, i know the basics and stuff, once i get into it more ill upload some stuff ive made |
0 | ||
Icewolfbob a dit : It's an extremely uncommon case that has honestly never happened to me nor anyone I know because, really, what? (a+b).print() is not even possible in JavaScript unless you definte "print" as a prototype of the String object, because you can only add numbers and strings and you can only "print" (in this context) strings. So, technically, that example isn't even correct. It appears to be possible to create a problem by starting a line off with parenthesis which I hadn't considered nor known about, but seriously, when would you? I think this minor problem would be fixed if the parser just assumed you wouldn't either, because really nobody separates a function name and the arguments. dostuff (arguments) { //why } Good to see you actually looked at the article, though. As for people who do or don't use semicolons: every JavaScript programmer I know doesn't. Not other languages, mind you, because a lot of people who talk about semicolons in JS come from languages that aren't parsed like JS. I mean strictly JavaScript coders who mostly agree semicolons are just pointless and so why bother. |
![]() ![]() « Citoyen » 1359838320000
| 0 | ||
Xdinochix a dit : I was using Scratch for a while, and I liked it. But it stops you being creative and stuff like that. The language is very simple too. Try learning Javascript. :B Mousechris a dit : Lol ofcourse it isn't. xD Also ![]() Can anyone help me with this, so it doesn't mess up when I try to host it? :x |
0 | ||
"stroke" is not a top-level function you need to get the context of your canvas so context=canvas.getContext('2d') then context.stroke() also you can only stroke a path, there are no arguments. also, background and strokeWeight aren't functions period. I don't know what library you got that from, but it isn't standard. strokeWeight, in real javascript, would be context.lineWidth=number |
![]() ![]() « Citoyen » 1359838680000
| 0 | ||
Fxie a dit : I've used the khanacademy.org/cs library, and it had very simple codes which were in Javascript I guess. And also I've tried using some other codes from Javascript which didn't work... I guess the website is wrong. :x |
0 | ||
Libraries aren't necessarily "wrong," but you need to use the library to use the code. If you want to run the code, the library has to be loaded in the same page. Just get the url of the library and include <script src="url.js"></script> in the html. |
![]() « Citoyen » 1359839100000
| 0 | ||
Fxie a dit : Yeh, that's true. All the languages I learnt before using javascript required semicolons. If you write only javascript, I understand why you don't see the need to use them. Although, I think using them anyway is easier, because then you get into the habit of using them which will probably save time when you move onto other languages (should you decide to). |
0 | ||
I understand the idea: semicolons end a statement. However, to use them in JavaScript is essentially not only adding more to the code which isn't needed but also, for someone not accustomed to using them, a challenge to place them only where actually necessary and not just at the end of every line. I'd honestly find it harder than easier to go through adding them. I also don't really plan to learn any other languages. I'm actually writing my entire server-side AND database in JavaScript using Node.js and MongoDB. I have experience with PHP, though, and I understood semicolons in PHP well enough while still writing JavaScript the same then. |