All Questions
Tagged with python programming-languages
58 questions
-3
votes
1
answer
147
views
Learn a framework on a project, or mix languages between backend services [closed]
I am designing my next project, which will do various domain-specific tasks, but all that will be controlled and used via a generic crud web app.
I have been professionally using Java with Spring for ...
8
votes
5
answers
10k
views
Is code written inline faster than using function calls?
I wrote some script in Python that creates a giant 2D matrix (1000x1000 or bigger) and fills it with random numbers. And after that, it goes through every element of the matrix and changes the number ...
3
votes
4
answers
1k
views
Do all dynamically typed languages not support function overloading?
I have noticed that JavaScript and PHP and Python do not support function overloading.
Do all dynamically typed languages not support function overloading? If the answer is yes, then why is that?
26
votes
6
answers
9k
views
What does it mean when you say C++ offers more control compared to languages like Python?
I am comparing C++ with Python. It is clear that C++ is much more efficient and that the C++ code compiles directly to machine code whereas in Python it is interpreted.
I do understand that Python is ...
-2
votes
3
answers
852
views
is python(cpython) code represented as c code by the interpreter?
what i know is , in cpython when we run a code then its first compiled into byte code and the cpython interpreter( which is written in c interprets it) interprets the byte code and converts it into ...
2
votes
1
answer
1k
views
Custom language with mixed markup and Python, parsing in Python
I need a system for creating Python subclasses in a simple manner, and I was thinking of using a (custom) config language similar to json, xml, etc.
Here's the initial structure I thought of (one ...
5
votes
1
answer
305
views
In more canonical OO Python situations, what is the rule of thumb for default access modifiers?
Generally speaking in canonical OOP situations, the rule of thumb is to write your classes with the least access as necessary. i.e. only make public only what is necessary, make protected only what is ...
-2
votes
1
answer
84
views
Python Syntax Format
Since I am new to programming, I just want to understand the format the built-in functions is represented in the documentations. This is the one from python
bytearray ([source[, encoding[,errors]]])
...
4
votes
2
answers
119
views
Is there any good/fundamental reason that Python classvars, and JavaScript prototype inheritance, don't mutate the parent on assignment?
In Python, if you have a classvar, it's accessible from an instance, but if you set the variable on the instance it doesn't actually change the classvar, rather it assigns a new name which shadows the ...
0
votes
3
answers
1k
views
Definition of Generic function
1)
Below is a python function summation, that can perform sum of cubes/squares/.., similar operations.
def identity(k):
return k
def cube(k):
return pow(k, 3)
def square(k):
return ...
1
vote
4
answers
417
views
Why does string.find("") = 0? [closed]
I'm studying Python and hung up on a simple problem. Let's say we have:
string = "hello"
When we invoke the find method on the string to find an empty string like this:
string.find("")
Why does that ...
-1
votes
1
answer
181
views
Why do we use 'assert not' in this example?
My code takes 2 dates and finds the age of those dates in days. In my daysBetweenDates method the instructor uses an assert statement:
assert not dateIsBefore(year2, month2, day2, year1, month1, day1)...
4
votes
2
answers
3k
views
What makes a scientific programming language, scientific?
Why are some programming languages such as Python or Julia considered to be "scientific" programming languages? I guess my real question what is the criteria that makes a programming language ...
1
vote
4
answers
3k
views
Why use a higher level language? [closed]
A question that gets asked a lot is "Why use low level languages if you can code in high level languages more easily (and often tersely)?". I think the answers are fairly straight forward here, being ...
8
votes
1
answer
5k
views
How are scripting languages compiled?
I know the term "scripting languages" is just a subset of programming languages, but I want to refer to programming languages such as Python and Ruby among others.
First of all, why don't we need a ...