Page 2 of 9

Re: Development video on youtube

Posted: Wed Apr 18, 2012 11:20 am
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".

Re: Development video on youtube

Posted: Wed Apr 18, 2012 11:32 am
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)

Re: Development video on youtube

Posted: Wed Apr 18, 2012 11:37 am
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.

Re: Development video on youtube

Posted: Wed Apr 18, 2012 11:39 am
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...)

Re: Development video on youtube

Posted: Wed Apr 18, 2012 11:43 am
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();
}


Re: Development video on youtube

Posted: Wed Apr 18, 2012 11:48 am
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...

Re: Development video on youtube

Posted: Wed Apr 18, 2012 11:58 am
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.

Re: Development video on youtube

Posted: Wed Apr 18, 2012 12:48 pm
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#.

Re: Development video on youtube

Posted: Wed Apr 18, 2012 12:54 pm
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?

Re: Development video on youtube

Posted: Wed Apr 18, 2012 12:56 pm
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.

Re: Development video on youtube

Posted: Wed Apr 18, 2012 1:01 pm
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.

Re: Development video on youtube

Posted: Wed Apr 18, 2012 1:03 pm
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"

Re: Development video on youtube

Posted: Wed Apr 18, 2012 1:18 pm
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).

Re: Development video on youtube

Posted: Wed Apr 18, 2012 1:23 pm
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?)

Re: Development video on youtube

Posted: Wed Apr 18, 2012 1:31 pm
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.