David Clark

Greenhorn
+ Follow
since Aug 03, 2016
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by David Clark

At first, I was intrigued by Python, but now I'm not so sure.

I'm primarily interested in graphing parametric equations. I did a program in DOS Basic, where the X coordinate was a parametric equation, say sine, & the Y coordinate was a parametric equation, say cosine. The program plotted both coordinates. It looked right neat. I know that Python has a lot of math & science libraries. That's what initially intrigued me. I also want to do fractals.

The more research I do, the more cryptic I find the syntax.
For example:
the multiple uses of the underscore
comment blocks are so much easier to do in Kotlin

Python doesn't support static typing. I have mixed feelings about dynamic typing. Sometimes it's probably helpful to use dynamic typing.
Python doesn't have a Boolean variable type.

I want to learn Jython. I know that Jython/Python syntax is identical. But I have to have BOTH Jython AND Python installed. There are different versions of both. There would probably be conflicts between the 2.
I read about Python virtual environments. I don't completely understand them. I also read about pip.

At this point, I'm leaning more towards learning Kotlin over Python.

2 years ago
Today I installed Jython on my Mac mini with High Sierra. I downloaded the .jar file & went thru the setup. I accepted all of the defaults.

When I type "python" into the terminal, python starts. But when I type "jython" into Terminal, the Terminal tells me "command not found".

I'm unable to determine the python path. How do I find the python path in Finder?

Here's the path for jython: Macintosh HD/Users/davidsimpson/jython2.7.0.

How do I add the jython path? Or do I uninstall jython & reinstall jython & choose the current path during setup? Can I just delete the folders & start over again?
2 years ago

Yes, there is no simple answer other than trying out a few tools and seeing what works best for you.  



And that's exactly what I'm doing.

I have 3 IDEs on my Mac - Netbeans, Eclipse & IntelliJ. IntelliJ has the most extensive support for Java & other programming languages. So, ideally, I want to import my Netbeans demos into IntelliJ & learn some JVM language. I've made a list of JVM languages so I'll use Google & Wikipedia & YouTube to research each one & use a process of elimination.
2 years ago
Well, darn!

I want to learn a programming language. I want it to be cross-platform. I want it to be easy to read, not verbose like Java.

Jython/Python has its pros & cons just like every programming language. Python is easy to read but it doesn't support constants. Apparently, it also doesn't support comparisons in a For loop. It's not statically typed. I would think that would be bad programming practice. & hard to debug. It does have a lot of math & science libraries so plotting trig functions would probably be easier in Python than in Java. I've spent hours on Google & YouTube reading about Jython/Python, Groovy, Kotlin, Scala & other Java compatible languages.

I can't decide!
2 years ago
This is a Java example of my question.

for (int x = 2; x <= 4; x++)
           System.out.println("Value of x:" + x);

Obviously, the Jython/Python syntax is different from the Java syntax, but can one use the <= or >= or != sign in a Jython/Python For loop?
2 years ago
I've been researching Jython/Python.

It appears that it's not possible to have values like >= or <= or != in For loops in Jython/Python. Is that correct? It's possible to increment & decrement but not compare values in a Jython/Python For loop. Maybe I'm wrong & comparisons are possible in Jython/Python For loops but I haven't been able to find out.
2 years ago
I have a Mac mini with version 2.7.1 of python installed.

The current version of Python is 3.6. The latest version of Jython was released in May 2015.

Can I install the latest version of Python over the installed version or must I uninstall the current version of Python?

I'm a bit confused as to the Jython/Python relationship. I know that the Jython/Python syntax is identical.

Is the current version of Python compatible with the "current" version of Jython?

Since I have a Mac, is it possible to write a Python program on my Mac that will run on a Windows PC?
2 years ago

Knute Snortum wrote:I you don't like the verbosity of Java, you might like Groovy.



From what I've read on google, Groovy is almost as verbose as Java.

Besides, I don't want to fool with the Terminal. I want a GUI installer.

So, Groovy isn't my first choice.
3 years ago
I know that there are a lot of Java compatible languages.

I don't like the verbosity of Java.

Are there any languages that are NOT dependent on Java code? In other words, they don't have to call Java methods, etc.? They are completely independent of Java code but they still compile to Java code.
3 years ago
So, it's API docs not javadocs. No wonder I couldn't find what I was looking for when I googled "javadocs"!
3 years ago
Well, I've learned something! All this time I thought that the import statement meant that a copy of the class is imported to the program. When one searches for a file, the "*" is a wildcard. In Java it serves a different purpose. Very interesting!

It doesn't change the fact that Java has over 4,000 classes.

Sure, I can experiment with demos in books, but if I want to create something from scratch, I'll need to know the function of each class. Unlike the good ol' days before OOP, when one just wrote code. That's my main question. Say, I want to create a GUI tic-tac-toe game. I don't know which classes to use. I would need to list the rules of the game & come up with code that uses those rules. I certainly don't want to read 4,000 javadocs to find out what each class does. So, what do I do?
3 years ago
Well, I'm a bit confused now!

Please elaborate on the word "recursive". According to my dictionary, recursive means:
relating to or involving a program or routine of which a part requires the application of the whole, so that its explicit interpretation requires in general many successive executions.

What would happen if I ran this demo with "import javafx.*? It sure would save a lot of typing! I found out that there are over 4,000 classes in Java. I certainly don't want to search javadocs to find out the function of each of the 4,000 classes.

What happens when the demo is compiled if I enter "import javafx.*"? You state that the import statement is just a path to the class. If I wanted to make an executable JAR file, wouldn't there need to be a copy of the classes needed to run the program outside of the IDE or my computer?
3 years ago
Here is an example from a Java demo that I have:
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;

It's my understanding that the asterisk means import everything.

So, "import javafx.*" means import all of the classes from javafx, correct?

So, the above example could be redone as:
import javafx.application.*;
import javafx.event.*;
import javafx.scene.*;
import javafx.stage.*;

or even:
import javafx.*, correct?

I suppose that "import javafx.*" would make the overall file size bigger, but how much bigger? I also suppose that if I used "import javafx.*" there would be unused classes, correct?

I did notice that Netbeans underlined one of the import statements & when I hovered the mouse over it, it told me that that class was unused.
3 years ago
No, I'm asking about Python For loops.

I used a Java For loop as an example. I'm wondering how that example would be done in Python.
3 years ago
I browsed thru some books on Python at Barnes & Noble this morning. I noticed that the syntax for the For loop is different from other languages. One needs to have an ordered list.

Here's an example from a Java demo that I have:

for (intI = 0, intJ = 0;
    intI * intJ < 10000;
    intI++, intJ += 2)
   System.out.println(intI + " * " + intJ + " = " + intI * intJ);

There are 2 integer variables. Both are initialized in the For loop.

(For some reason, my text isn't tabbing in the preview!)

I'm guessing that in Python I'd have to have nested For loops. I'd have to have one For loop for the I variable & one For loop for the J variable. Is my assumption correct?
3 years ago