Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 3 [4] 5 6 7

Author Topic: What programming language?  (Read 17901 times)

foop

  • Bay Watcher
    • View Profile
Re: What programming language?
« Reply #45 on: May 14, 2010, 04:31:41 am »

I came across a link to the excellent blog post "A Brief, Incomplete, and Mostly Wrong History of Programming Languages" yesterday, and it seems appropriate at this point to quote the entry for C.

Quote from: One Div Zero
1972 - Dennis Ritchie invents a powerful gun that shoots both forward and backward simultaneously. Not satisfied with the number of deaths and permanent maimings from that invention he invents C and Unix.
Logged

Thief^

  • Bay Watcher
  • Official crazy person
    • View Profile
Re: What programming language?
« Reply #46 on: May 14, 2010, 07:27:02 am »

If you think C is evil, you should look up B.

EDIT:
Code: [Select]
main( ) {
  extrn a, b, c;
  putchar(a); putchar(b); putchar(c); putchar('!*n');
}
a 'hell';
b 'o, w';
c 'orld';
Character constants (single quotes) actually hold up to 4 characters (technically still true in C, but you have to store them in something other than a char variable type).
Implicit typing of variables.
No separate bitwise and logical ops (seriously)
The cause of C's bitwise operators having the wrong precedence (evaluated after comparison operators instead of before).
"Assignment by operator" operators are the wrong way round, =- instead of -=, which causes subtle parse errors (x=-10 vs x = -10 vs x =- 10)
Still has pointers, you can just dereference any variable as if it was an address
Real strings (double quotes) are '\e' terminated instead of '\0' terminated
Because strings are still character arrays, and B's internal character type really contains 4 characters, accessing actual individual characters needs a function call or doing a bit shift and mask.

And many others I can't bring myself to look up or remember.
« Last Edit: May 14, 2010, 07:55:40 am by Thief^ »
Logged
Dwarven blood types are not A, B, AB, O but Ale, Wine, Beer, Rum, Whisky and so forth.
It's not an embark so much as seven dwarves having a simultaneous strange mood and going off to build an artifact fortress that menaces with spikes of awesome and hanging rings of death.

mistinshadows

  • Bay Watcher
    • View Profile
Re: What programming language?
« Reply #47 on: May 14, 2010, 08:57:19 am »

Wow, this has spawned into quite the discussion!

Thank you to everyone for all the input on various programming languages.  At this point, I think I'm going to stick with learning C++, but will likely look at others as well once I get a solid foundation in C++.  Right now, I'm still new enough to programming that I don't want to overwhelm my poor head with too many different ideas at once!
Logged

KoFish

  • Bay Watcher
    • View Profile
Re: What programming language?
« Reply #48 on: May 14, 2010, 09:59:56 am »

Wow, this has spawned into quite the discussion!

Thank you to everyone for all the input on various programming languages.  At this point, I think I'm going to stick with learning C++, but will likely look at others as well once I get a solid foundation in C++.  Right now, I'm still new enough to programming that I don't want to overwhelm my poor head with too many different ideas at once!

You really should consider learning proper C to begin with instead. C++ is nice but it's alot harder to do correct then C is.
Logged

jfs

  • Bay Watcher
    • View Profile
Re: What programming language?
« Reply #49 on: May 14, 2010, 10:36:41 am »

You really should consider learning proper C to begin with instead. C++ is nice but it's alot harder to do correct then C is.
But C will teach you things that are a bad idea to do in C++.
It's true that C++ overall is a more complex language, but it provides many more safety mechanisms when used correctly.
Logged

Rafal99

  • Bay Watcher
    • View Profile
Re: What programming language?
« Reply #50 on: May 14, 2010, 10:42:31 am »

Do not learn C before C++ or you will get bad habits of doing stuff the C way, which is usually worse than doing it C++ way.
Logged
The spinning Tantrum Spiral strikes The Fortress in the meeting hall!
It explodes in gore!
The Fortress has been struck down.

NoahTheDuke

  • Bay Watcher
    • View Profile
Re: What programming language?
« Reply #51 on: May 14, 2010, 04:01:28 pm »

Hey Baughn, if I wanna get into Haskell game programming, what OpenGL wrapper/bindings/libraries should I use? It looks like a cool language, but I don't wanna waste my time on an out-dated or silly subsystem.

Noah
Logged

Puzzlemaker

  • Bay Watcher
    • View Profile
Re: What programming language?
« Reply #52 on: May 14, 2010, 05:54:41 pm »

Most, if not all games nowadays are at least partly coded in C++.  It's a pretty low-level language in general, at least at it's most basic form, which makes it helpful for that kind of stuff.  Of course, the amount of libraries that are available for it are... overwhelming.

I really need to branch out my programming; I haven't ever even looked at ruby or haskell.
Logged
The mark of the immature man is that he wants to die nobly for a cause, while the mark of the mature man is that he wants to live humbly for one.

Baughn

  • Noble Phantasm
  • The Haruhiist
  • Hiss
    • View Profile
Re: What programming language?
« Reply #53 on: May 14, 2010, 07:04:59 pm »

The Haskell Platform comes with a perfectly funtional opengl binding, which you should be able to use as-is. For creating the needed opengl context and handling i/o.. well, the GLUT package is fine while learning, and the haskell binding makes it considerably less annoying than it usually is. You can get to another later.

There aren't any mature game engine-style things, but there are a variety of opengl-related things on Hackage you might still find a use for, including a very interesting library for running computations on shaders.

One caveat, though: You really want to do this on linux or, failing that, os x. Haskell *works* on windows, but it takes extra effort; you don't want to spend time figuring that out at the same time as you're learning haskell.

Oh, and get an IRC client so you can hang out at #haskell on irc.freenode.net. We're very friendly. You can talk to me there, too. ;)
Logged
C++ makes baby Cthulhu weep. Why settle for the lesser horror?

Urist McDepravity

  • Bay Watcher
    • View Profile
Re: What programming language?
« Reply #54 on: May 14, 2010, 07:23:30 pm »

I really need to branch out my programming; I haven't ever even looked at ruby or haskell.
Ruby is just Python's Japanese brother. Same league feature-wise and performance-wise. Even same problems (like GIL) in their c interpreters.
Logged

madman

  • Bay Watcher
    • View Profile
Re: What programming language?
« Reply #55 on: May 14, 2010, 08:54:43 pm »

The language I'd use for for something like this would depend on what level of collaboration I was aiming for. I'd use C++ if it was a multi-person project, because it would do the job, and lots of people know it (I might even consider Java if memory use wasn't going to be a bottleneck). I'd use Haskell (or maybe Mercury) if I was doing all the coding myself and never intended anyone else to develop it. Using a functional or logical language might slow development at the start, but as the project grows, a more disciplined language means better stability, an easier time debugging (many errors show up at compile time rather than runtime) and extending things, and a _much_ cleaner way of dealing with complex data structures.
Logged
Quote from: bluea
Compilers are Dwarves with the beards abstracted away.
They can pull completely amazing maneuvers, yet manage to die of thirst in the river.

catsplosion

  • Bay Watcher
    • View Profile
Re: What programming language?
« Reply #56 on: May 14, 2010, 11:27:54 pm »

It's up to you, as a developer, when your errors will show themselves; unit testing is one way, and neat little tools like Toady's arena are another.  Very simple errors will be caught by a compiler, but they'll rarely go unnoticed by a capable programmer for long.  I don't think I've lost more than an hour or two in every hundred to tracking down bugs caused by typos (in languages without declarations) and I've certainly gained more than that by not feeling constrained by declarations.  It's all a matter of style and self-discipline in the end, even in C.  (It's amazing what you can get away with.)

As for C and C++, I personally recommend C -- not because it's simpler or smaller than C++, but because it's a completely different language.  When you do learn C++, you just keep that in mind.  The similarities are all superficial.  Bjarne Stroustrup has no more right to declare his language the one true successor to C than anyone else has (although Ritchie, who arguably has that right, has now written Go -- just saying.)  And it doesn't matter, either.  C++ stands on its own merits, for its own purposes.  I just prefer using C for the guts and an embedded language like Lua for most of the program logic (I've tried several, and I'll try Chibi-scheme soon).
Logged

Leperous

  • Bay Watcher
    • View Profile
Re: What programming language?
« Reply #57 on: May 15, 2010, 07:21:51 am »

Hey Baughn, if I wanna get into Haskell game programming, what OpenGL wrapper/bindings/libraries should I use? It looks like a cool language, but I don't wanna waste my time on an out-dated or silly subsystem.
I'm glad you asked this - wish I knew that Fortran had similar OpenGL I/O capabilities before I wasted days on fancy-schmancy terminal output, now I can make my own badly-working DF/DK clone :)
Logged

NoahTheDuke

  • Bay Watcher
    • View Profile
Re: What programming language?
« Reply #58 on: May 15, 2010, 08:04:06 am »

One caveat, though: You really want to do this on linux or, failing that, os x. Haskell *works* on windows, but it takes extra effort; you don't want to spend time figuring that out at the same time as you're learning haskell.

Oh, and get an IRC client so you can hang out at #haskell on irc.freenode.net. We're very friendly. You can talk to me there, too. ;)
Man, if I had a linux box, I would be all over that. Sadly, I'm stuck with a pos XP machine. I'll see what I can do. :'-(

Noah
Logged

Leperous

  • Bay Watcher
    • View Profile
Re: What programming language?
« Reply #59 on: May 15, 2010, 08:48:19 am »

Dual boot.

https://help.ubuntu.com/community/WindowsDualBoot

(i.e. if you want Ubuntu, make a CD/USB stick and just boot off that to install)
Logged
Pages: 1 2 3 [4] 5 6 7