|
trønderen wrote: When you have to go outside the language itself to defend it, then I start questioning the language qualities.
By 'qualities' do you mean syntax? Or something else?
|
|
|
|
|
How far do you draw 'syntax'? Lots of aspects are consequences of the syntax, but can be identified as distinct qualities of their own - and if you like, you may reply: But that is just syntax!
Let me pop a few elements off the top of my head:
'Readability': Semantics are easily discernible from the printed representation. 'Easily' here means that you need as little background study as possible to understand the symbols to see their meaning. You can discuss a COBOL program with an accountant, but probably not a C++ program to perform the same task!
'Explicitness': The source code should make those elements (conditions, actions, ...) that are significant to the application solution stand out clearly, without drowning in red tape, irrelevant (to the problem solution) punctuation and other 'noise' mandated by syntax.
'Naturalness': Established linguistic elements should as far as possible retain their established semantics when adopted by a language. This in particular applies to keywords - if you use another term when explaining the code to a non-programmer than the keyword, then the keyword is poorly chosen. Similar applies to all sorts of punctuation; they should have the established meaning.
'Consistency': Doing similar operations (e.g. on different data types) in similar ways. Doing identical operations in different implementations gives identical results.
'Unambiguousness': Preferably in a 'natural' way, so that a minimum of 'unnatural' syntax is required. (Take parenthesizing of logical conditions: Lots of languages follow natural languages, with no parentheses, other languages have a syntax that would be ambiguous without them.)
'Conciseness': To obtain a certain well defined effect, a single syntactic element should be required to invoke it. For more complex effects, a minimum of syntactical elements should be required.
'Safety': Errors that could be detected before the program is run should be detected before the program is run. If an error
occurs at run time, it should have minimum disastrous effects.
'Environmental friendliness': If a partial solution is available from outside, it should be possible to adapt it as part of the total solution, with as few limitations (e.g. to the implementation language of the imported module) as possible. It should be possible to develop partial solution in this language for use in other total solutions, even if they are developed in other languages.
'Completeness': The basic mechanisms (data structures, flow, synchronization, ...) should be as complete as expected by the application domain. E.g. in an engineering oriented language, it shouldn't be necessary to construct your own complex type. In a business oriented language, fixed point types and arithmetic should be available.
'Suitable data types': Especially for domain specific languages, the basic data types of the language, as well as the mechanisms for building complex objects, should match the established domain concepts as closely as possible. E.g. APL objects closely matches the concepts for which the language was developed - matrix manipulation - while lisp object do not.
'Orthogonality and simplicity': To the extent possible, there should be one way of doing things rather than several similar but not identical ways of doing almost the same thing. A mechanism should be available in all contexts unless conceptually meaningless.
'Strictness': As opposed to 'forgiven-ness'. If you program something in a dubious way, the language should not gloss it over, but tell you. Rules are to be followed.
'Abstraction level': Basic mechanisms should be at an abstraction level that reasonably matches the level of the problem solution. E.g. a binary semaphore belongs at the assembly level of synchronization; critical regions and monitors are closer to the level of application problems.
'Adaptability': No construct should make adaptations, such as internationalization, difficult or impossible. E.g. there should not be restrictions on the characters in strings.
Difficult to make mistakes: Some languages are known for their 'You asked for it, you got it' nature: Constructs are 'legal', you receive no warning even if there is a 95% probability that you meant to write something else. The language should, as far as possible, provide an error/warning when you do something dubious, such as making assignments or expressions with differing types.
If you ask me again tomorrow, maybe I will can add another half a dozen of points
You may of course say that all of the qualities I identify above boils down to 'syntax'. That doesn't get us much further in creating better languages, 'We need a better syntax'. The list above is an attempt to clear away some of the fog, so we can more clearly see what we want to achieve with a better syntax.
Disclaimer: The list above was written down in a few minutes; it is not the result of any thorough analysis or evaluation. So it is most certainly incomplete. Maybe some will say even inconsistent in a couple places, but I think that depends on who is reading it.
Religious freedom is the freedom to say that two plus two make five.
|
|
|
|
|
Maybe I misunderstood your intention. Did you mean to ask about those elements that are distinct from the language and itself, but is part of the ecosystem in which the language is used?
I certainly may value the qualities of an ecosystem. As I mentioned in another post: The dotNet ecosystem allows you to develop different modules (for the same end result) in different languages; you pick the one best suited for the task. E.g. defining a dialog layout is a lot easier in the XAML language than in C#. That is an ecosystem quality, regardless of the qualities of XAML or C# as two of the languages in that ecosystem.
Availability of well known, well tested, highly recognized libraries is most certainly a positive quality of an ecosystem - more strongly, of course when the library functions you need are provided. Libraries are examples of reusability, which is a positive quality, and if a library is reusable across a large family of languages, that raises its value.
Having the option to study the inner workings of a library function, e.g. through the source code, may represent a positive value to some user groups.
Having the option to close your solutions' inner workings may represent a value to some user groups. So may the option to e.g. sign your solutions, protect use of them with a license key etc. - but note that this may conflict with other qualities.
A high quality development environment, with good editors, debuggers, test facilities, library management facilities etc. is also an important ecosystem quality.
The support availability and quality is an important quality. Qualifications for giving good support includes the ability to talk the customer's language, and understand his problem. Good documentation that can be easily understood by the target group, is a part of support quality of the ecosystem.
And then you have those ecosystem properties that may be qualities or dis-qualities. The general helpfulness of people using a certain ecosystem does have an effect on my perceived quality of the environment.
So, if you have an excellent ecosystem with all of these qualities at a high level, can you then throw in any programming language, regardless of how rotten the syntax is, with rock bottom score on most of the language qualities I listed in my previous post? Well, you may try. It may seriously degrade the users' perception of the ecosystem qualities, if the pure coding part sets them bitching and swearing.
That goes the other way, too: An excellent program language definition may suffer if the ecosystem surrounding it is rotten. Especially if you are bound to using one specific ecosystem and cannot replace e.g. the editor, cannot use libraries from other sources etc.
Both the language definition and the ecosystem must be of 'sufficiently high' quality. What is sufficient, depends a lot on context. Some qualities super-essential to one developer may have no significance to another one.
Religious freedom is the freedom to say that two plus two make five.
|
|
|
|
|
I second this.
Python scripts are easy enough to write and quick enough to execute that we can iteratively automate stuff that would not otherwise be automated. Because Python libraries are available to do almost everything, we now have a series of Python-based solutions where previously we had C, C++, Java and even Pascal.
|
|
|
|
|
Python is popular because
- it is user-friendly: tab vs. space is matter of life and death, case sensitive, uses == as 'equal'
- it is finance-friendly: no fixed-point datatype
|
|
|
|
|
"finance-friendly" - thought for sure you were going to say "free."
honestly though, when I saw that tab/space meant different things, I just moved on. Kiddie language, but that's just me.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
Funny enough, I find myself asking this EXACT same question this morning.
I checked in on a start-up project I'm part of, and noted an eMail from the "Cellular Modem" developer we have working out the AT commands required to talk to MS-Azure.
Over the course of the past 3 weeks, I personally have built and put in place a modem framework in our IoT application code base. I have provided EVERYTHING needed from turning certificates into byte arrays, and providing methods to load, unload them, I have provided a comprehensive framework that allows AT strings to be sent to and the answers received back from the modem easily.
I have EVEN compiled that code into a PC/X86 library and with the aid of a console mode program running under visual studio, it can be used to send and receive AT commands, work with certificates and everything else needed, using exactly the same API on a PC, with the modem connected via a USB to serial cable.
The "Modem Developer" has spent all day last Friday, making his OWN serial cable for the modem board, writing a Python library to drive that serial cable using his own Python based "development tools", and he has made a new python test suite that allows him to send string to the modem, get the answers back, and hit a button to make the python code generate new C code that interfaces with my API.
When asked why...
"Beacuse I find it easier", came his answer...
:-S
So it was easier for him to build an entirely new Python layer on top of the work I'd already done, instead of just typing in AT strings into a console mode app in V-Studio and hitting Ctrl+Alt+B to compile it, then F5 to run it???
I really, really, really just don't get it either.
If I was starting from scratch on a PC, and doing this testing then yes, maybe... but I'd still use the standard serial access libs, and an already provided USB to Serial cable (Which we provided to him in the box with the modem board), I wouldn't take an FT232H write my own user mode WinUSB driver for it, invent my own protocol, wire it up to a MAX232 so I could connect to a normal RS232 9PIN connector, then write my own framework around it, then write a code generator to generate C code on top of that!! That's just plain madness.
So yes, sigh.... I find myself asking the same question.
|
|
|
|
|
this is not a python problem. Where's the boss?
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
on holiday apparently.
(I've just been told in the last couple of hours)
|
|
|
|
|
I have realized that if Russia wanted to invade Europe, it would be in August.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
YEP!!!!
I'm also working on a project that includes a large number of French folks, and damn I've been sat twiddling my thumbs for most of the last 2 weeks, and probably the next 4 too.
😂😂😂😂😂😂
|
|
|
|
|
Story from long ago, I worked in a division in the US that was owned by Belgians. One Wednesday, there was a problem discovered and we worked 10 hour days and through the weekend, because it was described as a "high visibility emergency." We fixed the problem and called them on Monday. Turns out there was only one person there (to answer phones). The tech staff had all left for their August holiday, even the guy screaming the week before.
Hmm, guess who never got special service or sympathy from that point on?
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
Python is a very simple language compared to C#, C++, Java, etc. Last I checked, C# had over 30 Generics. Really, you only need the three that Python has: Dictionary, List, Queue and the C# ones are specialized variation on those. There is a lot of that, maybe called language bloat. I like C#, but could live with Python easily enough.
|
|
|
|
|
C# also has [Hash]Sets, which are very useful. But you're right that a lot of the collection classes in the Net Framework are simply specialized (and hopefully optimized) variants of Dictionary, List, Queue, and Set.
|
|
|
|
|
|
So good protestants will stop using Python?
We face another iteration of the Holy Wars.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
I use Python because it has a HUGE library of math, data plotting and other functions. Many of these libraries are in C/C++ or Fortran, so run fast, and have a long legacy or are actively maintained, so are reliable. I also use Python for machine learning where most of the work is data or method exploration and the immediate running of code cells (in Jupyter, for instance) allows fast iteration of the code.
On the other hand, I wouldn't use Python for a time-critical real-time system, although I have used it to interface with Arduino's and data acquisition boards. However, Python is not that much slower than compiled languages unless the run-time is very long. Even then, if the code is solving big matrices then most of the time is in Fortran anyway.
From my understanding, the reduction in speed in Python is mainly to do with it not being a typed language: the interpreter has to figure out the data type on the fly. I'm not sure why this has to be since best coding practice is to use type-hints, which can be statically checked, but are ignored by the interpreter. I don't see why type-hints, if present, can't be used by the interpreter to enforce typing.
As to the comments about using white-space for formatting, I was already indenting to make the code readable so ; and {} are redundant to me and now seem like clutter whenever I work in C/C++/Java/PHP.
|
|
|
|
|
Wordle 1,141 4/6*
🟨⬜⬜🟨🟩
🟩⬜🟩⬜🟩
🟩🟨🟩⬜🟩
🟩🟩🟩🟩🟩
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Wordle 1,141 3/6
⬛🟨🟩⬛⬛
🟩⬛🟩⬛🟩
🟩🟩🟩🟩🟩
Jeremy Falcon
|
|
|
|
|
🟨⬜🟩⬜🟩
🟩🟩🟩🟩🟩
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
|
|
|
|
|
Wordle 1,141 4/6
🟨⬛⬛⬛🟩
⬛⬛🟩🟨🟩
🟩⬛🟩🟨🟩
🟩🟩🟩🟩🟩
Ok, I have had my coffee, so you can all come out now!
|
|
|
|
|
Wordle 1,141 4/6*
🟨⬛⬛⬛🟩
🟩⬛🟩⬛🟩
🟩⬛🟩🟨🟩
🟩🟩🟩🟩🟩
I put it on the right thread this time!
|
|
|
|
|
Wordle 1,141 4/6
⬜⬜⬜⬜⬜
🟩⬜⬜⬜🟩
🟩🟨🟩⬜🟩
🟩🟩🟩🟩🟩
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
Wordle 1,140 5/6*
🟨⬛⬛⬛🟩
⬛⬛🟩⬛🟩
⬛🟩🟩⬛🟩
🟩🟩🟩⬛🟩
🟩🟩🟩🟩🟩
|
|
|
|
|
Pssst.... 1,140 is on the second page.
Jeremy Falcon
|
|
|
|
|