|
Post by badbug on Aug 29, 2023 7:55:05 GMT -5
While doing some searching on youTube, I kept running into the theme of Functional programming. So, being curious I started looking into it. Turns out this is the new paridine. All kinds of discussions on how to do it. Basically they say that Object programming is not the way to go. Some say it was a big mistake. I finally found a video on Functional programming for dummies, so I could understand what it really was. Guess what - They are saying to use Functions. Something Basic has had for as long as I can remember. I always thought OO just added confusion to code. Functions are simple and make perfect sense to me. I always believed that Basic languages were always the best of the languages. A lot of Basic languages died during this OO craize. Maybe they will rise again. Even realbasic bit the bullet and went OO with xojo. What a mistake.
|
|
|
Post by Carl Gundel on Aug 29, 2023 9:03:12 GMT -5
Functional programming is an interesting idea, and useful. Hardly new. Object orientation is also useful. I'm not sure how anyone can claim that OO is a bad idea. It is simply a way of organizing code and data together along certain lines of responsibility. It can help to solve certain problems in a really beautiful way but there is no language that can express all ideas equally well. If you really want to understand OO try Smalltalk, but you also need a good tutorial. C++ and Java are badly designed object oriented languages. If you ask a dozen people what object orientation is you will get a dozen answers, but Smalltalk is the real thing. I'm not saying that Smalltalk is perfect, but it is terrific IMHO! BASIC is not really a functional language, but you can write your code using functions, if you like. You won't be able to get away with using only functions. Even with a language designed to be functional you are going to need to break the purity of the functional paradigm in order to do GUI stuff. Some people say that newer functional languages solve this but my impression is that they torture the meaning of what a functional language is in order to do it. Depending on what you're trying to do, sometimes what you really need is a language like BASIC, but I'm biased.
|
|
|
Post by PaulDZ on Aug 29, 2023 11:26:24 GMT -5
Functional programming is an interesting idea, and useful. Hardly new. Object orientation is also useful. I'm not sure how anyone can claim that OO is a bad idea. It is simply a way of organizing code and data together along certain lines of responsibility. It can help to solve certain problems in a really beautiful way but there is no language that can express all ideas equally well. If you really want to understand OO try Smalltalk, but you also need a good tutorial. C++ and Java are badly designed object oriented languages. If you ask a dozen people what object orientation is you will get a dozen answers, but Smalltalk is the real thing. I'm not saying that Smalltalk is perfect, but it is terrific IMHO! BASIC is not really a functional language, but you can write your code using functions, if you like. You won't be able to get away with using only functions. Even with a language designed to be functional you are going to need to break the purity of the functional paradigm in order to do GUI stuff. Some people say that newer functional languages solve this but my impression is that they torture the meaning of what a functional language is in order to do it. Depending on what you're trying to do, sometimes what you really need is a language like BASIC, but I'm biased. Carl, can you recommend a decent Smalltalk tutorial? You have made me interested enough to talk a look at it. Also, which (version/dialect) and setup do you think would be best for someone just dabbling in it? I'd like to see what Liberty Basic was written in.
|
|
|
Post by Carl Gundel on Aug 30, 2023 11:05:24 GMT -5
Functional programming is an interesting idea, and useful. Hardly new. Object orientation is also useful. I'm not sure how anyone can claim that OO is a bad idea. It is simply a way of organizing code and data together along certain lines of responsibility. It can help to solve certain problems in a really beautiful way but there is no language that can express all ideas equally well. If you really want to understand OO try Smalltalk, but you also need a good tutorial. C++ and Java are badly designed object oriented languages. If you ask a dozen people what object orientation is you will get a dozen answers, but Smalltalk is the real thing. I'm not saying that Smalltalk is perfect, but it is terrific IMHO! BASIC is not really a functional language, but you can write your code using functions, if you like. You won't be able to get away with using only functions. Even with a language designed to be functional you are going to need to break the purity of the functional paradigm in order to do GUI stuff. Some people say that newer functional languages solve this but my impression is that they torture the meaning of what a functional language is in order to do it. Depending on what you're trying to do, sometimes what you really need is a language like BASIC, but I'm biased. Carl, can you recommend a decent Smalltalk tutorial? You have made me interested enough to talk a look at it. Also, which (version/dialect) and setup do you think would be best for someone just dabbling in it? I'd like to see what Liberty Basic was written in. Have a look at some links: www.youtube.com/watch?v=6wqhb_XmfUk&list=PLZHx5heVfgEvuveKG1T7BBSuDOTHl1eLl This is a link to a playlist. www.youtube.com/results?search_query=smalltalk+rubyconfamber-lang.net/learn.htmlmooc.pharo.org/ Pharo is a popular open source Smalltalk, a fork of Squeak Smalltalk Let me know if you have any questions. -Carl
|
|
|
Post by Walt Decker on Sept 4, 2023 15:11:16 GMT -5
I have done some OOP(object oriented) programming. To state that OOP is a mistake is a bit simplistic, and to compare OOP with "functional programing" is, depending on the stater's definition of "functional programming", indicates that the stater may not know what s/he is talking about.
As far as I can determine, the only differences between OOP and "normal" programming is OOP adds a layer of complexity and encapsulation, i. e., overhead, to the application. However, it does enable different applications running in completely different threads that are "COM"(common interface) aware to communicate with each other through a common interface.
OOP applications contain one or more "classes". Each class has a defined interface through which other classes within the application or other applications communicate. Each class in the application has its own functions termed "methods". These methods are exactly like subs/functions in basic. They may or may not return a value.
And there you have a quick outline of OOP.
|
|
|
Post by pandawdy on Sept 7, 2023 20:16:52 GMT -5
Is Small Talk the king of programming languages?
|
|
|
Post by tsh73 on Sept 8, 2023 3:07:12 GMT -5
|
|
|
Post by Carl Gundel on Sept 8, 2023 7:52:00 GMT -5
Is Small Talk the king of programming languages? Smalltalk (not Small Talk) is my personal favorite programming language. Is it the king? It is the best? The question that I think is appropriate is, best for what? One thing about Smalltalk is that it is a great language to learn just to understand the concepts. This is an education that makes you a better programming in other languages. Each language has its strengths and weaknesses. If I want to develop something small or fun, BASIC is great. If I want to develop something more sophisticated, Smalltalk is my choice. If I need to create something very small and fast I might dig out the C compiler but I haven't done that in a long time. Choose the right tool for the job.
|
|
|
Post by badbug on Sept 8, 2023 9:03:16 GMT -5
Just for fun I ask chatGpt to compare OOP and Functional.
This is what it had to say;
-----------------------------------------------------------
Here are some key points to consider:
1. OOP is still prevalent: Object-oriented programming is deeply ingrained in many popular programming languages like Java, C++, Python, and C#. Many software systems, libraries, and frameworks are built using OOP principles. It remains a valuable approach for modeling real-world objects and creating modular and maintainable code.
2. FP's popularity: Functional programming has been gaining popularity, especially in recent years, due to its focus on immutability, pure functions, and its suitability for parallel and concurrent programming. Languages like Haskell, Erlang, and Scala promote functional programming concepts. Even mainstream languages like Python and JavaScript have introduced functional features.
3. Hybrid approaches: Many modern programming languages support both OOP and FP, allowing developers to choose the paradigm that best fits their problem domain or style. For instance, Python supports both OOP and functional programming.
4. Context matters: The choice between OOP and FP often depends on the specific problem being solved. Some problems are naturally suited to OOP, while others may benefit from a more functional approach. Hybrid or multi-paradigm languages allow developers to mix and match as needed.
5. Evolving paradigms: The software development field is dynamic, and new paradigms and approaches continue to emerge. While OOP and FP are well-established, they are not the only paradigms in use. For example, reactive programming, actor-based models, and aspect-oriented programming have their niches.
6. Tooling and libraries: The availability of libraries, frameworks, and tools can influence the choice of programming paradigm. The ecosystem around a language often shapes the direction of its use in practice.
|
|