Allegro.cc - Online Community
Post Reply

Allegro.cc Forums » Allegro.cc Comments » Thread locks too soon

rss feed Print
Thread locks too soon
Edgar Reynaldo
Member #8,592
May 2007
avatar

Reply #2200 !!!!

This thread must never die. >:(

New page by the way. What do you want to talk about? I think it's outrageous this thread hasn't had a post since Wednesday. :P xD

I suggest we have an Allegro Hack Day, or a Depot Revival for Easter (Passover) where you find an old depot game with source code and hack on it for a few days. Bring it back to life and improve it. A resurrection hack if you will.

8-)

Neil Roy
Member #2,229
April 2002
avatar

I suggest we have an Allegro Hack Day, or a Depot Revival for Easter (Passover) where you find an old depot game with source code and hack on it for a few days. Bring it back to life and improve it. A resurrection hack if you will.

I like it. My old Speedhack entry comes to mind.

GullRaDriel
Member #3,861
September 2003
avatar

Sun is somewhat coming through the cloudy days we had. Does it mean some hacking compos are also coming ?
I hope so !
8-)

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

Eric Johnson
Member #14,841
January 2013
avatar

@Neil: That's a cool-looking 3D modeling program. Just don't let your wife catch you modeling other women! ;)

@Edgar: Thanks for sharing that link about vectors. That thread has inspired me to spruce up on my linear Algebra skills (or what's left of them anyway).

I renewed my driver's license today. It expires tomorrow, but I figured I'd get a head start on it. I went to a public notary instead of the DMV. It cost a little bit more ($50), but I was in and out in just 10 minutes! The people working there were nice, too! Definitely beats the DMV.

Neil Roy
Member #2,229
April 2002
avatar

There's an excellent series of blog posts about vectors in video game that is one of the best I have seen.

http://blog.wolfire.com/2009/07/linear-algebra-for-game-developers-part-1/

Niunio
Member #1,975
March 2002
avatar

Neil Roy said:

The fact that it is done in C means it should be easier for people to port to their favourite language.

Sorry but that is just false. C is harder to translate to another language than translate from (say) QuickBASIC or Pascal. This is not an opinion: this is a fact.

The fact is that you must to know C to understand it* but you don't need to know QuickBASIC or Pascal to understand it, just a basic programming basis (in almost any language) and basic English understanding.
_____________________________

* Practical demonstration:

Ask a newcomer who don't know a word about C if it understand what the next code does:

int whatever (int*ptr1)
{
  for (int*ptr2=ptr1+50,int r=0;ptr2!=ptr1;r+=*(ptr2--));
  return r;
}

Now ask a newcomer who don't know a word about Pascal:

FUNCTION Whatever (ptr: ARRAY OF INTEGER): INTEGER;
VAR
 Sum, Ndx: INTEGER;
BEGIN
 FOR Ndx := Low (ptr) TO High (ptr) DO INC (Sum, ptr[Ndx]);
 EXIT (Sum)
END;

-----------------
Current projects: Allegro.pas | MinGRo

Bruce Perry
Member #270
April 2000

Ooh, vectors! I know all about those :)

{"name":"mmus-articles-how-far-fo-mosquitoes-fly-2","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/4\/b4c1b092487184295d1164602911eef7.png","w":800,"h":534,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/4\/b4c1b092487184295d1164602911eef7"}mmus-articles-how-far-fo-mosquitoes-fly-2

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

bamccaig
Member #7,536
July 2006
avatar

With Nuinio's C example rewritten to be more pragmatic I think the average programmer would understand it fine:

int whatever (int * ptr)
{
    int i, sum = 0;

    for (i = 50; i >= 0; i++)
    {
        sum += ptr[i];
    }

    return sum;
}

That said, these are both trivial examples that do not bare the teeth in either language. :) Here's the same program in Perl:

sub whatever {
    my $sum = 0;

    for my $x (@_) {
        $sum += $x;
    }

    return $sum;
}

You could probably also understand this Perl program relatively easily (with minimal squinting), but that doesn't mean you can understand any Perl program without an understanding of Perl.

Chris Katko
Member #1,881
January 2002
avatar

Niunio said:

The fact is that you must to know C to understand it*

I agree and disagree. You must know ANY C-derivative, which is like 90% of all good languages.

Web? Javascript.
Corporate? Java and C#,
Systems? C, C++.
Newer languages? D. Rust(ish) and literally dozens more.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs

Neil Roy
Member #2,229
April 2002
avatar

Niunio said:

Ask a newcomer who don't know a word about C if it understand what the next code does:

LMFAO!!!!! Awesome examples, yes, that is exactly the code I would show a complete newcomer! Oh man... that was funny.

I find it ironic that you compared Pascal which is rarely used anymore with C which is still in strong use to this day and is the grandfather of just about ALL of the best languages in use!!! :D

On another subject, followed a really nice tutorial on Blender today and created this. Just need Homer in this pic somewhere...

{"name":"611329","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/c\/5\/c5aae15288229ba8dd98ba4080c23b12.jpg","w":1920,"h":1080,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/c\/5\/c5aae15288229ba8dd98ba4080c23b12"}611329

Niunio
Member #1,975
March 2002
avatar

I know, my C code was intentionally obfuscated.

And say that "C is the grandfather of just about ALL of the best languages in use" is always debatable. I really think that best was pretty much made conditional by the economical interest of some software companies (remember: the only objective of C# was to overtook Java).

In any case we're not talking about which one is better or more used but which one is better to be translated to other languages. In that case BASIC and Pascal are the languages.

-----------------
Current projects: Allegro.pas | MinGRo

Chris Katko
Member #1,881
January 2002
avatar

Niunio said:

(remember: the only objective of C# was to overtook Java).

C# is better than Java in pretty much every imaginable way. The .NET framework itself is a godsend for people who have to write code quickly that actually works, and scales.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs

Chris Katko
Member #1,881
January 2002
avatar

Niunio said:

(remember: the only objective of C# was to overtook Java).

C# is better than Java in pretty much every imaginable way. The .NET framework itself is a godsend for people who have to write code quickly that actually works, and scales.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs

Niunio
Member #1,975
March 2002
avatar

C# is better than Java in pretty much every imaginable way.

And to buy Mojang paying billions was a greeeeeeeeeeat idea...

Sorry for the sarcasm, but the only advantage I see in C# is that its VM is highly integrated in Windows 10 (and it is an advantage only if you think it is an advantage), but since you can use any other language (including Pascal and Java*) the advantage is quite small.

Note the emphasis in the "I" of "I see"; I must admit that the only (serious) contact I had with C# was few time after it was published for the very first time, and I saw so much in common with Java that I stopped to read. In any case I think we'll never agree in this because there are a lot of personal stuff (education, preferences, experiences...) in this issue.

By the way, where's the Python fanbase? Why they didn't say their language is the best for learning? I really miss that sentence in this discussion.

[edit] I think we found the limits of this thread. Posting didn't work smooth.
______________

* Fun fact: You can use Pascal to create JVM executables too.

-----------------
Current projects: Allegro.pas | MinGRo

Arvidsson
Member #4,603
May 2004

You only need HTML and variables really.

Bruce Perry
Member #270
April 2000

You only need HTML and variables really.

I get the reference ;D

As compared to Java, C# has structs, i.e. aggregate value types. That's huge :)

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

bamccaig
Member #7,536
July 2006
avatar

C# has a lot of things that Java either doesn't have or didn't have until very recently. The only real advantage Java has had was being somewhat open source, but now that C# is somewhat open source too that advantage is also pretty much gone. To be fair, I'm also biased towards C# because I've worked with it for years, but I've dabbled in Java a few times over the years (outdated now to be sure) and was always surprised how many features it still lacked. For example, C# has had support for lambdas and implicit types for years (2008). Sounds like Java may have gotten lambdas around Java 8 (2014) and should be getting implicit types in 2018 (Java 10). That's just two features. The entire feature set is like that. C# is just easier to read and write, while Java lags nearly a decade behind playing catch-up.

Eric Johnson
Member #14,841
January 2013
avatar

Neil Roy said:

There's an excellent series of blog posts about vectors in video game that is one of the best I have seen.

http://blog.wolfire.com/2009/07/linear-algebra-for-game-developers-part-1/

Thanks for the link, Neil. Lots of good content there. I can see dot product being especially useful.

So Trent released a trailer for his latest game today:

video

DanielH
Member #934
January 2001
avatar

Niunio said:

but you don't need to know QuickBASIC or Pascal to understand it

I'd disagree. Pascal is only slightly more readable then C. And both are more reader-friendly than each of their object-oriented cousins.

Also, it depends on the coder. You should see some of my old code. Horrible. I was very fond of single-letter variables.

Kind of makes me want to pull out my old (very old) code and reminisce.

Chris Katko
Member #1,881
January 2002
avatar

DanielH said:

And both are more reader-friendly than each of their object-oriented cousins.

HAHAHAHAHHAHAHHAH

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs

bamccaig
Member #7,536
July 2006
avatar

DanielH said:

I was very fond of single-letter variables.

I still prefer them in small functions that are guaranteed to fit on a screen and only have a few variables. It's easier to see the code when it's display size is smaller as long as it's not too complicated. The longer the code gets, the more detailed the symbols need to be.

Neil Roy
Member #2,229
April 2002
avatar

I just watched an interesting video. I never knew who was behind Blender's start before and I really like this guy. I love his personality and his philosophy. He was a little hard to understand at first, but you get used to his speech really fast and I just love this guy, his personality rocks. I especially love his thoughts on money, they're right in line with my own. This is one of those videos I wasn't going to bother watching and was so glad I did.

It's surprising the positive things that can come about from doing some good in this world and not being greedy. Ton is a truly special individual as far as I am concerned. This gives me far more respect for Blender and it's founder.

video

Edgar Reynaldo
Member #8,592
May 2007
avatar

DanielH
Member #934
January 2001
avatar

Speaking of Pascal. In one of my computer science classes, we had to use flex and bison to parse a Pascal program into C.

One big issue was arrays.

Arrays in C

/* type name[ count ]; */
int a[10];

Arrays in Pascal

{ name : array[startindex .. endindex] of type; }
a : array[1..20] of integer;
b : array[-10..35] of real;

Neil Roy
Member #2,229
April 2002
avatar

DanielH said:

Arrays in C

That explains why C became more popular. :)

Otherwise, I don't see what is complicated about it. It would convert to:

a : array[0..9] of integer;

Though I have never programmed Pascal.

Post Reply


Go to: