- #71
Vanadium 50
Staff Emeritus
Science Advisor
Education Advisor
2023 Award
- 33,385
- 19,914
In the sense of "you don't get to do science anymore. You've been promoted to management."Mark44 said:promoted
In the sense of "you don't get to do science anymore. You've been promoted to management."Mark44 said:promoted
It boils down to productivity.CGandC said:I'm curious, why has Pascal declined in its popularity?
It encouraged the parochial view of "good programming" as the diligent pursuit of "tidiness" rules.Pascal is an imperative and procedural programming language, designed by Niklaus Wirth as a small, efficient language intended to encourage good programming practices using structured programming and data structuring.
One big difference is Python's standard library, which includes support for enough things that many Python programs can be written without having to depend on any third-party libraries. The Lisp dialects you mention (and indeed Lisp in general) have never had such broad library support built in.Hornbein said:I also could never figure what advantage Python had over MacLISP or Scheme or some other interpretive language that already existed.
Yes, but as you note, it is still the value that gets type converted; the integer doesn't. Whereas in the example of implicit conversion with strings in other languages, the integer gets converted to a string.Mark44 said:Technically, '2' is a character, very different from the string "2".
I saw a lot of that. Correctness is the real challenge. Get that then use a profiler.Vanadium 50 said:In general, my experience is that people pay too much attention to speed too early in the process.
Getting the wrong answer more quickly is seldom helpful.
Working hard to speed up a piece of code that didnt take up much of the time to begin with likewise.
In C, the char type is an integral type, similar to short int, int, long int, and several other integral types. What happens is that it gets promoted rather than converted. If you convert from a non-integral type to an integral type, the value will change, but that's not what happens when a char is promoted to an int.PeterDonis said:Yes, but as you note, it is still the value that gets type converted; the integer doesn't.
Vanadium 50 said:1. It is better to learn how to program than any particular language.
However, writing something from scratch is what people do who are learning to program.Vanadium 50 said:1A. While people focus on writing code, in real life reading code is at least as important. Writing something from scratch on your own is rare indeed.
Re the last sentence: An instructor I had a long ago said this: "The sooner you sit down to the keyboard, the longer it takes to write your program."Vanadium 50 said:4. A lot of useful advice is language independent and never touched. RTFM. UTSL. Use pencil and paper before writing the code.
Mark44 said:"The sooner you sit down to the keyboard, the longer it takes to write your program."
Maybe it shouldn't be. Being able to write HelloWorld, FizzBuzz and maybe even TicTacToe leaves people unprepared for geting an inch thick stack of green and white tractor-fed paper on their desk with the instruction "1% of our vendors aren't getting paid. Fix it."Mark44 said:However, writing something from scratch is what people do who are learning to program.
A week of coding will save you an hour of thinking.Mark44 said:The sooner you sit down to the keyboard, the longer it takes to write your program
I love itVanadium 50 said:A week of coding will save you an hour of thinking.
Well, of course -- it's a long way from writing a toy program to being able to analyze why a big program isn't working for 1% of the vendors, but you have to crawl before you walk, and walk before you run.Vanadium 50 said:Maybe it shouldn't be. Being able to write HelloWorld, FizzBuzz and maybe even TicTacToe leaves people unprepared for geting an inch thick stack of green and white tractor-fed paper on their desk with the instruction "1% of our vendors aren't getting paid. Fix it."
I haven't programmed since MS quickbasic in the '90s. I'm reading Swift.org, but it is over my head.Rene Dekker said:For systems programming on any Apple platform: Swift.
I don't think it's actually the other way around with regard to teaching programming. Before a student is asked to write a program he or she will have been exposed to examples that use the same concepts as are asked for in the program to be written. I'm speaking as someone who has taught programming classes for about 35 years in at least six different languages.Vanadium 50 said:But if you go to college to learn to write English, you spend a greate deal of time reading, and less time writing. If you go to school to learn to write code, it's the other way around. I am musing aloud as to whether the English Department may have it right.
AFAIK, no. A compiler generates code that can run on a particular operating system. If you write a program in Swift that runs on a Mac, the OS is iOS <some version>. A Windows user would need to have some kind of emulation software on the Windows machine, software that would emulate the Mac OS.Algr said:If I write a program in Swift on Mac, can I save it as a windows program and send it to a windows user?
Java can do it because Java does not compile directly to machine code, but rather creates an intermediate form which can then be executed on any machine (including Mac's and Windows) that have a Java Virtual Machine (an app to run Java intermediate code)Algr said:Are their any program languages that can do this?
Any interpreted language that has an interpreter on both platforms will do. Java is one, as @phinds mentioned. Another is Python. Another is C#.Algr said:Are their any program languages that can do this?
How is this different from 1? The JVM is just a bytecode engine that runs Java bytecode; it's no different from the Python interpreter running Python bytecode, or any other interpreted language. You still have to have a JVM separately compiled for each platform. Yes, Java has historically had a core team that devotes attention to the JVM for multiple platforms; but so has Python, and so have other interpreted languages, like Perl.Vanadium 50 said:Use a common environment like the Java Virtual Machine upthread
There is more standardization.PeterDonis said:How is this different from 1?
In what way? Python code runs the same on every platform that has a Python interpreter.Vanadium 50 said:There is more standardization.
I recommend javascript or java.Algr said:Thank you all!
It sounds like Python is the best choice for me, or maybe Java. I'm not really looking to make any money off of programming, just make fun little programs to send to friends.
Funny, reading this post made me think about a similar question that could be asked:pbuk said:I'm still researching for an improved answer for the question in the title and a couple of points that have been made in this thread and are put well here have come out as important so I thought I would jot them down here so they don't get lost:
Relevant considerations:
Not relevant:
- What should someone gain from their experience with a first language?
- The first language learned is not the only language ever learned.
- A first language should not force a particular programming paradigm (sorry Java: not everything is a noun).
- Is language X "better" than language Y? (Unanswerable without context.)
https://en.wikipedia.org/wiki/Programming_paradigmVanadium 50 said:I am not 100% sure what you mean by "paradigm"
No, forcing is saying you can ONLY accomplish a task by jumping through non-intuitive hoops. For instance in some functional programming languages you can only create a loop by writing a recursive function and having the compiler sort out the fact that recursion is a really bad way for a computer to execute code and convert it to iteration.Vanadium 50 said:"force" (is making it easy to accomplish a task in one way 'forcing'?)
Vanadium 50 said:I think your third point somewhat contradicts your second ... if the thought is the student will eventually learn multiple languages, why is this a problem?
It becomes a problem when the student has to spend more time struggling to implement the algorithm in the target language than they spend working out the algorithm.Vanadium 50 said:The code - indeed - the approach - will be different in several of them, although it lends itself to block-structured procedural cide with several independent subroutines. Is this a problem?
And that is the whole point of this thread. For some reason, many people choose to start their tool collection with that Swiss Army knife - even if they are only interested in painting pictures or writing novels.Vanadium 50 said:I probably wouldn't start with C++, just as I wouldn't start my tool collection with a Swiss Army knife.
Vanadium 50 said:My advice to "what language should I learn" has consistently been "it is more important that you learn to program than what the language you first learn" and this advice is fairly consistently ignored.
I had the great good fortune to be taught this from the very start many decades ago. At the time there were relatively few computer languages but even so the prof was emphatic that programming was not about syntax, it was about clearly thinking through the problem and how to solve it before worrying about how to do it in any particular language.Vanadium 50 said:My advice to "what language should I learn" has consistently been "it is more important that you learn to program than what the language you first learn" and this advice is fairly consistently ignored.