Questions tagged [dynamic-languages]

Dynamic languages are a class of high-level programming languages whos behaviors is determined at runtime rather than compile time.

157 questions
2174
votes
26 answers

How does JavaScript .prototype work?

I'm not that into dynamic programming languages but I've written my fair share of JavaScript code. I never really got my head around this prototype-based programming, does any one know how this works? var obj = new Object(); obj.prototype.test =…
John Leidegren
  • 59,920
  • 20
  • 131
  • 152
207
votes
9 answers

Dynamic type languages versus static type languages

What are the advantages and limitations of dynamic type languages compared to static type languages? See also: whats with the love of dynamic languages (a far more argumentative thread...)
cvs
  • 3,041
  • 8
  • 26
  • 22
117
votes
5 answers

Using -performSelector: vs. just calling the method

I'm still kind of new to Objective-C and I'm wondering what is the difference between the following two statements? [object performSelector:@selector(doSomething)]; [object doSomething];
TheGambler
  • 3,711
  • 5
  • 38
  • 54
84
votes
9 answers

How to create inline objects with properties?

In Javascript it would be: var newObject = { 'propertyName' : 'propertyValue' }; newObject.propertyName; // returns "propertyValue" But the same syntax in Python would create a dictionary, and that's not what I want new_object = {'propertyName':…
Jader Dias
  • 88,211
  • 155
  • 421
  • 625
81
votes
32 answers

What do people find so appealing about dynamic languages?

It seems that everybody is jumping on the dynamic, non-compiled bandwagon lately. I've mostly only worked in compiled, static typed languages (C, Java, .Net). The experience I have with dynamic languages is stuff like ASP (Vb Script), JavaScript,…
Kibbee
  • 65,369
  • 27
  • 142
  • 182
58
votes
9 answers

What makes Ruby slow?

Ruby is slow at certain things. But what parts of it are the most problematic? How much does the garbage collector affect performance? I know I've had times when running the garbage collector alone took several seconds, especially when working…
Nick Retallack
  • 18,986
  • 17
  • 92
  • 114
44
votes
9 answers

Why are IOC containers unnecessary with dynamic languages

Someone on the Herding Code podcast No. 68, http://herdingcode.com/herding-code-68-new-year-shenanigans/, stated that IOC containers had no place with Python or Javascript, or words to that effect. I'm assuming this is conventional wisdom and that…
mikemay
  • 3,707
  • 6
  • 34
  • 35
35
votes
14 answers

Programming language for self-modifying code?

I am recently thinking about writing self-modifying programs, I think it may be powerful and fun. So I am currently looking for a language that allows modifying a program's own code easily. I read about C# (as a way around) and the ability to…
Betamoo
  • 14,964
  • 25
  • 75
  • 109
32
votes
12 answers

What is a dynamic language, and why doesn't C# qualify?

Listening to a podcast, I heard that C# is not dynamic language while Ruby is. What is a "dynamic language"? Does the existence of dynamic languages imply that there are static languages? Why is C# a dynamic language and what other languages are…
egyamado
  • 1,111
  • 4
  • 23
  • 44
30
votes
15 answers

How do you program differently in dynamic languages?

How would someone who really knows how to take advantage of dynamic programming languages approach programming differently than someone working in a static language? I'm familiar with the whole debate over static versus dynamic typing, but that's…
John D. Cook
  • 29,517
  • 10
  • 67
  • 94
27
votes
3 answers

Does the new 'dynamic' C# 4.0 keyword deprecate the 'var' keyword?

When C# 4.0 comes out and we have the dynamic keyword as described in this excellent presentation by Anders Hejlsberg, (C# is evolving faster than I can keep up.. I didn't have much time to acquaint myself with the var keyword) Would I still need…
Gishu
  • 134,492
  • 47
  • 225
  • 308
26
votes
17 answers

Is there any point for interfaces in dynamic languages?

In static languages like Java you need interfaces because otherwise the type system just won't let you do certain things. But in dynamic languages like PHP and Python you just take advantage of duck-typing. PHP supports interfaces. Ruby and Python…
Rene Saarsoo
  • 13,580
  • 8
  • 57
  • 85
26
votes
9 answers

Real Life Benefits of Dynamic Languages?

I'm exploring several possibilities for developing a new system (web application). I'm an "old fashioned" kinda guy, object oriented in nature (converted from procedural many years ago). I played around with Python and studied a bit Ruby, but…
Roee Adler
  • 33,434
  • 32
  • 105
  • 133
25
votes
5 answers

Any way to determine which object called a method?

I'm hoping that Ruby's message-passing infrastructure means there might be some clever trick for this. How do I determine the calling object -- which object called the method I'm currently in?
Joseph Weissman
  • 5,697
  • 5
  • 46
  • 75
23
votes
5 answers

Are Interfaces in JavaScript necessary?

I suppose this could apply to any dynamic language, but the one I'm using is JavaScript. We have a situation where we're writing a couple of controls in JavaScript that need to expose a Send() function which is then called by the page that hosts the…
lomaxx
  • 113,627
  • 57
  • 144
  • 179
1
2 3
10 11