• Lucid Dreaming - Dream Views




    Page 2 of 3 FirstFirst 1 2 3 LastLast
    Results 26 to 50 of 56
    1. #26
      Banned
      Join Date
      May 2007
      LD Count
      Loads
      Gender
      Location
      Digital Forest.
      Posts
      6,864
      Likes
      386
      Quote Originally Posted by ninja9578 View Post
      You misread my quote. I meant that the number of games using Direct3d is declining compared to OpenGL. I wasn't comparing languages. OpenGL is just better suited for C, DX is better for OOP.
      Oic. I haven't used OGL w/ C before. I usually use C++ w/ AllegroGL and Classes.

    2. #27
      dsr
      dsr is offline
      我是老外,可是我會說一點中文。
      Join Date
      Nov 2006
      Gender
      Location
      my mind
      Posts
      374
      Likes
      1
      Most performance-critical code is written in lower level languages like C or C++, but Abra's question was where she should start. I've said this before and I'll say it again: I highly recommend Python as a first language. Thanks to this excellent tutorial, you can learn the syntax in a day or two. Python is very easy to learn and use, and it produces much clearer, more consistent, more concise, and more bug-free code than any other language (with the possible exception of Haskell) that I have ever used. Python also has a larger application domain than almost any other language. While you could just use it as a replacement for shell scripts, you can also use Python for desktop applications, games, server-side scripting, and web development. The only real downside of Python is that performance sometimes suffers due to the lack of a real compiler, but there are many remedies. The fact that Python is interpreted directly from the source files also means that the development time is drastically shorter than that of a language like Java, C, or C++. Eric Raymond's "Why Python" shows that even expert programmers use the language.

    3. #28
      Banned
      Join Date
      May 2007
      LD Count
      Loads
      Gender
      Location
      Digital Forest.
      Posts
      6,864
      Likes
      386
      CLI == The **** to me.

      C is a great place to start.

    4. #29
      Your cat ate my baby Pyrofan1's Avatar
      Join Date
      Nov 2006
      Gender
      Posts
      720
      Likes
      3
      he fact that Python is interpreted directly from the source files also means that the development time is drastically shorter
      how does the fact that a language is interpreted make development time shorter? if i remember right Brainfuck is interpreted, but that doesn't make it's dev time shorter.

    5. #30
      Eprac Diem arby's Avatar
      Join Date
      May 2006
      LD Count
      i/0
      Gender
      Location
      Canada
      Posts
      1,957
      Likes
      52
      Quote Originally Posted by dsr View Post
      it produces much clearer, more consistent, more concise, and more bug-free code than any other language (with the possible exception of Haskell)
      Ah, Haskell. The language that the real psychopaths men use.

    6. #31
      dsr
      dsr is offline
      我是老外,可是我會說一點中文。
      Join Date
      Nov 2006
      Gender
      Location
      my mind
      Posts
      374
      Likes
      1
      Quote Originally Posted by Pyrofan1 View Post
      how does the fact that a language is interpreted make development time shorter? if i remember right Brainfuck is interpreted, but that doesn't make it's dev time shorter.
      Python is interpreted directly from the source code, which means that there is no compile phase of the development cycle. With a language like Java, which requires compilation to bytecode before running with the Java interpreter, or a language like C++, which compiles directly to machine language, it can take minutes or hours (in the more extreme cases) to test any changes you make to the source code. It's a tradeoff between development time and execution time.

      If memory serves, by the way, Brainfuck just maps to C code. It has nothing to do with interpreted scripting languages.

    7. #32
      Banned
      Join Date
      May 2007
      LD Count
      Loads
      Gender
      Location
      Digital Forest.
      Posts
      6,864
      Likes
      386


      You are sadly misinformed.

      Interpreted languages are known for their slowness. Just look at BASIC. Python is only different in that it can be used for large projects, but is still highly inferior to it's lower-level ancestors.

    8. #33
      dsr
      dsr is offline
      我是老外,可是我會說一點中文。
      Join Date
      Nov 2006
      Gender
      Location
      my mind
      Posts
      374
      Likes
      1
      Quote Originally Posted by Seismosaur View Post


      You are sadly misinformed.

      Interpreted languages are known for their slowness. Just look at BASIC. Python is only different in that it can be used for large projects, but is still highly inferior to it's lower-level ancestors.
      In what way am I misinformed? I stated that software written in a higher level language is faster to develop while software written in a lower level language performs faster. And please don't say that language x is inferior to language y without establishing specific criteria. Python is obviously better than, say, C++ for certain tasks and worse for others.

    9. #34
      Banned
      Join Date
      May 2007
      LD Count
      Loads
      Gender
      Location
      Digital Forest.
      Posts
      6,864
      Likes
      386
      Actually, I find Python harder to develop with. There isn't just an IDE to write the code then compile it to whatever you need. 'Tis why I prefer C/C++/C--/C+=; Quicker.

    10. #35
      Your cat ate my baby Pyrofan1's Avatar
      Join Date
      Nov 2006
      Gender
      Posts
      720
      Likes
      3
      If memory serves, by the way, Brainfuck just maps to C code.
      Nope, While brainfuck can be compiled (which can be said about every programming language) it is mostly an interpreted language.
      or a language like C++, which compiles directly to machine language, it can take minutes or hours (in the more extreme cases) to test any changes you make to the source code. It's a tradeoff between development time and execution time.
      i've never heard anyone include compile time with dev time.

    11. #36
      dsr
      dsr is offline
      我是老外,可是我會說一點中文。
      Join Date
      Nov 2006
      Gender
      Location
      my mind
      Posts
      374
      Likes
      1
      Quote Originally Posted by Pyrofan1 View Post
      Nope, While brainfuck can be compiled (which can be said about every programming language) it is mostly an interpreted language.
      No, all eight characters have a one-to-one correspondence with specific C code (see here). Brainfuck "interpreters" exist, but those are just programs that convert brainfuck code into the equivalent C, which would then be passed through a C compiler to produce an executable binary.

      Quote Originally Posted by Pyrofan1 View Post
      i've never heard anyone include compile time with dev time.
      Then you've never had a conversation about compile time and development time. By development time, I mean the time it takes to development the software. In order to test code, it must be compiled, and that can be an inconvenience. Large software programs can take an hour or so to compile, and that's not so pleasant if you're just fixing a bunch of syntax errors. The whole point of an interpreted language like Python, Ruby, or Perl is to save the developer time at the expense of execution speed. For most tasks, speed of development is more important than speed of execution, but performance is critical for certain kinds of programs. Similar arguments can be made in debates about static vs. dynamic typing, by the way.

      Let's try to get away from this rather pointless debate (there are always going to be pros and cons of compiled languages and pros and cons of interpreted languages). The point of my original post was that Python is an excellent first language (see that post), not that everyone should use it for everything (although I've read about some people who do...).

    12. #37
      Your cat ate my baby Pyrofan1's Avatar
      Join Date
      Nov 2006
      Gender
      Posts
      720
      Likes
      3
      No, all eight characters have a one-to-one correspondence with specific C code
      that's like saying that because assembly and machine code have a one-to-one conversion they are the same.
      Brainfuck "interpreters" exist, but those are just programs that convert brainfuck code into the equivalent C, which would then be passed through a C compiler to produce an executable binary.
      that would be called a compiler, not an interpreter.
      if you want a brainfuck interpreter here's one
      Code:
      void parse_brainfuck(char *code)
      {
          unsigned int ptr=0;
          unsigned char memory[1000];
      
          while(*code!=NULL)
          {
              switch(*code)
              {
                  case '>':
                  ptr++;
                  code++;
                  break;
      
                  case '<':
                  ptr--;
                  code++;
                  break;
      
                  case '+':
                  memory[ptr]++;
                  code++;
                  break;
      
                  case '-':
                  memory[ptr]--;
                  code++;
                  break;
      
                  case '.':
                  putchar(memory[ptr]);
                  code++;
                  break;
      
                  case ',':
                  memory[ptr]=getch();
                  code++;
                  break;
      
                  case '[':
                  if(memory[ptr]==0)
                  {
                      while(*code!=']') code++;
                      code++;
                      break;
                  }
                  else
                  {
                      code++;
                  }
                  break;
      
                  case ']':
                  if(memory[ptr]!=0)
                  {
                      while(*code!='[') code--;
                      break;
                  }
                  else
                  {
                      code++;
                  }
                  break;
      
                  default:
                  break;
              }
          }
      }
      you can also do one in assembly (and pretty much every other language), but i don't feel like typing that much

    13. #38
      dsr
      dsr is offline
      我是老外,可是我會說一點中文。
      Join Date
      Nov 2006
      Gender
      Location
      my mind
      Posts
      374
      Likes
      1
      Quote Originally Posted by Pyrofan1 View Post
      Code:
      void parse_brainfuck(char *code)
      {
          unsigned int ptr=0;
          unsigned char memory[1000];
      
          while(*code!=NULL)
          {
              switch(*code)
              {
                  case '>':
                  ptr++;
                  code++;
                  break;
      
                  case '<':
                  ptr--;
                  code++;
                  break;
      
                  case '+':
                  memory[ptr]++;
                  code++;
                  break;
      
                  case '-':
                  memory[ptr]--;
                  code++;
                  break;
      
                  case '.':
                  putchar(memory[ptr]);
                  code++;
                  break;
      
                  case ',':
                  memory[ptr]=getch();
                  code++;
                  break;
      
                  case '[':
                  if(memory[ptr]==0)
                  {
                      while(*code!=']') code++;
                      code++;
                      break;
                  }
                  else
                  {
                      code++;
                  }
                  break;
      
                  case ']':
                  if(memory[ptr]!=0)
                  {
                      while(*code!='[') code--;
                      break;
                  }
                  else
                  {
                      code++;
                  }
                  break;
      
                  default:
                  break;
              }
          }
      }
      I stand corrected.

    14. #39
      Member Identity X's Avatar
      Join Date
      Mar 2004
      Gender
      Posts
      1,529
      Likes
      7
      Quote Originally Posted by Seismosaur View Post
      Actually, I find Python harder to develop with. There isn't just an IDE to write the code then compile it to whatever you need. 'Tis why I prefer C/C++/C--/C+=; Quicker.
      You obviously haven't done much searching for a decent Python IDE. Actually, as far as I'm aware even python-mode in your standard copy of XEmacs (and GNU Emacs too?) has that option.

      And besides, if you want a Python-like language that compiles to executable in one mouse press, download Boo and SharpDevelop.

      Boo is the clearest and most sensible language I've come across, and compiles straight to CLI (and thus an exe file).
      Last edited by Identity X; 01-25-2008 at 03:36 PM.

    15. #40
      Banned
      Join Date
      Jun 2006
      Posts
      547
      Likes
      0
      Quote Originally Posted by Pyrofan1 View Post
      avoid assembly unless you want to go into really hardcore hacking, device drivers, os creation or intense game engines. while assembly is easy to learn it takes a lot more code than any other language.
      for example
      this C code
      Code:
      aFunction((a*b/c),c*c);
      would look like this in assembly
      Code:
      mul $c, $c
      push $c
      mul $a, $b
      mov $a, &#37;eax
      idiv %eax, $c
      push %eax
      call aFunction
      Assembly is one of the best languages you can learn. Even if you dont program in it, you learn more from assembly than any other language.

      Quote Originally Posted by Seismosaur
      Interpreted languages are known for their slowness. Just look at BASIC. Python is only different in that it can be used for large projects, but is still highly inferior to it's lower-level ancestors.
      Actually speed is rarely an issue today except in the most intensive programs. Most applications are a breeze for modern processors to run. That's why languages like Python, which are easy to use, are becoming more favourable.
      Last edited by M-Cat; 01-25-2008 at 03:37 PM.

    16. #41
      Member Achievements:
      1 year registered Veteran First Class 5000 Hall Points

      Join Date
      Sep 2004
      Gender
      Location
      Seattle, WA
      Posts
      2,503
      Likes
      217
      Haha I was about to mention brainfuck.

      Quote Originally Posted by Seismosaur View Post
      Actually, I find Python harder to develop with. There isn't just an IDE to write the code then compile it to whatever you need. 'Tis why I prefer C/C++/C--/C+=; Quicker.
      How does not having an IDE slow people down? I find IDE's slow me down. I'll take the command line over most IDE's any day. I can code faster with vim (if it's properly set up), and building is as simple as typing 'make' (assuming you have a good makefile hehe - I actually wrote a magic one that I never have to touch).

      Not to sound like an evangelist, but Ruby (http://www.ruby-lang.org/en/) is really neat. There's a link on the site where you can go through an interactive tutorial without having to install anything.

      If you go the C/C++ way (which is fine), check out http://cprogramming.com/ for good tutorials that take you through the basics. Good design skills and the likes will come from experience.

    17. #42
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Quote Originally Posted by M-Cat View Post
      Assembly is one of the best languages you can learn. Even if you dont program in it, you learn more from assembly than any other language.
      Agreed. It also helps with CG since [good] assembly is always the fastest, if you do really low level stuff then you will be using inline assembly.


      You must be writing some huge programs if it takes hours to compiler. I have all optimizations turned on and I've never had a program compile for more than a few minutes.

      Now I'm not writing full-size apps, but full-size apps are modulated and the modules can be compiled and tested individually, so most of the bugs are out of the system (especially something simple like syntax errors,) by the time that the modules are put together.

      How does not having an IDE slow people down?
      XCode does syntax and semantic checking on the fly so if I miss a semicolon or parenthesis it automatically yells at me. It also does debugging without writing tons of tests and can show me all of the variables when an error is encountered, which definitely speeds things up. As far as I know Eclipse, .NET, and Bloodshed all do the same. For apps with a GUI it also does drag and drop of buttons and such.


      If you're planning to go to college for CS then you should learn what is taught there. Most colleges teach C/C++/Java and sometimes VB. If you're planning on concentrating in CG then C is what will probably be used. Checking out the OpenGL Red Book might also be a nice idea, the format is the same in every language (for the most part.)
      Last edited by ninja9578; 01-25-2008 at 05:34 PM.

    18. #43
      Member Identity X's Avatar
      Join Date
      Mar 2004
      Gender
      Posts
      1,529
      Likes
      7
      Quote Originally Posted by ninja9578 View Post
      [good] assembly is always the fastest
      Yes, and the best assembly is written by GCC et al.

      I've done a course on compiler optimization and some of the techniques are astounding. Much of the code now generated by compilers is fantastic in its efficiency.
      Last edited by Identity X; 01-25-2008 at 07:54 PM.

    19. #44
      Your cat ate my baby Pyrofan1's Avatar
      Join Date
      Nov 2006
      Gender
      Posts
      720
      Likes
      3
      Assembly is one of the best languages you can learn. Even if you dont program in it, you learn more from assembly than any other language.
      i'm not bashing assembly, in fact it's my favorite language. i'm just saying it's not too useful today and if you want to get a programming job most companies won't ask you if you know assembly.

    20. #45
      Banned
      Join Date
      Jun 2006
      Posts
      547
      Likes
      0
      Well you shouldn't do something just so it looks good on your resume. Even if companies don't want it, hell, even if it's not useful at all, learning assembly will help you with in a lot of other aspects of computer science.

    21. #46
      I am become fish pear Abra's Avatar
      Join Date
      Mar 2007
      Location
      Doncha Know, Murka
      Posts
      3,816
      Likes
      542
      DJ Entries
      17
      As a follow-up, I'm now taking a course in Java, and what I've learned in C is helping. I like this stuff. Anyone know where to get me started on making shweet pixel graphics? Once we get to loops and what I like to call "getkey," I want to make me a simple game of some sort.
      Abraxas

      Quote Originally Posted by OldSparta
      I murdered someone, there was bloody everywhere. On the walls, on my hands. The air smelled metallic, like iron. My mouth... tasted metallic, like iron. The floor was metallic, probably iron

    22. #47
      Member Achievements:
      1 year registered Veteran First Class 5000 Hall Points

      Join Date
      Sep 2004
      Gender
      Location
      Seattle, WA
      Posts
      2,503
      Likes
      217
      SDL is a pretty easy way to go: http://libsdl.org

      Cross-platform, too!

    23. #48
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      I still recommend OpenGL, I know there is an API for Java. Pixel graphics means that you are directly manipulating the buffer instead of using OpenGL's primitives.

      Forget getkey, use a listener instead. GLUT has a listener built in called GlutKeyFunc(void keys())

      Again, OpenGL is best for C and other procedural oriented languages. For OOP most would use Allegro or DirectX. I've never used either, I've heard bad things about DirectX, but I've heard that Allegro was easy to use.

      EDIT: Oh, SDL uses OpenGL I guess it's a library for buffer manipulation?

    24. #49
      FBI agent Ynot's Avatar
      Join Date
      Oct 2005
      Gender
      Location
      Southend, Essex
      Posts
      4,337
      Likes
      14
      SDL (Simple DirectMedia Layer) is an API container
      Very similar to what DirectX is

      DirectX is a container,
      comprising Microsoft's Direct3D, DirectDraw, DirectInput, DirectSound, Etc. Etc.

      SDL is the same, except you can switch & swap between different "inner API's"
      A program using SDL will use Direct3D when run on Windows, and OpenGL when run of *nix, for example

      Same program, same code
      translating to different API calls depending on platform
      (\_ _/)
      (='.'=)
      (")_(")

    25. #50
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      I know what DirectX is. Technically speaking OpenGL is a package too. When most programmers say that their program uses OpenGL" they usually mean gl.h, glu.h and glut.h, usually OpenAL too. It's not quite as modulated as DirectX, but still a nice package. I wish we had something like DirectDraw

      It uses DirectX on Windows? That's strange considering that OpenGL has been (mostly) ported to Windows and completely if you use MESA. It looks like it only supports DirectX9 though. Bad news since DirectX 10 has little to none backwards compatibility.

      Looks useful though, I might have to look at it closer once I get some free time. I never found OpenGL all that difficult for most things, but things like buffer manipulation is a pain in the ass sometimes. Hence the reason that I want a DirectDraw
      Last edited by ninja9578; 03-13-2008 at 04:26 AM.

    Page 2 of 3 FirstFirst 1 2 3 LastLast

    Bookmarks

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •