Search Results

Search found 14176 results on 568 pages for 'functional programming'.

Page 24/568 | < Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >

  • What is a 'Closure'?

    - by Ben
    I asked a question about Currying and closures where mentioned. What is a closure? How does it relate to currying? Additional: Kyle's answer is great but to my poor procedural/OO mind Ben Childs answer is really useful.

    Read the article

  • Generics and Constrained Polymorphism versus Subtyping

    - by Rahul G
    Hullo all. In this (Warning: PDF) presentation on Haskell Type Classes, on slide #54, there's this question: Open Question: In a language with generics and constrained polymorphism, do you need subtyping too? My questions are: How do generics and constrained polymorphism make subtyping unnecessary? If generics and constrained polymorphism make subtyping unnecessary, why does Scala have subtyping?

    Read the article

  • Examples of useful or non-trival dual interfaces

    - by Scott Weinstein
    Recently Erik Meijer and others have show how IObservable/IObserver is the dual of IEnumerable/IEnumerator. The fact that they are dual means that any operation on one interface is valid on the other, thus providing a theoretical foundation for the Reactive Extentions for .Net Do other dual interfaces exist? I'm interested in any example, not just .Net based.

    Read the article

  • Are Scala "continuations" just a funky syntax for defining and using Callback Functions?

    - by Alex R
    And I mean that in the same sense that a C/Java for is just a funky syntax for a while loop. I still remember when first learning about the for loop in C, the mental effort that had to go into understanding the execution sequence of the three control expressions relative to the loop statement. Seems to me the same sort of effort has to be applied to understand Continuations (in Scala and I guess probably other languages). And then there's the obvious follow-up question... if so, then what's the point? It seems like a lot of pain (language complexity, programmer errors, unreadable programs, etc) for no gain.

    Read the article

  • Truly declarative language?

    - by gjvdkamp
    Hi all, Does anyone know of a truly declarative language? The behaviour I'm looking for is kind of what Excel does, where I can define variables and formulas, and have the formula's result change when the input changes (without having set the answer again myself) The behaviour I'm looking for is best shown with this pseudo code: X = 10 // define and assign two variables Y = 20; Z = X + Y // declare a formula that uses these two variables X = 50 // change one of the input variables ?Z // asking for Z should now give 70 (50 + 20) I've tried this in a lot of languages like F#, python, matlab etc, but every time i try this they come up with 30 instead of 70. Wich is correct from an imperative point of view, but i'm looking for a more declerative behaviour if you know what i mean. And this is just a very simple calculation. When things get more difficult it should handle stuff like recursion and memoization automagically. The code below would obviously work in C# but it's just so much code for the job, i'm looking for something a bit more to the point without all that 'technical noise' class BlaBla{ public int X {get;set;} // this used to be even worse before 3.0 public int Y {get;set;} public int Z {get{return X + Y;}} } static void main(){ BlaBla bla = new BlaBla(); bla.X = 10; bla.Y = 20; // can't define anything here bla.X = 50; // bit pointless here but I'll do it anyway. Console.Writeline(bla.Z);// 70, hurray! } This just seems like so much code, curly braces and semicolons that add nothing. Is there a language/ application (apart from Exel) that does this? Maybe I'm no doing it right in the mentioned langauges, or I've completely missed an app that does just this. I prototyped a language/ application that does this (along with some other stuff) and am thinking of productizing it. I just can't believe it's not there yet. Don't want to waste my time. Thanks in advance, Gert-Jan

    Read the article

  • Using MonadPlus in FRP.Reactive.FieldTrip

    - by ony
    I'm studying FRP at this moment through FieldTrip adaptor. And hit the problem with strange way of frames scheduling and integration. So now I'm trying to build own marker Event for aligning Behaviour stepping. So... flipflop :: Behavior String flipflop = stepper "none" (xflip 2) where xflip t0 = do t <- withTimeE_ (atTime t0) return "flip" `mplus` xflop (t+3) xflop t0 = do t <- withTimeE_ (atTime t0) return "flop" `mplus` xflip (t+2) txtGeom = ((uscale2 (0.5::Float) *%) . utext . show <$>) main = anim2 (txtGeom . pure flipflop) Questions is: Why this example leads to memory leak? Is there safe way to build sequence of events where each next one is scheduled depending on previous?

    Read the article

  • Translate imperative control flow with break-s/continue-s to haskell

    - by dorserg
    Consider the following imperative code which finds the largest palindrome among products of 3-digit numbers (yes, it's the one of the first tasks from "Project of [outstanding mathematician of 18th century]" site): curmax = 0 for i in range(999,100): for j in range(999,100): if ((i*j) < curmax): break if (pal(i*j)): curmax = i*j break print curmax As I'm learning Haskell currently, my question is, how do you translate this (and basically any imperative construct that contains something more complex than just plain iteration, e.g. breaks, continues, temporary variables and all this) to Haskell? My version is maxpal i curmax | i < 100 = curmax | otherwise = maxpal (i-1) (innerloop 999) where innerloop j | (j < 100) || (p < curmax) = curmax | pal p = p | otherwise = innerloop (j-1) where p = i*j main = print $ maxpal 999 0 but this looks like we're still in imperative uglytown. So what could you advise, what are the approaches of dealing with such cases FP-style?

    Read the article

  • Can higher-order functions in FP be interpreted as some kind of dependency injection?

    - by Giorgio
    According to this article, in object-oriented programming / design dependency injection involves a dependent consumer, a declaration of a component's dependencies, defined as interface contracts, an injector that creates instances of classes that implement a given dependency interface on request. Let us now consider a higher-order function in a functional programming language, e.g. the Haskell function filter :: (a -> Bool) -> [a] -> [a] from Data.List. This function transforms a list into another list and, in order to perform its job, it uses (consumes) an external predicate function that must be provided by its caller, e.g. the expression filter (\x -> (mod x 2) == 0) [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] selects all even numbers from the input list. But isn't this construction very similar to the pattern illustrated above, where the filter function is the dependent consumer, the signature (a -> Bool) of the function argument is the interface contract, the expression that uses the higher-order is the injector that, in this particular case, injects the implementation (\x -> (mod x 2) == 0) of the contract. More in general, can one relate higher-order functions and their usage pattern in functional programming to the dependency injection pattern in object-oriented languages? Or in the inverse direction, can dependency injection be compared to using some kind of higher-order function?

    Read the article

  • Want to add a functional language to my toolchest. Haskell or Erlang?

    - by sean.johnson
    I've been an OO/procedural guy my whole career except in school where I did a lot of logic programming (Prolog). I work on an amazing variety of projects (freelancer) and so I don't want the tools I know and understand to hold me back from using the right tool for the job. I've decided I should know a functional programming language. I've narrowed the field to Haskell and Erlang. What are the pros and cons, advantages and disadvantages, and major trade offs of Haskell and Erlang? How do I decide in a rational way, which is the better path? This is a big time investment, so I'd like to chose wisely. Is there a good case to be made for something else entirely? F#, Scala Ocaml? (BTW, I'm normally a Ruby/C/Obj.C guy, so I'm not terribly impressed or dependent on the JVM as a runtime. It's completely neutral to me. It's a fine runtime, I don't hold it for or against a language. I don't use Microsoft products though, so a .NET runtime would be a negative.)

    Read the article

  • What programming languages should every computer science student be taught?

    - by Anto
    What languages (or classes (as in paradigms) of programming languages, plus a recommended language of that class) should every computer science student be taught in college according to you? Motivate your answers; why that language? What use will one have from it? What concepts does it teach (better than language X does)? Note/clarification: This question is about computer science with heavy focus on software engineering, not pure computer science. It is still computer science education and not software engineering education which is the focus.

    Read the article

  • Writing a new programming language - when and how to bootstrap datastructures?

    - by OnResolve
    I'm in the process of writing my own programming language which, thus far, has been going great in terms of what I set out to accomplish. However, now, I'd like to bootstrap some pre-existing data structures and/or objects. My problem is that I'm not really sure on how to begin. When the compiler begins do I splice in these add-ins so their part of the scope of the application? If I make these in some core library, my concern is how I distribute the library in addition to the compiler--or are they part of the compiler? I get that there are probably a number of plausible ways to approach this, but I'm having trouble with the setting my direction. If it helps, the language is on top of the .NET core (i.e it compiles to CLR code). Any help or suggestions are very much appreciated!

    Read the article

  • Would learning any (linguistic) language in particular further your programming career?

    - by Anonymous
    It seems apparent that English is the dominant international language for programming based on previous P.SE questions (though a highly upvoted comment correctly points out that asking a question like that on a predominantly English site will skew the results). However, is there benefit in learning a foreign language for software development? For example, do the Chinese have completely different software tools, languages, technologies, etc? How about Japanese, Russian, and other non-latin based languages? Is there an entire world of software development languages, tools and so on that only exist in these other languages? Or do people that know these languages use the tools and languages we know and love?

    Read the article

  • Would learning any (linguistic) language imparticular further your programming career?

    - by Anonymous
    It seems apparent that English is the dominant international language for programming (in the West, at least!) based on previous P.SE questions. Or maybe not, given that a highly upvoted comment correctly points out that asking a question like that on a predominantly English site will skew the results. This question is about whether there is a benefit in learning a foreign language for software development. For example, do the Chinese have completely different software tools, langugages, technologies etc? How about Japanese, Russian, and other non-latin based languages? Am I/are we missing an entire world of software development languages, tools and so on that only exist in these other languages? Or do people that know these languages still learn and program using the tools and languages we all know and love?

    Read the article

  • Which programming language to develop software for USC that also runs on other OS?? (WINDOWS/OSX)

    - by Marian Lux
    I have skills in JAVA and C#: First i had a closer look to JAVA (Eclipse with Windowbuilder-Plugin) - Swing: But there is no natvie GUI-Support for GTK3 (e.g., HUD seems not to work) Then i was at JAVA - SWT: It is to heavy. I want do code a small app that improves the Ubuntu desktop. I don't want to ship a program with eclipse included. After that i found C# Mono (Monodevelop): GTK-shparp is only for GTK2 available. A GTK3-port will come soon but is it possible to convert the program from GTK2 to GTK3 without extra adaptations? The next bad thing is, that MONO is now dropped from Ubuntu LTS 12.04. So i have no chance that my app would be a default-app in an Ubuntu-Image. (This is also a factor for me to choose a programming language). I know there are other techs but i want to use as programing language JAVA or C#.

    Read the article

  • Which programming language do you think is the most beautiful and which the ugliest? [closed]

    - by user1598390
    I would like to hear opinions about what programming language do you consider to produce the most legible, self-documenting, intention-transparent, beautiful-looking code ? And which produces the most messy-looking, unintentionally obfuscated, ugly code, regardless of it being good code ? Let me clarify: I'm talking about the syntax, "noise vs signal", structure of the language. Assignment operators. De-referencing. Whether it's dot syntax or "-" syntax. What languages do you think are inherently harder to read than others, given all other things being equal like, say, code quality, absence of code smells, etc. ?

    Read the article

  • What are the preferred documentation tools for the major programming languages?

    - by Dave Peck
    I'm interested in compiling a list of major programming languages and their preferred documentation toolsets. To scope this a bit: The exact structure of the answer may vary from language to language, but there appear to be two aspects common to all languages: (1) in-code syntax for documentation, and (2) documentation generators that make use of said syntax. There are also cases where generators are used independent of code. For example, tutorial-style documentation is common in the Python world and is often disconnected from underlying code. Many languages have multiple commonly-used documentation strategies and tool chains, and I'd love to capture this. Finally, there are cross-language tools like Doxygen that also have some traction and would be worth noting here. Here are some obvious target languages to start with: Python, Ruby, Java, C#, PHP, Objective-C, C/C++, Haskell, Erlang, Scala, Clojure If this question catches on, I'll try and keep this section updated with the most recent list. Thanks!

    Read the article

  • Why aren't there automated translators from one programming language to another?

    - by serg
    Most programming languages are Turing complete, which means that any task that can be solved in one language can be solved in another one, or even on Turing machine. Then why aren't there automatic translators that can convert programs from any given language to any other language? I've seen couple attempts for two languages, but they always work only on a limited subset of a language and can hardly be used for converting real projects. Is it possible, at least in theory, to write 100% correct translator between all languages? What are the challenges in practice? Are there any existing translators that work?

    Read the article

  • How do I improve my logic in general and programming in particular?

    - by Dinesh Venkata
    I'm good with understanding technology and implementing it. At least that is what I feel. But it seems that when I come across experienced programmers they point out that my logic is weak. I feel that I would need some time with real programming to improve it. But nobody is ready to give that time to me. I'm just about starting my carer and it often feels disheartening to hear this. I want know how can I improve my logic and also does this sort of thing happens to others too?

    Read the article

  • Which programming language could I use for Natural Language Processing to extract clinical words?

    - by MACEE
    I am going to do entity extraction (like Named Entity Recognition) from clinical free text (unstructured raw text such as discharge summaries) and these entities could be any medical problem, medical tests or treatments. I am going to use one of i2b2 datasets (https://www.i2b2.org/) if case you are familiar with that. I am new to the NLP(Natural Language Processing) field and I need a programming language to support NLP tasks and also easily connect to the available libraries of machine learning algorithms like CRF. I don't know much java and I heard about Python, Perl and Scala but I am not sure which one would be the best option for this task?

    Read the article

  • How to better start learning programming - with imperative or declarative languages?

    - by user712092
    Someone is interested in learning to program. What language paradigm should I recomend him - imperative or declarative? And what programming language should he start with? I think that declarative because it is closer to math. And I would say that Prolog might be the best start because it is based on logic and programs are short. On the other hand at school we started learning from imperative languages and I am not sure whether there is a benefit to start with them instead of declarive ones. Thanks. :)

    Read the article

  • How often do you use google, to answer programming relatated questions? [closed]

    - by Mercfh
    I hope this isn't too subjective, but it is programming related and Im curious. Alot of times I feel.......dumb for lack of a better word when I have to look something up. Alot of times I forget all the specificity of a language and have to look up something like "Doing XXX in C++" for instance, or something along the lines of that. How often do you guys as Programmers both Professionally and On your own have to use google to look up something. Or do most people just kind of remember these things. I guess what Im really asking is, do you often have to use google or other web-search sites to remember how to do what is seemingly "simple" things with languages but you've just forgotten? Please tell me im not the ONLY one.

    Read the article

  • What is the right option of programming languages and tools for building our website?

    - by Goma
    We are 3 persons trying to build a large website which will be available in 3 languges. However, we will start with one language and with small idea then we are going to improve it and make it larger! What do you think the best tools and language that we should use? We are caring alot about the speed of loading the pages and tools that provide excellent qulaity with cheaper fees. Edit: We are graphic designers, so we did not choose the programming language yet. But we studied computer science and we have an idea but we found that this is the best place to ask the question and expect the right answer from you. Should we use ASP.NET for example? or PHP? We do not want an expesive option that will cost us alot in the future and we do not want to change the technology at least for the first 5 years. Thanks!

    Read the article

  • How do you choose a programming/data structure/algorithm book?

    - by Fanatic23
    I really should not be mentioning the name of the book, but the first time I read it (during my under-grad days) I almost concluded that data structure was a bad course to pick. Which brings me to the question I am asking here. What makes a programming or data structure or algorithm book tick? Clearly, lucid explanation is one. But I also realize that organization of the material is very important and so is diagrams. What else? Some pointers would obviously help when I hang out in my neighborhood computer book shop the next time.

    Read the article

  • How is it possible to write the compiler of a programming language with that language itself [closed]

    - by tugberk
    Possible Duplicate: How could the first C++ compiler be written in C++? You probably heard that Microsoft released a new language called TypeScript which is a the typed superset of JavaScript. The most interesting thing that makes me wonder is the fact that its compiler writen in TypeScript itself. Call me ignorant but I really couldn't figure out in my head how that is possible. This is just like chicken and egg problem in my head because there is no compiler to compile TypeScript's compiler in the first place. How is it possible to write a compiler of the compiler of a programming language with that language?

    Read the article

< Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >