Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your help!

We need 1 more developer from Canada and 12 more from Australia to help us complete a research survey.

Support our site by taking a quick sponsored survey and win a chance at a $50 Amazon gift card. Click here to get started!


Lightness1024

Member Since 06 Aug 2009
Offline Last Active Aug 28 2015 06:56 PM

Posts I've Made

In Topic: for each in: Pythonic?

05 August 2015 - 09:04 AM

 


I was wondering if each would be good if the list had various data types

If your list contains multiple, non-polymorphic datatypes, then you are doing something evil (or spent too much time in LISP).

 

Edit: just to clarify, a list containing multiple, non-polymorphic datatypes is almost impossible to operate on idiomatically. You are forced to either know the exact type and order of each element ahead of time (in which case a tuple would be more appropriate), or fallback to a chain of if insinstance(a, Foo): else: statements, which is just bad software design.

 

Certainly not. python can work on different types just like some kind of type erasure system. they are not polymorphic but some operations can apply to a whole variety of types. This is the same than working against the highest interface in OOP. In python you can do it too without any contracts.

take a look at that : http://lucumr.pocoo.org/2011/7/9/python-and-pola/

There is not even a mention of classes and inheritance and yet python can accept code that is even more powerful than multiple inheritance, because you can work against "operators" (c.f `len` example in the link). If you keep that in mind as a discipline when writing functions, you open your possible accepted types to a larger variety.


In Topic: Which version should I choice to build my ocean?

05 August 2015 - 08:43 AM

You don't want to write half a page because .... you are lazy ?

It will be tough implementing a nice ocean system if you are that lazy.

Choose, either you don't care about sharing what you do, or you care and you write your half page. Half a page is nothing, read at least the papers you linked, how many pages do they have ? how many months you think it took those researchers to do their work AND cherry on top, write about it and share it publicly ?

Meanwhile, what are you doing ?


In Topic: Default values for members in an anonymous struct inside a class

18 July 2015 - 10:34 AM

yes report quickly because its going to get out soon, and ms implementation of C++11 seems to already have enough basic bugs like that on its record.

I reported one myself. seems like they have a poor test suite, or/and just few users really using their soft.


In Topic: 54x50 tiles map searching for neighbours - takes extremely long

11 July 2015 - 07:39 PM

You're all wrong, you should use morton code (z order) for better cache coherency on adjacent cells :P


In Topic: VS 2012 express any good?

11 July 2015 - 09:36 AM

There is a major limitation in Express editions compared to Pro/enterprise/ultimate, you cannot install plugins. So no visual assist, no incredibuild, no phat studio, no global zoom, no resharper or watnot...


PARTNERS