Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 13 Jul 2005
Offline Last Active Sep 28 2015 11:09 AM

#5108368 Behold! The compiler which compiles itself(*)

Posted by on 10 November 2013 - 05:37 PM

From the website, emphasis mine:

  • Programming shouldn't suck. This underlies all other principles of the language.
  • Make it easy to do the right thing, and hard to do the wrong thing.
  • Get out of the programmer's way as much as possible.
  • Repeating yourself and stating the obvious are both equally grave sins.
  • Conventional modes of thought only deserve to live insofar as they enhance productivity.
  • Provide escape hatches to permit things that are gross but necessary.

And yet, the language is not a Lisp! Something is wrong here...

#5076304 99 Bottles Of Beer Challenge With Least Amount Of Characters ?

Posted by on 09 July 2013 - 02:49 AM

243 with Clojure. It's hard because every kind of operator call requires parens. tongue.png

((fn f [i]
     (let [b " bottle" o " of beer" w " on the wall" p println s str
           t "\nTake one down and pass it around, " m "o more" d \.
           j (dec i) q (= 2 i) a (s b \s o) l "\n" h ", "]
       (p (s i a w h i a d
          t j b (if q "" \s) o w d l))
       (if q
         (p (s 1 b o w h 1 b o d
            t \n m a w d
            l l "N" m a w h \n m a d
            l "Go to the store and buy some more, 99" a w d))
         (f j)))) 99)

#5062293 Breadth vs. Depth?

Posted by on 16 May 2013 - 09:04 AM

But by learning more languages the depth of your knowledge will increase in Python too. You can't become an expert at Python without knowing other languages.

#5061918 having a hard time learning C++

Posted by on 14 May 2013 - 05:27 PM

I'm surprised nobody mentioned The Famous C++ FAQ - http://www.parashift.com/c++-faq/


Over the years, I fond it to be an invaluable resource to refresh the knowledge (before an Interview) and connect all dots - with only a few lines/paragraphs of text (instead of 10 pages in some book).


Once you can answer all those questions, it will mean that you understand the design and implementation of the language, and you will be a master of C++  - of course, for that level of knowledge, you will need to go through many books - Design Patterns, STL, Template Metaprogramming, ...


I'm not sure I'd recommend Bruce Eckel's Thinking in C++ at this early stage, though. It's a pretty heavy read that is best to enjoy once you have a basic grasp on the most basic low-level C++ concepts like pointers, virtual methods and templates (and no, Java exp. doesn't really count here).


And that's before we even touch the subject of C++11....



My tip: Leave C++ and never look back. It's pure evil.

#5014846 Simple Made Easy---Best Presentation About Programming I've Ever Seen

Posted by on 27 December 2012 - 02:47 PM



I want to share a video with you guys that I think is very good. It has helped me a lot. Check it out!



After I watched that video, I thought back to some problems I've had in the past, and found that almost all problems in programming boils down to things being complected. I thought we could discuss simplicity, as defined in the video. Rich gives a good explaination of what simplicity is, but it's not always easy to see it when you encounter it. What are some instances of complexity you have encountered or struggled with? Do you have any design techniques that yield simple systems?


Btw, Clojure is a great starting point if you want to build simple systems.

#4998439 beginning C++ game programming

Posted by on 07 November 2012 - 09:39 AM

what do you find the best if I want in the future go for 3d games pc and console?? C++ or java?

It doesn't matter so much. You will probably need years of experience before you can make the games you want to make. And in that time you can and should learn a few different languages. I'd say start with Python, because it is way easier to get started with. If you like programming at all you can learn a new language later, when you know more.

#4997756 So I've learned C...

Posted by on 05 November 2012 - 04:16 PM

Man. I love you guys so much. No matter what questions I throw out there, I always get a mass of intelligent people such as yourselves giving me your two-cents and leading me on to be a better programmer. I can't thank you guys enough for all of the patient guidance you guys have provided me within the last month-or-less of me being a member on this forum. I really hope that I can pay you guys back some how, be it some free-lance programming or even some sensual serenading (I was a music major before i switched to computers ;D).

As it stands now, I do believe I'll pick up Java as I'm learning more of c. I'm gonna continue to study C and maybe mess around and develop a bit of a Interactive Fiction style program game that's easy to go through and run but has some complexities that make the program more efficent.

But a curious question that has been bugging me for the last few months is this;

Is there a way to blend languages together? I had a recent conversation with a new found friend of mine, not a half hour ago (Mind you, I'm sitting in the student center at my local community college enjoying a nice, tachicardia-enducing energy drink) who spoke of ASP.net . He said that in the language they use a lot of C#. I responded "Do I need to learn C# to learn asp?" and he said firmly, "ASP is a language on it's own... It's very hard to explain."

So... yeah. I'm a bit confused as to his response, so I shall ask you, my fellow quick-witted, ingenious, and handsome bretheren...

Is there a way to use one programming language in another programming language? Such as being able to write C in Java... etc. etc.

And please do explain more about what he meant with ASP.

I'm not an expert on this, so some of what I say might be a little bit wrong. But, it is possible. How hard it is depends on which languages you want to mix, and how. I'm not sure exactly what you mean by "blend", but...

Some languages support other "embedded" languages. For example, in Perl you can mix in shell scrip code in the Perl code, and in some languages it's easy to mix in database query code like SQL. It is not that common, but some languages were designed with this in mind.

It's also possible to work in one language and use libraries written in other languages. It's relatively easy to do this between assembly, C, and C++. And it is easy to do it if the languages run on the same virtual machine/platform (.NET or Java Virtual Machine). Mixing Java with C is possible, but trickier and not something you usually do.

One can also have different subsystems that are written in different languages, and run on different platforms or even computers, just talk to each other over some network protocol.

C# and ASP.net both run on Microsoft's .NET platform, so it's easy to share libraries and such, but they are different languages, with different syntax, etc.

#4997602 So I've learned C...

Posted by on 05 November 2012 - 09:36 AM

Learning a new language is almost never a bad idea. And I agree that it would not hurt to know an object-oriented language like Java or C#. I agree with Lauris Kaplinski that C++ might be a little bit too familiar so you might learn less from it. However, there are other good and interesting languages out there to learn. I personally think OOP is way, way overrated, and I absolutely hate Java, C++ and C#. Some languages you might want to try: Haskell, Erlang, Lisp (Scheme, Clojure, Common Lisp), Ruby, Python, Go, Prolog. But, you might also want to just stick with C for now, and do a bigger project, like a small game; maybe a simple platformer or some sort of puzzle game.

I've heard many stories that Learning C or C++ as your first language is not exactly the best thing to do since the learning curve can be very steep for some, but I've had no qualms with it. Maybe I'm an exception? Or maybe I don't quite understand it as well as I think.

I think this (the bold part) is the case. Not that you show any particular signs of misunderstanding; you just seem so new to it that I don't think you realize what you don't know. Are you comfortable with pointers, memory management, recursion, data structures, etc?

It also doesn't hurt to learn some computer science theory (which you might wanna do if you want to make super fast game engines). Do you know about hash tables, regular expressions, graph algorithms like breath-first-search, sorting algorithms, dynamic programming, complexity analysis?

I think it might be best to stick with C a little bit longer, so that when you learn new languages later you can appreciate the differences more. And you might want to read up on some theory and such on the side, if you are interested.

Lastly, and I almost didn't write this because it seems so obvious now (I started 8 years ago): Programming is so much more than knowing languages. Besides the things I've mentioned, there is also the skill of good program/code design. I mean writing well-structured, maintainable, reusable, flexible, short, simple, correct and safe code. If you always think hard about the code you are writing, like "Could this be done better?", "Are there problems that might arise later with this?", etc. you will speed up your learning process. Reading books, blogs, and watching presentations can also help a lot.

#4954329 Learning Game Design

Posted by on 30 June 2012 - 10:09 AM

I'm a programmer. I want to make games.

I'm not looking to "break into the industry". I'm planning on making the game with a friend. In fact I have already started. I have basic networking, attacking, monsters, respawning, and a few other stuff done. I'm not going to make another game.

The trouble is in trying to answer a post based on what is written, it becomes very difficult to provide pertinent information if the original premise gets recanted or changed substantially.

Edit: On reading this through again: Are you simply stating something along the lines of "Having started this game I am working on - I am not going to stop and do another game - but I still plan on making more games in the future after this particular project is complete?" If so ignore my above comment, specifically though part of the recommendation for checking the Breaking into the industry and Tom Sloper's website is that it led to things like http://www.sloperama...ce/lesson13.htm which was relevant to your initial post.

I should maybe have said "I want to make a game." But I didn't think the cardinality would matter. What I mean by "I'm not looking to break into the industry" is simply that I'm not looking to join an established company. I want to make a game on my own. And perhaps more games once the first one is done.

I have basic networking, attacking, monsters, respawning, and a few other stuff done.

You have a game idea. You have established some game elements.

  • What is it specifically that you are trying to understand? If it is simply individual mechanics such as class balance - if so then in some ways it is easier to create multiple posts each simply specifying one idea/problem and removing anything extraneous to the communication of that idea/problem.
  • Do you already have an over-arching game design in place? Given that you have already begun work on this I can only assume that you must have at least some structure to which you are already working to or are you simply creating elements with no real place defined beyond "this game will need this component".
A decent article that may provide you with some insight might be of help

To be honest though what I would ask you for is more information specific to the purpose of your needs.

Yes, perhaps it is easier to make more specific questions.

And yes, I have an over-arching design in place. I know in my head what I want. And I also have a design document where I have written down key elements to the design.

I'm asking for tips, maybe books and articles, that tell me how to go about designing game rules, mechanics that are fun, balance, etc., i.e. insights for the game design process.

I asked this broad question, because I was thinking: If someone had a similar broad problem with programming, and they basically said "I'm a beginner and I want to get better." then I would have several suggestions, like "read The Pragmatic Progammer, read Structure and Intrepretation of Computer Programs and learn a functional programming language, make sure you embrace recursion..." etc.

I'll take a look at the article.

One particular problem that I have is designing spells and abilities for the playable classes. I want them to be balanced; if any two fight eachother, they should both have a not-too-small set of viable options in every situation. But at the same time the classes are supposet to have significant differences. Again: Are there some techniques, principles or guidelines for how to go about designing somehing like this? Or is just trial-and-error? I mean, experience must certainly help, and some experienced game designer must have written down techniques that work well.

Some threads that may provide insight into the issues you are dealing with:

These seem very relevant. Thank you!

#4954006 Learning Game Design

Posted by on 29 June 2012 - 11:18 AM


I'm a programmer. I want to make games. I've played games for over 15 years. Although I can tell a good game from a bad one, I've come to realize that that is not enough to actually come up with a good game in the first place.

I want to learn game design. What I mean by game design is the core rules and mechanics of the game. I don't mean character design, story telling, or any of that. Personally, I don't particularly care for stories in games.

I've played some board games recently, like Settlers of Catan, Kill Dr. Lucky, Puerto Rico, etc. and I've sort of, just in my head, tried to come up with my own board game. But I don't even know where to start. There must be some basic principles or guidelines or something that one can follow to get started. I took board games as an example because they are almost purely rules and game mechanics.

But the game I am planning on implementing is an online rpg. Kind of like an MMORPG, but in a smaller scale---I'm not delusional, I think. This is, in my opinion, an easier task, game design wise, than to come up with a new boad game. Just copy what works in other MMORPGs and your set, right? But, I have this feeling that I'm missing out on something. I want to do better, something unique.

One particular problem that I have is designing spells and abilities for the playable classes. I want them to be balanced; if any two fight eachother, they should both have a not-too-small set of viable options in every situation. But at the same time the classes are supposet to have significant differences. Again: Are there some techniques, principles or guidelines for how to go about designing somehing like this? Or is just trial-and-error? I mean, experience must certainly help, and some experienced game designer must have written down techniques that work well.

Any tips?