Programming V3 MEGATHREAD [Because we need one]

Author Topic: Programming V3 MEGATHREAD [Because we need one]  (Read 6493 times)

Code: (python) [Select]
for item in list:
    print item

vs

Code: (torquestuff) [Select]
for(%i = 0; %i < list.getCount(); %i++)
{
    echo(list.getObject(%i));
}

i think we can agree python is significantly better than torquescript (which isn't what you were saying but I was drawing a hyperbole and stuff)

i don't understand how anyone can have trouble with python, i think it's one of the easiest languages out there...
Honestly, the Torquescript version looks more understandable to me. In my opinion, computer programming languages which are word-based and use few symbols are hard to look through.

Psst, you can't compare strings with == in Java either. ;)
I know, and I never use == in Java.
It's just that I forgot about the dollar signs.

I've been a completete noob at Torquescript today.
I haven't used Torque for 5 months, and during that time I used Java very heavily. So let me tell you the story:

I made an add-on called "System_HammerHost" today, which communicates with the HammerHost control panel server, and you would not believe how stupid my initial code was.
Instead of using switch$ keywords, I used switch. Also, I used "+" signs instead of "@" signs by accident. I confused Java syntax with Torque script syntax. Worst of all, I used == to compare strings instead of $=. That and the plus signs made me waste 20 minutes trying to search for syntax errors when "String always evaluates to 0" errors spammed the console.

I was so used to Java that I did not notice the "+" signs were not used for concatenating strings. What an idiot I was.

Additionally, I used break; statements inside cases in switches. No wonder the console was spammed with "Break outside of loop...ignoring" errors. Occasionally, I forgot to put "%" and "$" signs in front of variables (since you don't use those in Java), and even goofed off so much that I declared a variable like this:
Code: [Select]
int $hhcp_chatListenCount = 0;

And to top it all of, I thought serverCmdchatMessage() was the server-command-function for sending chat messages, although it's really serverCmdmessageSent(). Yet another stupid mistake I made was forgetting to put the parented serverCmdmessageSent() function inside a package.

So looks like I forgot all my prior Torquescript knowledge from early-mid 2013, and need to brush up on it.
Does anybody else confuse multiple languages? Fortunately, I am lucky to not confuse HTML, CSS, Javascript, and Java with each other. It's just the percentage and dollar signs which drive me crazy.

That's usually about how it goes for me when I shift languages for a bit.

Honestly, the Torquescript version looks more understandable to me. In my opinion, computer programming languages which are word-based and use few symbols are hard to look through.

That's probably because you understand Torquescript. To someone like me who doesn't even know either, I would prefer Python out of the two.

That's probably because you understand Torquescript. To someone like me who doesn't even know either, I would prefer Python out of the two.
I mean, if the text editor which I could use for Python colors the syntax well, I wouldn't mind. But it just looks horrible to me in the un-colored version.

I mean, if the text editor which I could use for Python colors the syntax well, I wouldn't mind. But it just looks horrible to me in the un-colored version.



Seems good enough.

example


well stuff that was awfully redundant

looks like i accidentally overwrote the list type too, my bad


my point is
this
Code: (python) [Select]
for every item contained inside this object "list", do the following:
     print out "item"
or this
Code: (torquestuff) [Select]
for(@%#%@&2773#%&#%&i#&) {
     echo like a motherloving sound in a cave {(({ %bullstuff }})))
}

yeah i'm making a really stuffty straw man argument here


and java, don't get me started on that stuff
why does it force me to do /bulstuff/file/directory/structure/code.java
why can't i just do code.java
what is wrong with jar files why do they suck
« Last Edit: February 28, 2014, 10:21:00 PM by Lugnut »

Yeah, except there are too many words. I like symbol based more than word based, and things like if then(x and y) versus if(x && y) is annoying.
IIRC, Lua uses keywords for readability, and it makes up for its keyword use in its general lack of syntax constructs, meaning there isn't much to learn about Lua in general compared to other languages, and you can solve pretty much any problem with what Lua gives you.

i think we can agree python is significantly better than torquescript (which isn't what you were saying but I was drawing a hyperbole and stuff)

i don't understand how anyone can have trouble with python, i think it's one of the easiest languages out there...
The main reason I first had trouble learning python was because of the massive standard lib. The language itself is fine for the most part, but it took me a while to find that the function I needed to list a directory was called "os.walk".

I do commend on Python's productivity potential though.

And yeah, most of us here can probably agree that TorqueScript is pretty stuffty.

And yeah, most of us here can probably agree that TorqueScript is pretty stuffty.
Well, Torque is not supposed to be a general-purpose language. It's designed to be quick to code.

Code: (torquestuff) [Select]
for(@%#%@&2773#%&#%&i#&)

LOL.

Well, Torque is not supposed to be a general-purpose language. It's designed to be quick to code.

I feel like it takes much longer to type out for (sdf;!#@$#$ ++ i;e09i0(!*#!)%(#!;@#)&(!#U^#);flux capacitor++;desu*@3123oSAD()@!3!!psdfQ@(#123)) {{{
donkey();
}}}

The main reason I first had trouble learning python was because of the massive standard lib. The language itself is fine for the most part, but it took me a while to find that the function I needed to list a directory was called "os.walk".

I do commend on Python's productivity potential though.

And yeah, most of us here can probably agree that TorqueScript is pretty stuffty.
why didn't you google it? I'm not even joking - python has the friendliest community and an absolutely stupid amount of resources
"how to list directory in python" > http://stackoverflow.com/questions/120656/directory-listing-in-python > os.listdir()

eh, i sound like a richard, sorry

yeah python is pretty easy to get a hang of