Scripting Language development

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

User avatar
superLED
Chaos Rift Junior
Chaos Rift Junior
Posts: 303
Joined: Sun Nov 21, 2010 10:56 am
Current Project: Engine
Favorite Gaming Platforms: N64
Programming Language of Choice: C++, PHP
Location: Norway

Re: Development video on youtube

Post by superLED »

tappatekie wrote:@The Floating Brain:
erm.. No idea why your post was deleted? but the answer is, I prefer having private members on top of public to basically say, these public functions use these private functions.
But keep in mind that if you are working with other people, and they are going to use your code, they only need to see the public functions, because that's all they are going to use.
If you have a huge list of private stuff at the top, people would need to scroll down an look for the things they wanna use.

Private stuff is only(?) used within that class. Putting it at top and say "Look at this" is in my eyes not efficient.
But we all find our own way of dealing with things. If you find this easier to read and understand, go for it ^^

This method helps me. "Do I have a function to rotate and scale the text?" *Looking through the public functions* "Oh, yes, I have. And that's how I use it".
tappatekie
Chaos Rift Junior
Chaos Rift Junior
Posts: 204
Joined: Mon Nov 21, 2011 3:01 pm
Current Project: Web browser from scratch
Favorite Gaming Platforms: SNES, PSP, PS1 and 3
Programming Language of Choice: C#
Location: A house near me
Contact:

Re: Development video on youtube

Post by tappatekie »

superLED wrote:
tappatekie wrote:@The Floating Brain:
erm.. No idea why your post was deleted? but the answer is, I prefer having private members on top of public to basically say, these public functions use these private functions.
But keep in mind that if you are working with other people, and they are going to use your code, they only need to see the public functions, because that's all they are going to use.
If you have a huge list of private stuff at the top, people would need to scroll down an look for the things they wanna use.

Private stuff is only(?) used within that class. Putting it at top and say "Look at this" is in my eyes not efficient.
But we all find our own way of dealing with things. If you find this easier to read and understand, go for it ^^

This method helps me. "Do I have a function to rotate and scale the text?" *Looking through the public functions* "Oh, yes, I have. And that's how I use it".
Personally, I prefer it private then public because I like the functions that the public functions would use above them, so that (if I wanted to) I could make other private/public functions also depend on them. But I believe that the code layed out in that way won't really matter when viewing it under visual studio, since visual studio has a jump list thingy anyway... So if they want the function, they just select it from the list and it jumps straight to it.
The functions you seen in the "teaser" are actually the functions within there own class which is ONLY called from the script. But I will keep it in mind when writing the interpreter code (in fact im gonna change it around a bit now...).
But yh, since I have no experience with making my code more "friendly" for other programmers to actually read it. I just make the functions which make it work and nothing more, so I don't really bother with the actual layout of it.
I will cover that anyway in the video :P (it may be a multi-parter :D)
Last edited by tappatekie on Wed Apr 18, 2012 11:45 am, edited 2 times in total.
User avatar
k1net1k
Chaos Rift Maniac
Chaos Rift Maniac
Posts: 563
Joined: Sun Nov 07, 2010 2:58 pm
Contact:

Re: Development video on youtube

Post by k1net1k »

Did I delete the wrong post from this thread ? If so, I apologise. Someone had marked the post as reported and the post said something like "I couldnt work out how to delete this" So I deleted it.
tappatekie
Chaos Rift Junior
Chaos Rift Junior
Posts: 204
Joined: Mon Nov 21, 2011 3:01 pm
Current Project: Web browser from scratch
Favorite Gaming Platforms: SNES, PSP, PS1 and 3
Programming Language of Choice: C#
Location: A house near me
Contact:

Re: Development video on youtube

Post by tappatekie »

k1net1k wrote:Did I delete the wrong post from this thread ? If so, I apologise. Someone had marked the post as reported and the post said something like "I couldnt work out how to delete this" So I deleted it.
It's sound, you deleted the right post after I reported my own post because I could not delete it. The Floating Brain deleted it :P.
(For some weird reason, the "x" icon thingy was not there...)
User avatar
THe Floating Brain
Chaos Rift Junior
Chaos Rift Junior
Posts: 284
Joined: Tue Dec 28, 2010 7:22 pm
Current Project: RTS possible Third Person shooter engine.
Favorite Gaming Platforms: PC, Wii, Xbox 360, GAME CUBE!!!!!!!!!!!!!!!!!!!!!!
Programming Language of Choice: C/C++, Python 3, C#
Location: U.S

Re: Development video on youtube

Post by THe Floating Brain »

tappatekie wrote:@The Floating Brain:
erm.. No idea why your post was deleted?
I thought that was C# code for your interpreter for a sec and got embarresed :lol: sorry.
tappatekie wrote: but the answer is, I prefer having private members on top of public to basically say, these public functions use these private functions.
I wasent questioning your style, I was questioning your syntax.

For example:

Code: Select all


class A
{
   private:
      int myInt;
      string s;
   public:
      void Func();
      void Func2();
}

As opposed to:

Code: Select all


class B
{
   private int myInt;
   private string s;
   public Func();
   public Func2();
}

"Why did we say we were going to say we were going to change the world tomorrow yesterday? Maybe you can." - Myself

ImageImage
tappatekie
Chaos Rift Junior
Chaos Rift Junior
Posts: 204
Joined: Mon Nov 21, 2011 3:01 pm
Current Project: Web browser from scratch
Favorite Gaming Platforms: SNES, PSP, PS1 and 3
Programming Language of Choice: C#
Location: A house near me
Contact:

Re: Development video on youtube

Post by tappatekie »

THe Floating Brain wrote: I wasent questioning your style, I was questioning your syntax.

For example:

Code: Select all


class A
{
   private:
      int myInt;
      string s;
   public:
      void Func();
      void Func2();
}

As opposed to:

Code: Select all


class B
{
   private int myInt;
   private string s;
   public Func();
   public Func2();
}

The programming language (Plywood) does not actually have classes... or accessors to methods

It's more like

Code: Select all

def i = 0
method printTheIDef(o,j,a) { 
      printl("Your arguments where" & o & j * a)
      printl(i)
}
A method (as well as every definition) can have ANY value type passed to it. So there is no need for int i = 0, the interpreter does that for you.

So I can do fancy stuff like

Code: Select all

def i = 0
i = array() { "Lol", "I was an integer...", "But now...", "I am an array?" }
I made it like this because it makes your code less cluttered (in my opinion) and it looks more cleaner (in my opinion again)..

But... if you mean how I use my c# syntax, it's the second one...
tappatekie
Chaos Rift Junior
Chaos Rift Junior
Posts: 204
Joined: Mon Nov 21, 2011 3:01 pm
Current Project: Web browser from scratch
Favorite Gaming Platforms: SNES, PSP, PS1 and 3
Programming Language of Choice: C#
Location: A house near me
Contact:

Re: Development video on youtube

Post by tappatekie »

Here is another teaser for all you lovely people :D
This code is the top of interpreter source code... And as you can see, it was displayed like public then private.
Attachments
teaser2.png
teaser2.png (23.71 KiB) Viewed 3001 times
User avatar
THe Floating Brain
Chaos Rift Junior
Chaos Rift Junior
Posts: 284
Joined: Tue Dec 28, 2010 7:22 pm
Current Project: RTS possible Third Person shooter engine.
Favorite Gaming Platforms: PC, Wii, Xbox 360, GAME CUBE!!!!!!!!!!!!!!!!!!!!!!
Programming Language of Choice: C/C++, Python 3, C#
Location: U.S

Re: Development video on youtube

Post by THe Floating Brain »

tappatekie wrote:
THe Floating Brain wrote: I wasent questioning your style, I was questioning your syntax.

For example:

Code: Select all


class A
{
   private:
      int myInt;
      string s;
   public:
      void Func();
      void Func2();
}

As opposed to:

Code: Select all


class B
{
   private int myInt;
   private string s;
   public Func();
   public Func2();
}

The programming language (Plywood) does not actually have classes... or accessors to methods

It's more like

Code: Select all

def i = 0
method printTheIDef(o,j,a) { 
      printl("Your arguments where" & o & j * a)
      printl(i)
}
A method (as well as every definition) can have ANY value type passed to it. So there is no need for int i = 0, the interpreter does that for you.

So I can do fancy stuff like

Code: Select all

def i = 0
i = array() { "Lol", "I was an integer...", "But now...", "I am an array?" }
I made it like this because it makes your code less cluttered (in my opinion) and it looks more cleaner (in my opinion again)..

But... if you mean how I use my c# syntax, it's the second one...

Nice dynamic typing! :-D

So w8 was your first sample C#?

Im kinda confused at first I though it was Plywood then C# then Plywood now I think its C#.
"Why did we say we were going to say we were going to change the world tomorrow yesterday? Maybe you can." - Myself

ImageImage
tappatekie
Chaos Rift Junior
Chaos Rift Junior
Posts: 204
Joined: Mon Nov 21, 2011 3:01 pm
Current Project: Web browser from scratch
Favorite Gaming Platforms: SNES, PSP, PS1 and 3
Programming Language of Choice: C#
Location: A house near me
Contact:

Re: Development video on youtube

Post by tappatekie »

THe Floating Brain wrote:
tappatekie wrote:
THe Floating Brain wrote: Im kinda confused at first I though it was Plywood then C# then Plywood now I think its C#.
Every teaser from now has been in C# from Visual Studio...
Every code block in my posts is plywood syntax

Also, what you mean by nice dynamic typing?
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: Development video on youtube

Post by dandymcgee »

superLED wrote:But keep in mind that if you are working with other people, and they are going to use your code, they only need to see the public functions, because that's all they are going to use.
If you have a huge list of private stuff at the top, people would need to scroll down an look for the things they wanna use.
I prefer private at the top in C++, as it's the way I learned. I like to see my variables before I see my functions. In C# I don't generally sort by private / public, but rather group things however makes the best sense. First of all, I'm worried about maintainability and readability for myself above some random person who's not familiar with the code base. Second, Visual Studio's Intellisense almost entirely does away with the need for higher level users to go into my code. Third, even without Intellisense I would still favor personal readability and solid documentation over writing undocumented code that idiots can easily read because they see public first.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
THe Floating Brain
Chaos Rift Junior
Chaos Rift Junior
Posts: 284
Joined: Tue Dec 28, 2010 7:22 pm
Current Project: RTS possible Third Person shooter engine.
Favorite Gaming Platforms: PC, Wii, Xbox 360, GAME CUBE!!!!!!!!!!!!!!!!!!!!!!
Programming Language of Choice: C/C++, Python 3, C#
Location: U.S

Re: Development video on youtube

Post by THe Floating Brain »

tappatekie wrote: Every teaser from now has been in C# from Visual Studio...
Every code block in my posts is plywood syntax

Also, what you mean by nice dynamic typing?

Okay that's what I though :lol:


Dynamic Typing: the ability to change the data-type of variables (I believe), like in Python or Lua.
"Why did we say we were going to say we were going to change the world tomorrow yesterday? Maybe you can." - Myself

ImageImage
tappatekie
Chaos Rift Junior
Chaos Rift Junior
Posts: 204
Joined: Mon Nov 21, 2011 3:01 pm
Current Project: Web browser from scratch
Favorite Gaming Platforms: SNES, PSP, PS1 and 3
Programming Language of Choice: C#
Location: A house near me
Contact:

Re: Development video on youtube

Post by tappatekie »

dandymcgee wrote:
superLED wrote:But keep in mind that if you are working with other people, and they are going to use your code, they only need to see the public functions, because that's all they are going to use.
If you have a huge list of private stuff at the top, people would need to scroll down an look for the things they wanna use.
I prefer private at the top in C++, as it's the way I learned. I like to see my variables before I see my functions. In C# I don't generally sort by private / public, but rather group things however makes the best sense. First of all, I'm worried about maintainability and readability for myself above some random person who's not familiar with the code base. Second, Visual Studio's Intellisense almost entirely does away with the need for higher level users to go into my code. Third, even without Intellisense I would still favor personal readability and solid documentation over writing undocumented code that idiots can easily read because they see public first.
Agreed, however after a period of time away from that code (e.g you work on something else for a while) I become completely foreign to the code base of a previous project.

THe Floating Brain wrote: Dynamic Typing: the ability to change the data-type of variables (I believe), like in Python or Lua.
Ah :P Never would have guessed that with the "Dynamic Typing..." (keyboard typing kinda thing...)
Id thought it was something like "Dynamic Object Type Association"
User avatar
bbguimaraes
Chaos Rift Junior
Chaos Rift Junior
Posts: 294
Joined: Wed Apr 11, 2012 4:34 pm
Programming Language of Choice: c++
Location: Brazil
Contact:

Re: Development video on youtube

Post by bbguimaraes »

On the code organization topic: reading source code should be the last resource when trying to understand how some part of the application works. You (the developer) should supply documentation to guide users (developers using your code, not the end user).
tappatekie
Chaos Rift Junior
Chaos Rift Junior
Posts: 204
Joined: Mon Nov 21, 2011 3:01 pm
Current Project: Web browser from scratch
Favorite Gaming Platforms: SNES, PSP, PS1 and 3
Programming Language of Choice: C#
Location: A house near me
Contact:

Re: Development video on youtube

Post by tappatekie »

bbguimaraes wrote:On the code organization topic: reading source code should be the last resource when trying to understand how some part of the application works. You (the developer) should supply documentation to guide users (developers using your code, not the end user).
I haven't decided yet whether I open source it, however there is advantages, the programming language internal systems (e.g encryption (homebrew)) cannot be touched by other people since its a little security issue (unless I make it a seperate library..)

On another note, may I use some of the comments on the video? (with mentioning the elysian shadows project and this forum?)
Last edited by tappatekie on Wed Apr 18, 2012 1:31 pm, edited 1 time in total.
User avatar
bbguimaraes
Chaos Rift Junior
Chaos Rift Junior
Posts: 294
Joined: Wed Apr 11, 2012 4:34 pm
Programming Language of Choice: c++
Location: Brazil
Contact:

Re: Development video on youtube

Post by bbguimaraes »

tappatekie wrote:
bbguimaraes wrote:On the code organization topic: reading source code should be the last resource when trying to understand how some part of the application works. You (the developer) should supply documentation to guide users (developers using your code, not the end user).
I haven't decided yet whether I open source it, however there is advantages, the programming language internal systems cannot be touched by other people since its a little security issue (unless I make it a seperate library..)
I meant developers working with you on the project, I should've been more explicit. Even if you're working on your own, I think it's better to have it documented. It makes your life easier, you can get back to your project a few months (sometimes event weeks) and still know what your code does and, should any developer join your team later, you have no extra work to do.

But I guess it's all personal style.
Post Reply