Preferred programming paradigm?
Displaying poll results.20101 total votes.
Most Votes
- Will ByteDance be forced to divest TikTok Posted on March 20th, 2024 | 8951 votes
- What's the highest dollar price will Bitcoin reach in 2024? Posted on February 28th, 2024 | 8486 votes
Most Comments
- What's the highest dollar price will Bitcoin reach in 2024? Posted on February 28th, 2024 | 68 comments
- Will ByteDance be forced to divest TikTok Posted on February 28th, 2024 | 20 comments
Calculator? (Score:4, Interesting)
Having been a university math professor for a time, I tried to learn every graphing calculator available. Most use some BASIC-like language, the exceptions I'm aware of being the more powerful calculators. The HP-48 used some language based on RPN, the HP-38 (not using RPN itself) had a completely different language, and of course the TI 89 (being more of a symbolic math package stuffed inside a calculator) was nothing like the other TI calculators, So even "what did my old graphing calculator use?" is not a trivial response
Re:Calculator? (Score:5, Interesting)
TI basic has a few huge limitations, but most programming paradigms can work in even incredibly limited platforms
you can overcome limitations with any number of structures
limitation - there are only 27 variables in the namespace and they are all global.
functional programming - all of your functions have to be stateless, so those global variables don't get stomped
or
Imperative programming - globally synchronized state across all functions
limitation - almost no data structures beyond arrays and strings
Object Oriented programming - store complex data in bitmaps stored as images or math functions, wrapped in getters/setters that handle decoding/encoding
Honestly the pure, simple, highly constrained world of TI-Basic did more to help me grow as a programmer than my first 3 years of college. In college I mostly gained the vocabulary to describe the concepts I thought I invented while farting around with my TI-83 in high school math class.
Re: (Score:2)
Re: (Score:2)
Maybe you're missing the point. The names aren't usually for using or discovering them; they're for understanding them. A lot of algorithms are trivial to implement (at least in the limited form they are usually taught in), but proving optimality and knowing when to apply them (i.e. understanding their generality) is another story.
Care to give a few examples before you christen yourself a genius?
Re:Calculator? (Score:4, Interesting)
I picked "whichever is right for a job". I add that object-oriented is usually the wrong choice for the job.
Functional and imperative are great. Event-based has a lot of uses. Relational is a whole class on its own. Object-oriented is usually a waste of time.
Re: (Score:3)
Object-oriented is usually a waste of time.
I see it the opposite way, non oo is usually a waste of time.
In what sector are you working that you feel that way?
Re: (Score:2)
I loved my HP48. Still have it. RPN was a lot easier than what other calculators used, once you got used to it.
Re: (Score:2)
Yeah, I had a National Semiconductor programmable calculator, forget the model number. It was pretty much the same thing, nice RPN with a big stack. All you had to do to program it was hit the 'start program' button and the 'save program' button when you were done. It was pretty slick. Thing lasted forever too.
Re:Calculator? (Score:4, Funny)
Re: (Score:2)
RPN = reverse Polish LISP.
It was a nice stack based LISPish with lots of tacit programming. PostScript (which was very cool for humans not just computer generated code) was like that as well. I've heard Factor is like that but haven't played with it.
Re:Calculator? (Score:4, Interesting)
Hehe, reminds me of High School back in 1975, when the school had only one computer class ( for Honors Seniors only!!) and that was via an LA-36 DecWriter and 110 BPS accoustic modem to the local Data Processing service, where a PDP-11 running RSTS/E BASIC would service hundreds of time-share customers, including our High School.
I was lucky enough to have had an HP-65 back in 1975. For Geometry 2 class, I passed the finals with an "A" after the teacher noticed I was using the calculator, he asked me to explain to him what I was doing, and I told him I wrote a program on it to factor polynomials. I showed him how it worked. He smiled and said "If you know it well enough to write an algorithm to do it, you KNOW it. You pass!"
Re: (Score:2)
I know the feeling, I did similar things on a TI-85, I think it was. One of the programmable TI's, anyway.
I wrote programs for solving nearly everything in geometry and trig classes, but they were just for fun. I was quicker at solving problems half on paper, half in my head. The programs just proved I understood the material and passed time I would've been bored in otherwise.
Re: (Score:2)
I used my calculator to pass English. The teacher had never heard of a calculator with memory and text.
What he gets for using 'memorize and regurgitate' methods.
Re: (Score:2)
For standard usage, I actually find RPN much more intuitive.
However, for programming, RPL is close to unreadable.
Re: (Score:2)
Real men programmed the HPs in microcode anyhow.
Choice of language (Score:5, Funny)
Procedural ... unless I missed something.
Procedural is a subset of Imperative (Score:5, Informative)
http://en.wikipedia.org/wiki/Imperative_programming#Imperative_and_procedural_programming [wikipedia.org] says:
Procedural programming is imperative programming in which the program is built from one or more procedures (also known as subroutines or functions).
http://en.wikipedia.org/wiki/Procedural_programming#Comparison_with_imperative_programming [wikipedia.org] says:
Procedural programming languages are also imperative languages, because they make explicit references to the state of the execution environment.
Conclusion: OP left off the Procedural subset of Imperative languages, which means you're supposed to choose Imperative if you wanted to vote Procedural.
Re: (Score:2)
Could also choose object oriented (a sub-sub set of imperative), but STL crashes too often for my taste...
Re: (Score:2)
STL crashes too often for my taste
Really? What are you doing? Which compiler/C++ standard library? ('STL' is almost certainly not the term you're looking for.)
Re: (Score:3)
C++ breaks the object model by not including encapsulation, so calling it object oriented is a stretch. It also lacks a primary object. Both of those can be worked around to make it more like true OOP, but I've seen few people do it. Personally I think C++ is a bit long of the tooth and there seems to be a lot of things poorly implemented, STL being a big one - this functionality should have been built into the language, not added with abstract functions leaving us with bloated code and incomprehensible err
Re:Procedural is a subset of Imperative (Score:4, Informative)
Re: (Score:3)
Sorry, you are mistaken on many ways:
o a common base object/class is not required for oo, and in a static compiled language it has limited use
o C++ is a multi paradigm language, you can do pure oo in it or anything else
o the STL never was slow, it does not even have a significant amount of virtual methods, the STL was explicitly designed to be as fast as hand crafted code
o regarding your lookup tables, you likely made a mistake, looking up a method makes an empty, parameter less method like factor 1.7 slowe
Re: (Score:2)
Spent over a decade working with pl/sql... an imperative language that included functional language features, which could be treated like an object oriented language when dealing with the database
Simultaneously all things and none and leads to a love hate relationship. If you spend too much time with you it can drive you a little batty
Re: (Score:3)
I agree in theory, but in practice nearly all of my programs end up being entirely non-functional.
Re: (Score:2)
I agree in theory, but in practice nearly all of my programs end up being entirely non-functional.
Non-functional programming is the way forward.
Re: (Score:3)
At least unit tests are easy on non-functional programs.
Re: (Score:2)
At least unit tests are easy on non-functional programs.
Everything is a side effect, except for monads, which return nothing to the local scope.
FRACTRAN (Score:5, Interesting)
I like whatever paradigm FRACTRAN [wikipedia.org] uses. It is more mathematically beautiful and unencumbered than other abstractions like SKI combinator calculus, lambda calculus, or Turing machines.
Derp Paradigm (Score:4, Informative)
For those of use who haven't coded since their introductory C classes decades ago, and maybe some Matlab or Labview tinkering since, here's a brief and illustrative overview [lmu.edu] of WTFTPIA.
Re: (Score:2)
The best one (Score:2)
There isn't a best programming paradigm, because there are different types of problems each addresses best.
Re:The best one (Score:5, Informative)
What ever the boss says. (Score:1)
If I'm told to do assembly then I do assembly. If I'm told to program using a calculator then that is what I will do. I'm not tied to any religious mode of programming.
Re: (Score:1)
It’s a shame your boss doesn’t ask your opinion.
Re:What ever the boss says. (Score:5, Insightful)
Who said the boss doesn't ask? Usually it goes like this...
Boss: What paradigm should we utilize to synergize our efficiencies and provide sustainability to the cloud?
Programmer: Let's just write this in Python.
Boss: That doesn't sound very innovative. We really need to think outside the box on this one and future-proof our social media content. Big data is a real value add here and I'm telling you it's a game changer. We should reach out and ping some subject matter experts on industry best practices.
Programmer: WTF does that even mean?! Let's just write this in Python.
Boss: That's not a robust solution to this challenge. We have to deep dive and figure out the most dynamic way to add value and monetize this opportunity.
Programmer: You're not even speaking coherently. Let's just write this in Python.
Boss: Al right, it looks like we should do this in Java so we're using Java for this project and I don't want to hear any more nonsense about snakes. Stop arguing with me.
Programmer: (sigh)
Re: (Score:2)
Re: (Score:2)
With a business major boss like I've had (not currently), it'd go something like this:
Boss: We need to synergize our efficiency and put a sustainable product in the cloud. First course of action, we need a language - I've heard html5/javascript is the one to use.
Me: Everyone uses that, but Intercal would make a much better choice for us
Boss: Great! I want a dynamic prototype in the cloud by morning!
Me: No problem... writes the program in perl, leave it on my dev machine, and proxy it from a cloud site.
Boss:
Re: (Score:3)
It will be alot faster in java though....
And it will be compiled, and (somewhat) typesafe (ok... but more so than python at least).
Which of course wasn't your point. But if your point is that your boss is an idiot and doesn't listen to technical direction from the knowledgeable people that he employs, then you simply need to get a different job.
Re: (Score:2)
Boss: What paradigm should we utilize to synergize our efficiencies and provide sustainability to the cloud?
Smart Programmer: We need to use the best paradigm for each sub-problem. I would recommend the Python programming language, because it has a large number of libraries that address the sustainability in the cloud.
Boss: That doesn't sound very innovative. We really need to think outside the box on this one and future-proof our social media content. Big data is a real value add here and I'm telling you i
Re: (Score:2)
Maybe if he hadn't said Python 3x he wouldn't have gotten stuck with Java. Boss in the first line is asking for:
a) Graphical abstraction (i.e. very complex data types without a specific binary representation being easy to manipulate)
b) Good ties to big data systems i.e. being able to abstract big data results as a native mathematic operation
Sounds to me like Python is a terrible choice. Haskell, LISP, Prolog ... Suggesting Python means you aren't listening.
____
His second comment is that Python isn't go
Re: (Score:2)
I'm not tied to any religious mode of programming.
http://perldoc.perl.org/functi... [perl.org]
Re: (Score:2)
So your preference is whatever your boss tells you? You have no opinions on what you prefer? I'm astonished that anyone that reads /. would admit to being so servile and unimaginitive.
Re: (Score:3)
So your preference is whatever your boss tells you? You have no opinions on what you prefer? I'm astonished that anyone that reads /. would admit to being so servile and unimaginitive.
Tut now. Remember the golden rule. The one who pays the gold, makes the rules.
More seriously - the boss knows better than you what direction the company is going, the future options, the requirements, the amount of talent out there, hopefully your own leanings. He's the boss. You can try and talk him out of it if you think he's wrong, but you'd better be able to back it up.
And at the end of the day, it it goes pear-shaped, it's his problem.
Re: (Score:2)
When it goes pear-shaped, your boss can declare it went pear-shaped because of your imagined failings, clearly not a decision he made. People are extremely good at rationalizing.
Re: (Score:2)
I'm astonished that anyone that reads /. would admit to being so servile and unimaginitive.
It's an AC; gives pretty good assurance that idiotic nonsense is to follow.
Forth prefer I (Score:1)
Re:Forth prefer I (Score:5, Informative)
Forth is a straight-up imperative language. It's a procedural postfix notation. The environment is very interactive, you've got your hands right into the language mechanics when you use Forth.
What I love about Forth is the tradition of small routines. I think programming in any language benefits from using very small routines. When building a Forth program, there is a tradition of getting into higher level programming quickly - write leaf routines to do the low level bit twiddling nitty-gritty, test them interactively. Then start building the program by assembling those together into higher level pieces. Also you can run Forth almost anywhere, if you look around the web for an implementation.
What I hate about Forth is for the leaf routines it's very much like writing in some complicated assembly language.
Re: (Score:2)
Other (List in comments) - Google (Score:3)
Google what you are trying to do, find something that claims to do something similar enough, and keep kicking it until it actually runs and outputs what you expected.
Re:Other (List in comments) - Google (Score:4, Funny)
AKA the StackOverflow programming paradigm
Butterfly, of course (Score:3)
OOP (Score:2)
All programming languages suck (Score:1)
I wish I could pick "Whichever i right for the job" but I have not found any programming language to be right for any job at all. There's typically a least worst one, but the right one...? This is only partially due to the available programming languages; the available compilers/VM's/interpreters are part of the problem as well.
One crucial critermium for me is that whatever code I write, especially in my private projects, is some level of guarantee that my code will still run in 10 years. In order to be abl
Re: (Score:2)
OK. So if you have a clear enough idea of what your ideal language should be then what are you waiting for? Create it.
Re: (Score:2)
My idea is just not clear enough yet. Combining the features I mentioned might seem obvious and it will be in hindsight, but at the moment I am at a loss as how to combine these features into a clean and consistent language.
Re: good glue languages (Score:3)
Huh, cool post. A lot of software engineering seems to boil down to integrating other peoples' existing libraries and black box modules that does stuff well, so I'd argue that a good high-level "glue" language is critical.
I'd done stuff before using perl to extract data from a running game in C and then ferry it off to some other finite element analysis program to do stuff with it. Nowadays I like doing things using python, since it really cuts down on human development and debugging time, but is still ve
Re: (Score:2)
In terms of the Java compatibility and some of the functional aspects I'd say Clojure. In terms of low level compile details you have some control with the JVM but it is limited. That's a pure choice either you get to decide how the hardware responds at a low level in the language or you don't have that control and you operate cross platform. You can't add functionality to the JVM.
Re: (Score:2)
Languages that don't have hardware specific features are easy to another set of hardware. I'm not sure how you are seeing this as the opposite.
Declarative (Score:3)
Prolog.
FUNGENOOP Programming (Score:1)
I have a choice? (Score:2)
Fortran (Score:2)
Re: Fortran as a systems language (Score:2)
Unix wasn't the the only OS written mostly in a portable language. Among the others was Primos. In the early days it was Fortran 66 (e.g. if-then but no if-then-else) Writing a screen editor in Fortran was an interesting experience.
Later on they used PL/1 subset G.
Re: (Score:2)
In the early days it was Fortran 66 (e.g. arithmetic-if but no if-then-else)
FTFY
Re: (Score:3)
Oops, sorry. I just Googled and confirmed that Fortran 66 had logical-ifs, e.g., .LT. 0.0) X = -X
IF (X
I thought it only had the arithmetic kind.
Re: (Score:2)
I used to work for Prime [circa 1978] and used their Fortran to do system programming like things. It was fine. They even had an SLR metaparser written in it which we used in their in-house CAD system. IIRC, it was Fortran of the day plus a few intrinsics/assembly routines to be able to hit the hardware.
meh (Score:3, Funny)
Re: (Score:2)
Spock? Is that you?
BTW, mnemonic memory circuits are hard, even with the right gear.
Re: (Score:2)
Actually I'm wondering if you somewhere can get a pocket knife made of bone, bone or wood handle and bone blade, short blade like 5cm.
Does anyone have an idea?
Soldering Iron (Score:1)
oscilloscope, wire-wrap gun, unwrap tool
Procedural Langurages FTW (Score:4, Insightful)
A lot of OOP can get messy real fast though, especially when it's layers deep of inheritance and interfaces compared to more straight forward procedural programming.
Its imperative (Score:3, Funny)
My boss says it is imperative that I get the program done.
Re:Its imperative (Score:5, Funny)
My boss says it is imperative that I get the program done.
But he probably also wants it to be functional.
Hardware (Score:3)
I program my army of CowboyNeal robots in VHDL
Let's see... (Score:3)
Functional
Preferred to dysfunctional, checked.
Imperative
Preferred to submissive, checked.
Logic
Preferred to illogic, checked.
Object-Oriented
Mmh, Notion-Oriented seems appealing, I'm torn on this one.
Other (List in comments)
If you want lists (and parenthesis) you want LISP and no other, period.
Whichever is right for the job
Preferred to whatever is wrong for the job, checked.
No preference
I prefer to have preferences.
Uh.. what did my old graphing calculator use?
BASIC-like says wikipedia [wikipedia.org], but I wouldn't want to use that for something serious.
Re: (Score:2)
If you want lists (and parenthesis) you want LISP and no other, period.
That's technically true but a bit vague. I would say if you want metaprogramming, you want Lisp (or possibly Forth.) The ()s can sometimes suck and yeah it would be great if there was less resistance for supplementing it with m-expressions (for bits of code where the scope is clear and introspection isn't necessary), but the whole point of ()s is you are limiting yourself to a single basic syntax with an explicit and easily examined scope. This lets you do amazing things: http://lib.store.yahoo.net/lib... [yahoo.net] .
Quantum (Score:1)
The answers are always present, instantly, if a bit difficult to select and read correctly.
TDD (Score:2)
I prefer TDD. And programming languages that offer the right mix of all of these.
Seriously, who gave the poll mike to the sophomore comp sci moderator today?
Cheap (Score:2)
I don't do any programming for a mere pair a dimes...
Yelling (Score:1)
Logical or procedural, but it doesn't really matte (Score:5, Insightful)
The whole world has come to worship at the OO alter, and it's fine for many problems, but too many school graduates don't know anything else. OO does at least encourage mediocre programmers to think about their data representation before they start coding. Of course, they get it wrong anyway.
Just look at the database schemas used by software systems in the wild. I ran across one last year where everything (and I do mean everything) was a string, and there wasn't a single foreign-key constraint in the whole database. A system before that couldn't be bothered even with first normal form - it truly stored multiple values in single database fields and parsed them out on demand. In both cases, the code was as bad as the database. I'm not sure the programmers had a paradigm. Maybe "random chaos"? Amazingly, both of those systems worked, more or less...
Given a good programmer, the paradigm doesn't much matter. Given a bad programmer, the paradigm isn't going help.
Re: (Score:2)
It is a common mistake to mix up programming with database design.
Even the best programmers are often mediocre regarding design of relational schemas.
The opposite is true as well, I never met a good DBA who actually could program beyond writing shell scripts.
Object-oriented is usually a waste of time.
Of course it matters. I don't program in non OO or non functional languages. I did not study computer science and higher concepts of software engineering to program in C or (non oo) Pascal or Fortran or Cobol.
Re: (Score:2)
Relational data is a terrible fit for OO: https://en.wikipedia.org/wiki/... [wikipedia.org] Not having this mismatch is one of the arguments for using an object database. What's right for OO isn't going to be right for relational and solving the relationship representation problem doesn't solve the object hierarchy problem.
Lisp (Score:2)
Lisp is none of the above and all of the above and more. It is "the programmable programming language". Why use something more limited?
Re: (Score:2)
LISP is fairly considered to be in the functional family. While it isn't purely functional it is functional.
LULWUT? (Score:2)
Why would anyone have to choose? There are numerous languages out there which will do basically all of these, starting with FORTH, which was released in 1968 IIRC...
Analog (Score:2)
these are tools. use what is comfortable for you (Score:2)
For a moment there... (Score:2)
For a moment there, I thought it said "( other ( ( lisp ) in comments ) )" :P :P :P
I do all my programming... (Score:3)
Hard wire it (Score:2)
from a philosophical standpoint... (Score:2)
I voted "whatever works for the job" but from a philosophical standpoint, functional programming is the right choice.
I'm talking purely theoretical here...not real-life cases but thinking about what the best could be.
Functional programming is, to my understanding, a kind of rejection of abstraction ontologies as a problem solving method instead focusing on instruction as the paradigm.
Machines following instructions for given parameters. That's the most logical, simple, and elegant starting point.
A real worl
Declarative (Score:2)
Declarative programming [wikipedia.org] obviously. Of course sometimes some pieces may be missing, and sometimes they may be most conveniently implemented using a more imperative programming style or language, but once you have the pieces, it's liberating to be able to just declare how they fit together.
"preferred" (Score:2)
I prefer functional programming languages, but I make my living with object oriented ones.
Other: Data Orientated Design (DOD) (Score:2)
Us game devs have adopted another paradigm because we care about pseudo real-time performance with games:
Data Orientated Design (DOD)
Why?
Because the biggest problem with OOP is that it does NOT scale for high performance. It tends to encouraging design for the uncommon single case, and not the for the common multiple case. The latency of accessing memory is the biggest bottleneck. Even Stroustrup had to learn how L1 Cache usage is critical for performance sensitive code -- https://www.youtube.com/watch?. [youtube.com]
Reactive (Score:2)
What, noone mentioned reactive yet?
what is data oriented design? (Score:2)
do you mean something akin to 'data-driven programming' described here: http://en.wikipedia.org/wiki/D... [wikipedia.org] ?
maybe an example of the code you use can help me...you do games...so probably some in-house variation of...?
your choice: functional programmming (Score:2)
Don't they all make computing systems do things with data?
as per my understanding, a person who asks this kind of question would choose "functional programming"
correct?
Re: (Score:2)
There certainly is no reason they can't merge if things like function composition get more popular with OO languages and type classes allow for chains of inheritance to work.
Re: (Score:2)
Python = Imperative
VBA = Imperative
SQL = Functional