Author Topic: New language  (Read 41478 times)

miki151

  • Rogueliker
  • ***
  • Posts: 264
  • Karma: +0/-0
    • View Profile
Re: New language
« Reply #15 on: June 02, 2013, 04:29:28 PM »
Which features did you think ruined the language?
KeeperRL, Dungeon Keeper in roguelike style:
http://keeperrl.com

RylandAlmanza

  • Newcomer
  • Posts: 17
  • Karma: +0/-0
    • View Profile
    • Email
Re: New language
« Reply #16 on: June 02, 2013, 10:33:07 PM »
Haskell's a lot of fun, but there aren't a lot of libraries for game development. It was easy enough on linux, but getting the sdl and ncurses ports to work on windows is a pain. I've gotten a couple very simple roguelike demos done in haskell, though.

Quendus

  • Rogueliker
  • ***
  • Posts: 447
  • Karma: +0/-0
  • $@ \in \{1,W\} \times \{1,H\}$
    • View Profile
    • Klein Roguelikes
Re: New language
« Reply #17 on: June 03, 2013, 12:17:59 AM »
If you want my opinion about C++11 I think they ruined the language while trying to be modern. Programming languages are strange, because they are developed by non-humans (engineers and such).
I like the C++11 features. When I was learning C++ I would often google problems that had no satisfactory solution, such as
  • Declaring and initialising a container object without adding elements individually or including a magic number
  • Portable threading
  • Passing functions as arguments without fiddling with function pointers, functors, etc.
  • Prewritten and optimised random number generators with more useful distributions than a uniform spread over the range of a signed int
Often the "solution" would be to include Boost in the project, which was not a dependency I wanted. C++11 is gradually fixing these issues in a standardised way (and the sooner these features actually get implemented, the better).

Xecutor

  • 7DRL Reviewer
  • Rogueliker
  • *
  • Posts: 263
  • Karma: +0/-0
    • View Profile
Re: New language
« Reply #18 on: June 03, 2013, 03:10:01 AM »
If you want my opinion about C++11 I think they ruined the language while trying to be modern. Programming languages are strange, because they are developed by non-humans (engineers and such).
Hm. What exactly you don't like in C++11?
auto is awesome.
for(auto v:cnt) is beyond awesome.
initializer list is very very useful.
move semantics. well, it takes some time to fully understand it, but in the end it is powerful optimization feature.
variadic templates? hm. this one can blow unprepared mind away. and it takes significant amount of time and effort to fully comprehend it. but this is actually superior feature that allows some really advanced tricks.
the only feature that I think looks ugly is closures syntax.
this:
Code: [Select]
[](){}()
is now valid C++ statement.
but this ugly syntax is necessary evil, required to keep backward compatibility.
there aren't many punctuation combinations available in C++ to be used.

TheCreator

  • Rogueliker
  • ***
  • Posts: 370
  • Karma: +0/-0
    • View Profile
    • Fame
    • Email
Re: New language
« Reply #19 on: June 03, 2013, 07:33:00 AM »
I'm completely satisfied with good old C++. There are some missing features, but they aren't all in all that important and most of them is coming with C++11 (which I don't use yet as my ancient hardware wouldn't stand new Visual Studio's demands for computational power). C++ is a terrible language for newcomers, but with years of experience typical problems disappear and you begin to actually like programming in C++. Of course, this happens to other languages, too, but I think it is not common for a programming language to take as long as 8 years to become proficient in (that was my case). I agree that it can be frustrating to find out that so many years of experience has not given such proficiency to you. Maybe I'm wrong, but I think this is the reason why you're looking for a "hobby" language.
Fame (Untitled) - my game. Everything is a roguelike.

miki151

  • Rogueliker
  • ***
  • Posts: 264
  • Karma: +0/-0
    • View Profile
Re: New language
« Reply #20 on: June 03, 2013, 08:36:36 AM »
Some new features that I like:
- lambda expressions, ever since I learnt functional programming, I missed them in C++
- initializer_lists, makes code much cleaner, and you can do some clever things with them

The big winner are range based loops, for me. I always hated typing in the traditional for loop, especially when iterating over containers. I used to use macros, like FOREACH(it, container) or FOR(var, from, to).

I actually use range based loops for normal integer loops now. Like so:
for (int i : Range(5, 10))
for (int i : All(container)) // iterates over the container, but you can use the index now
for (Vec2 v : Rectangle(10, 10, 20, 20)) // substitutes a double loop, Vec2 and Rectangle are helper classes that I use everywhere
« Last Edit: June 03, 2013, 08:42:10 AM by miki151 »
KeeperRL, Dungeon Keeper in roguelike style:
http://keeperrl.com

TheCreator

  • Rogueliker
  • ***
  • Posts: 370
  • Karma: +0/-0
    • View Profile
    • Fame
    • Email
Re: New language
« Reply #21 on: June 03, 2013, 09:42:56 AM »
- lambda expressions, ever since I learnt functional programming, I missed them in C++

I never learnt functional programming, but I'm missing lambdas anyway. Using STL is much harder without them (or, at least, much more awkward).

Quote
The big winner are range based loops, for me. I always hated typing in the traditional for loop, especially when iterating over containers. I used to use macros, like FOREACH(it, container) or FOR(var, from, to).

I hate typing loops, too, but there are better ways than macros to avoid it. I used to have a plugin for Visual Studio that would automatically complete the loop if you typed "for". You only needed to type a name for the counter variable and maximum value. There was also a special variant for iterating containers. Very good stuff, that plugin, but it wasn't free and generally plugins only work in commercial versions of VS, which is probably a big drawback. The other way is to avoid using loops at all. STL algorithms usually do a better job than any loop you could write explicitly. For some reason I dislike range-based loops - they are just syntax sugar that saves you some typing, they don't make you write better or even clearer code.
Fame (Untitled) - my game. Everything is a roguelike.

miki151

  • Rogueliker
  • ***
  • Posts: 264
  • Karma: +0/-0
    • View Profile
Re: New language
« Reply #22 on: June 03, 2013, 12:02:02 PM »
They do make you write better and clearer code, besides making your fingers less tired. The typical bug I always made was:

for (int i = 0; i < n; ++i)
  for (int j = 0; j < m; ++i) {
    ...
  }
KeeperRL, Dungeon Keeper in roguelike style:
http://keeperrl.com

TheCreator

  • Rogueliker
  • ***
  • Posts: 370
  • Karma: +0/-0
    • View Profile
    • Fame
    • Email
Re: New language
« Reply #23 on: June 03, 2013, 12:05:24 PM »
They do make you write better and clearer code, besides making your fingers less tired. The typical bug I always made was:

for (int i = 0; i < n; ++i)
  for (int j = 0; j < m; ++i) {
    ...
  }

I once started to use 'k' for the inner loop and this bug has never happened to me again ;).
Fame (Untitled) - my game. Everything is a roguelike.

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: New language
« Reply #24 on: June 03, 2013, 02:20:58 PM »
Hm. What exactly you don't like in C++11?

It's too not-C++.

And I don't know what lambda is.
« Last Edit: June 03, 2013, 02:23:15 PM by Krice »

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: New language
« Reply #25 on: June 03, 2013, 02:22:28 PM »
I once started to use 'k' for the inner loop and this bug has never happened to me again ;).

Yes, use better variable names. Usually in loops like that you would use x,y coordinates so why not use them as variable names anyway? Or something that actually tells what those loops are for.

requerent

  • Rogueliker
  • ***
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: New language
« Reply #26 on: June 03, 2013, 02:59:54 PM »
I'm completely satisfied with good old C++. There are some missing features, but they aren't all in all that important and most of them is coming with C++11 (which I don't use yet as my ancient hardware wouldn't stand new Visual Studio's demands for computational power). C++ is a terrible language for newcomers, but with years of experience typical problems disappear and you begin to actually like programming in C++. Of course, this happens to other languages, too, but I think it is not common for a programming language to take as long as 8 years to become proficient in (that was my case). I agree that it can be frustrating to find out that so many years of experience has not given such proficiency to you. Maybe I'm wrong, but I think this is the reason why you're looking for a "hobby" language.


Yea, no- It's just C++.

joeclark77

  • Rogueliker
  • ***
  • Posts: 90
  • Karma: +0/-0
    • View Profile
Re: New language
« Reply #27 on: June 05, 2013, 06:05:10 PM »
I will second Python.  It's very easy to learn, quick to code, and has some interesting differences from other languages.  I like that it requires precision but without a lot of extraneous typing (for example, the indentation of loops and other code blocks must be consistent, but you don't need lots of "{}" symbols that you'll lose track of).  It's also the best interactive/scripting language I've seen in terms of running quickly and not blowing up your RAM.  By using C++ libraries you can optimize the speed quite well.

tuturto

  • Rogueliker
  • ***
  • Posts: 259
  • Karma: +0/-0
    • View Profile
    • pyherc
Re: New language
« Reply #28 on: June 05, 2013, 06:22:37 PM »
I think Python is really beautiful language that is enjoyable to work with. Granted, it took me awhile to start appreciating the language; however, after that point was crossed there was no returning.

The biggest complaint I have about it is the slow migration from 2.x to 3.x. Progress is made on that every day though and I have managed to switch to 3.x completely, so I don't anticipate it taking forever.
Everyone you will ever meet knows something you don't.
 - Bill Nye

requerent

  • Rogueliker
  • ***
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: New language
« Reply #29 on: June 05, 2013, 07:29:00 PM »
Just FYI- Python really is a utility language. Good for hobby projects, but it has pretty low performance compared to something like lua, which is also elegant in very similar ways. Lua is also industry standard for games, so... I'd recommend checking it out.