101 reputation
4
bio website
location
age 17
visits member for 1 year, 10 months
seen yesterday

Nov
12
comment Big O notation allocate array of N element
Non-continuous block is of course a contradiction. But I hope you know what I mean.
Nov
12
comment Big O notation allocate array of N element
@delnan Sorry, I could have stated more clearly that the point of my comment was that the complexity of allocation isn't useful, exactly because of the reasons you give. I only wanted to illustrate the question was very framework and OS dependent. Of course an array is continuous to the owning process but IIRC memory address remapping hardware exists to make it possible to allocate a non-continuous block while seemingly giving a continuous block to the requesting process.
Nov
12
comment Big O notation allocate array of N element
It really depends on the allocating. For example, if it is C or similar the OS just needs to find enough memory. If it needs to be continuous, it is O(n) with n being the amount of gaps in memory, regardless of the length of your array. If it can manage with non-continuous memory, it is O(n) with n as the size of the memory you want to allocate. In case of non-native code, it depends completely on the framework/VM.
Sep
26
comment Why do most programming languages have special keyword or syntax for declaring functions?
I think it is because a function or method simply is not just another named entity. In functional languages, they are (you can pass them around etc.) but in other languages (like Java) a function or method is something entirely different from a simple variable and cannot be treated as such (I admit Java 8 kind of weakens this statement), so it makes sense to define functions/methods differently, since they behave differently.
Sep
6
awarded  Commentator
Sep
6
comment What does this function do?
Have a look at this: programmers.stackexchange.com/questions/25052/…
Aug
26
comment Is method overloading anything more than syntactic sugar?
Like this: getPayment :: PaymentInfo -> a getPayment CashOnDelivery = error "Should have been paid already" getPayment (Adress addr) = -- code to notify administration to send a bill getPayment (UserInvoice cust) = --whatever. I took the data type from a Haskell tutorial and have no idea what an invoice is. I hope this comment is somewhat understandable.
Aug
26
comment Is method overloading anything more than syntactic sugar?
Given a datatype like data PaymentInfo = CashOnDelivery | Adress String | UserInvoice CustomerInfo you can pattern match on the type constructors.
Aug
26
comment Is method overloading anything more than syntactic sugar?
Haskell is a good example of why operator overloading is not syntactic sugar, but I think a better example would be deconstructing an algebraic data type with pattern matching (something that is as far as I know impossible without pattern matching).
Jul
19
comment Is OOP hard because it is not natural?
Sounds like you would enjoy giving Lojban a try.
Mar
12
comment Version number as a part of a file name
@sawa Suppose jQuery.com/jquery.js is the URL of the latest version and that's what your code refers to. What would happen if jQuery would publish a radical update? Of course, you'd link to your own local copy but I think this is what ratchet freak means
Feb
19
awarded  Editor
Feb
18
awarded  Citizen Patrol
Jan
20
awarded  Supporter