« first day (2026 days earlier)      last day (2938 days later) » 

4:05 PM
Song! Yay!
 
@SomeGuy They did pretty good with their marketing for this new album.
 
Yeah, haha. Built up a ton of hype with their "fading away" stuff
I'm just glad the song's good
 
> Ve invented de oyal.
 
4:19 PM
I don't know what he expected
 
@rlemon Seriously, it's a bunch of college kids.
 
4:35 PM
@rlemon That went surprisingly well
 
Anyone here know of a programming language like JavaScript but with multiple inheritance? Or some way to emulate multiple inheritance through the use of quirky features such as meta-programming?
I would like to research some, don't know what to search to find something like this so I'd rather hear from experienced programmers.
 
@Krush no. You don't want either of those things.
There's a reason most languages don't support multiple inheritance.
It's almost impossible to implement well.
 
I kind of do, but perhaps for the wrong reasons, regardless of which, you know any such languages?
 
If you think you want it, you probably want multiple inheritance of behavior (rather than state), which is called a mixin or extension method. JS does support that sort of thing.
 
I know Lua but dislike it for other features... It doesn't offer multiple inheritance directly but allows you to design your own object orientation with which you can have multiple inheritance built-in, if you wish, using its meta-programming features.
 
4:39 PM
@Krush Java 8 has formal multiple inheritance of behavior (interfaces). JavaScript can do mixins and extension methods. C# can do extension methods, not sure what else.
 
@ssube I am searching for something that entrusts the user with absolute freedom in terms of multiple inheritance, which is something some languages offer, not JavaScript.
 
@Krush only C++ is dumb enough to do that
 
@ssube have you ever known any such languages, or heard about them? Even if you dislike them or their design
@ssube Every feature can be used wisely, if it can't, then the language itself is too limited
 
You need a very old or very low-level language. The newer, higher, more abstract ones simply don't support it.
@Krush No, multiple inheritance leads to the diamond problem.
There's actually a real implementation problem with trying to support it, which is part of why it's considered a bad idea.
Multiple inheritance is a feature of some object-oriented computer programming languages in which an object or class can inherit characteristics and features from more than one parent object or parent class. It is distinct from single inheritance, where an object or class may only inherit from one particular object or class. Multiple inheritance has been a sensitive issue for many years, with opponents pointing to its increased complexity and ambiguity in situations such as the "diamond problem", where it may be ambiguous as to which parent class a particular feature is inherited from if more than...
 
@ssube not always, and can be worked-around... Tbh from the experience of many C++ devs I've talked to... the diamond problem is so rare that it can be dismissed, even so there are features in C++ such as virtual inheritance where this can be fixed... And when I say multiple inheritance,
the language does not have to actually have classes, languages like ECMAScript 5 Javascript use functions to do that... like just having a constructor, yet objects can only attain inheritance through prototyping...
 
4:45 PM
@Krush not really. I've run into it a good number of times.
and when you do, it's a pain to fix, because you've screwed up the design somewhere else.
 
Well then the software design patterns that you use, and how you use them, must be different to those C++ devs
 
If your API is well-designed, multiple inheritance of state is not something you should ever need.
 
Define of state... I've been drafting a state-less programming language where inheritance still plays a vital role.
I'm just trying to find a language where I can reduce repetition the most... Most high-level programming language restrict one from doing so :S
to the far extent that I would like to do it
 
@Krush do you know the difference between interfaces and classes?
specifically, interfaces that can provide default methods
 
Yes... I've been using Java for quite some time
And that too in Java 8
Java is by far, my most fluent language, but the one I hate the most, due to the very reasons I'm seeking for a language other than javascript now
 
4:50 PM
ok, so you know Java 8's interface default methods
 
Yes
 
that's inheritance of behavior
the good kind
 
Ik
 
you can implement multiple interfaces, and because they all rely on an existing contract, you can combine them without many problems
 
user5992646
In my PHP book, in the examples, I can understand what each line does but I cannot understand how different parts of the whole code come together to complete the task. What should I do? Move on to the next lesson or just stick till I understand.
 
4:51 PM
because none of them actually store any data, they don't change the size or layout of the object
 
user5992646
each line of code.
 
now, if you were to inherit multiple classes with data, then the compiler would have to find a way to combine them, you hit the diamond problem, most optimizations break, etc
most languages have some form of inheritance of behavior, be it interfaces, contracts, mixins, extensions, whatever they call it
every modern language has or can support something along those lines and using that is A Good Thing
 
The diamond problem of death only occurs when two or more of the classes being inherited have a common base class... which, C++ can solve using virtual inheritance, and is not always the case, rarely for me actually, because I can just use other means by which to inherit the behavior I desire, without using multiple inheritance... I need it in the exceptions...
 
@Krush there are other, related problems with multiple inheritance of state without a common parent
 
And regardless, I can't just use Java for some of the good features it offers, because as I've discovered, languages are a set of many features, many of which one can like, and many of which one can dislike
 
4:53 PM
the diamond is one of the more common, but you still don't want to have C inherit both A and B, where A and B both have fields
 
Java is a language which I can't work with many features of... hence you telling me that I can use one good feature, that I'm sure I can re-discover flaws of, doesn't really bring back the desire to switch back...
 
TypeScript's typing system is a great example of allowing multiple inheritance of behavior and enforcing based on contract, rather than pre-determined state
@Krush Java is just the most accessible example of this
 
@ssube what if I phrase it this way... Do you know any programming language that allows inheritance of an object, by another object? Like a singleton, but I just mean a container object...
 
user5992646
I'm busy learning rather than chatting so I couldn't come online, really.
 
JS can support the same thing, but it's a little ugly.
@Krush you mean like dependency injection?
 
4:56 PM
A = { a = 10; b = 10; } B = { c = 20; d = 20; }... But you do something to the expression that you assign B with, such that B.a expresses 10 etc..
 
@Krush that example is just normal inheritance
 
@ssube this kind of inheritance... However, if B were to have a member a, it would take priority
 
still just normal inheritance
 
@ssube thing is... A is not a class...
 
user5992646
There are some things which I learn fast but some I learn really slow. So, it's not that I'm a slow learner. Very few are slow learners...some things they learn slow, some things they learn fast. :)
 
4:57 PM
@Krush doesn't matter
 
@ssube and many languages don't support singletons, so I mean to be that specific
 
inheritance doesn't require a class
@Krush uh, almost every language supports singletons
 
user5992646
hello ssube. :)
 
not that you should be using them much, DI is more flexible and easier to test, but you can write a singleton pretty much anywhere
 
@ssube I'm looking for a language, like javascript, that supports maps / objects / singletons / associative containers which can inherit another one of its kind, using a way that is not ugly like javascript's prototypes...
@ssube if you know what I mean
 
4:59 PM
not a clue
you want nested maps?
 
Have you ever heard of Scala?
 
yep
 
Know the scala "object" definition as opposed to "class" or "trait" definition?
If you need
 
ok
 
user5992646
maybe PHP can help. don't take this seriously, I'm just saying maybe. :)
 
5:00 PM
that's sugar for a singleton with inheritance of behavior
 
And object Name {} can inherit via object Name extends Super {}, but it only allows single inheritance... I'm looking for a neat way to do multiple inheritance, on plain ol' containers like these.
 
inheritance of state or of behavior?
in Scala, object A extends B and C with D or object A extends B with C and D?
 
Yeah but C & D have to be traits (interfaces)
 
yeah, you won't find a language that cleanly lets you do B & C with two classes
 
To best explain what I'm looking for, I can just show you plain ol' lua
 
5:03 PM
an example can't hurt, because I don't think you're asking for a real thing
so either I'm not understanding the question, or what you're asking for isn't real
 
Yeah it's pretty rare, lua is the only example I know, and I am writing an example
Still writing... but reason I don't use Lua is because of other ugly features
 
I'll be grabbing a sandwich and will read your example in a bit
 
k
 
I don't require the meta-programming way to accomplish this multiple inheritance of maps, but if there's something that replaces this feature similarly to how I've shown this code... Then plz tell me
 
5:11 PM
@rlemon turns out the issue seems to be with Ubuntu itself
 
never
Ubuntu is perfect
 
The serial port seems to only work consistantly on OSX
Which is baffling
 
Hehe
 
@Krush like this?
class A {
  constructor() {
	this.a = 1;
  }
}
class B extends A {
  constructor() {
	super();
	this.b = 2;
  }
}
class C extends B {
  constructor() {
	super();
	this.c = 3;
  }
}

const {a,b,c} = new C();
console.log(a,b,c); // 1 2 3
??
 
Yeah I know my example can avoid multiple inheritance, but that's not what I'm trying to achieve
Ughh
:D
 
5:15 PM
Anyone use Angular UI Router?
 
@rlemon and A, B and C are classes in your example... Why use classes when you can use a map, is what I'm saying, you could've just used prototyping, but I don't want that either :|
 
well then I don't know what the hell you want :P
 
I want a neat way like my example... to do emulate "inheritance" of maps...
to do.. ugh... just to :|
 
@Krush what do you mean "inheritance of maps?"
Have you just been talking about trees this whole time?
 
I get why that sounds foreign and weird to you... But... yeah
Well... what you mean by trees...
Like...
 
5:18 PM
the collection type
the data structure
 
Yeah but trees involve multiple dimensions
 
Tree<T> where T is some type of associative array and the tree searches them recursively
 
Ughh... please not Java
Ermm a = { a = 10; b = 20; }
 
that has nothing to do with java
it's one of the fundamental data structures (well, two)
 
The generics remind me of my past horrible experiences with it
 
5:20 PM
from your lua example, you just want nested maps
 
From my understanding of trees, you can represent them as hashmaps, containing hashmaps, containing hashmaps, containing values or hashmaps etc
Not sure what you mean by nesting
 
hang on, let me write a fiddle matching your lua
 
Is it possible to use angular-route and ui-route in the same app?
 
Everything is possible, but improbable
 
hallo
 
5:23 PM
hai
 
@Krush Then it follows that it is also possible that something is impossible. Which breaks your original statement. #rekt
 
@Awal no, the paradox created by it is the answer to the universe, just prioritize everything being possible before something or everything being impossible
:D
@Awal that's my only belief lol, and it being a paradox is the only reason I believe in it...
When something, abstract or concrete, has the ability to change itself complete, or mean/imply something opposite to itself, that is when true freedom exists... Which is what I want of a programming language, but we're a few powersets of omega-1 eras away from that... Sadly :|
 
@Krush this isn't the great code ever, but how about: jsfiddle.net/f9359tm3
that's what I mean by nested maps
a pseudo-tree of associative collections
 
@ssube yeah that functionality... but a language implementing it natively through special operators or something... less... ugly... than that code, because you can do this in practically every language...
 
I doubt you'll find a language doing it, because it's a problem for the collections library.
 
5:31 PM
setmetatable is Lua's special operator...
It doesn't have to be a collection
 
You can also clean up my code significantly.
 
It's like a singleton...
Singleton = map :D
 
NOPE
 
I know they're not BUT
 
those are unrelated terms
 
5:32 PM
If you can ever find what's common in them both... which is what I mean when I say object...
 
you can have a singleton that is not an object
it can totally be a primitive
 
If you can ever find what's common in them both... which is what I mean when I say object...
 
a singleton is a design pattern, a map is a collection type/data structure, and an object is an implementation detail
you can't compare them
 
You can compare everything, as everything is at-least infinitesimally relevant, it just so happens to be that singleton classes can be used very similarly to immutable maps,
 
in some languages, if the singleton is of a type that allows that
but that still doesn't make much sense
 
5:36 PM
To you it doesn't... :D
And many others
:|
 
because it's not a real thing
if you can't explain a pattern, either it's not a real/possible pattern or there's something else fundamentally wrong
 
Simply put, identifier containers...
 
that's not simply put
 
jquery ui conflicts with bootstrap 3 ?
 
if anything, that's more nonsensical
@gtzinos probably, yeah. jqUI touches a lot of things. You should only use one UI lib at a time, since CSS is not well-scoped.
 
5:39 PM
It's difficult for me to pinpoint what doesn't make sense to you... and what makes sense to me about them in a way that I can explain to you :|
 
@ssube i need to create an autocomplete above an input element . any other way?
 
@Krush you say you want a language construct that behaves like an existing type of collection, but you don't want it to be the thing that already exists.
what you're asking for, implementation-wise, already exists
 
No I'm fine with what { a: 10; b: 20 } in javascript & python represents, and what { a = 10, b = 20 } in lua represents etc
Assuming what they represent are not "identifier" containers, even though they can be accessed members from like an instance of a class can be...
 
guys for server side (web platform ) :

1) python
2) ruby
3) php
4) java ee
5) node.js
 
3 of those choices suck
 
5:47 PM
which ?
 
1,2,3,4,5
 
5,4,3,2,1
 
@gtzinos Banana
 
haha
 
Take twice a day, administer rectally
 
@KendallFrey application server?
 
Guys, I'm being gang trolled (synchronized downvotes, stupid comments) on this answer :
4
A: Merge/flatten an Array of Arrays in JavaScript?

Denys SéguretTo solve this problem, you don't need to import a library, a simple loop is both the simplest and most efficient solution : for (var i = 0; i < a.length; i++) { a[i] = a[i][0]; }

 
hi guys, could anyone tell me which design pattern suitable for creating a chart library?? a find these pattern, but still have problem to choose the best item ( observer, prototype, bridge ). great thanks for any idea
 
@shayanypn Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
Can you please help me restore sanity here ?
 
5:55 PM
@shayanypn There's no correct answer. Just do things and if it doesn't turn out okay, re-evaluate and learn.
 
@MadaraUchiha I'm being upset by this list of insults. I don't think I should flag. Maybe some cleaning or word ?
@DenysSéguret, yeah, your solution is amazing. Just an advice, don't mention this solution in a code review, or an interview. — Om Shankar 1 min ago
 
@Zirak at first i do like what you say, but now i don't want to write code like fools, on the other hand, i want to make this library openSource so that any other people can develope or imporve. i think i should use some structure on my library. but don't know what?
 
@Krush what the fuck is an identifier container?
 
Lolol
 
@DenysSéguret Lemme look
 
5:59 PM
@shayanypn There's no correct answer, you really just have to experiment and learn from experience.
 
@shayanypn You just need experience
 
Right after I finish ordering my pizza.
 
@DenysSéguret I don't see any insults? I mean he's being overly anal about a solution when we have limited inputs. that would pass a code review or interview in a whole shitloads of situations, just not "write me a general array flatten method"
 

« first day (2026 days earlier)      last day (2938 days later) »