Return to “Dev Logs”

Post

Re: [Adam] Thursday, February 15, 2018

#151
FormalMoss wrote:
Sun Feb 25, 2018 2:02 pm
But Flat.. why not Python??!! :P
:ghost:
Har-de-har-har. If Adam was proposing "languages for good programmers," then languages out of Amsterdam or Zurich go too far to the other extreme and assume all programmers are incompetent morons who need a language that will protect them from themselves.

:ghost: yourself. :P

More seriously, though, I'm actually mostly OK with Python as another Algol 60 descendant. The past few decades have seen too much CompSci theory stuff (yes, I'm looking at you, lambda calculus) bolted on top of what could and should have remained simple imperative languages easily usable by the typical working programmer. But the guts of Python are just another way of expressing the usual core constructs: variables, conditionals, loops, blocks. Nothing all that crazy in the basics. Even the Modula-2/3 patois features are maybe defensible (and I didn't like Modula-2 back when I taught myself to use it); well-defined exception handling is useful.

That said, I am never going to think that indentation for scoping (or nesting, if one needs to be pedantic) is anything but a Guido van Rossumism -- a weird personal affectation, not a feature with enough real value to justify it over using visible symbols that clearly and unmistakably indicate scope opening and closing. I don't know if this is enough to keep me from using Python forever, but it certainly doesn't make me want to use it.

And note that I'm not saying the indentation-for-scoping thing has no value. I could argue that it might reduce errors slightly by letting the programmer see more code on the screen at one time (versus the Allman/GNU/Whitesmiths styles that put each brace on its own line). I once spent a couple of weeks working at AT&T Bell Labs in Naperville, and one of the things I enjoyed about that environment was that the monitors were much taller vertically than horizontally -- it felt useful to see more code on the screen than usual. If you (generic you) are the kind of coder who believes there's something magical about artificially keeping every function no larger than ten lines, then fewer curly braces on lines of their own might seem useful to you because you can see more actual working code that way.

For larger blocks, I think this value is outweighed by the cost of not clearly seeing where blocks begin and end by using specialized visible symbols to denote these intentions. Let me know when Python fixes that and I'll consider trying it. :lol:

(Note: Yes, I know you were just poking the bear; I had a few minutes of free time and felt like doing a little writing. If a bit of opinionizing will help keep this interesting conversation going, well, I'm happy to do my occasional part. :) )
Post

Re: [Adam] Thursday, February 15, 2018

#152
While I personally do like the indent and non-static typing and other python ideosyncracies, I think it's main strength that makes it good for fast work is its gigantic and easy to use STL and easily downloadable other libraries. Basically anything I want done I can call a function for so I don't have to mess around implementing everything.
Warning: do not ask about physics unless you really want to know about physics.
The LT IRC / Alternate link || The REKT Wiki || PUDDING
Image
Post

Re: [Adam] Thursday, February 15, 2018

#153
Dinosawer wrote:
Sun Feb 25, 2018 3:17 pm
While I personally do like the indent and non-static typing and other python ideosyncracies, I think it's main strength that makes it good for fast work is its gigantic and easy to use STL and easily downloadable other libraries. Basically anything I want done I can call a function for so I don't have to mess around implementing everything.
This is the reason for libraries and scripting languages yes.

Python is not the best choice for large, complicated programs. But it is a damn fine choice for getting something going fast and easy.

Javascript is also a fine choice for that, and (in my experience) stands up better to other "faster" languages than Python tends to. it also doesn't make use of the ridiculous indent programming. Nor does it advocate the "try it and see" approach that Python does. (try/catch is not really appropriate imo).


But it falls down to personal preference, and the demands of the project.
I like to make my stuff work in browsers and be immediately cross-platform, so I use Javascript.
Dinosawer needs a whole BUNCH of science libraries that I will never need to use, so he uses Python which is the defacto standard for science libraries.

Companies like to have a singular language that doesn't need much education or intelligence to use. But still offers enough control and power to do things in a... semi-efficient manner, or at least fast. So they have the defacto standard of Java.

Power Programmers, like Josh, who like to exercise control over EVERYTHING, and want to eek out all the performance they can, use C. Not C++ (which is just C with extra libraries) but plain old C. Because C is the perfect language for Power and Speed. But it takes a level of experience and intelligence that is above most people employed in IT.

The only perfect language is the one that conforms exactly to the requirements of the moment.
Josh is getting around this by using Two languages that work together. C and Lua. Lua provides him a fast, JIT compiled, scripting language that has a lot of flexibility. And C provides him a powerful base, that is inflexible but fast.
°˖◝(ಠ‸ಠ)◜˖°
Toba - A Development Dump
Post

Re: [Adam] Thursday, February 15, 2018

#154
Silverware wrote:
Sun Feb 25, 2018 5:03 pm
The only perfect language is the one that conforms exactly to the requirements of the moment.
Josh is getting around this by using Two languages that work together. C and Lua. Lua provides him a fast, JIT compiled, scripting language that has a lot of flexibility. And C provides him a powerful base, that is inflexible but fast.
The hunt for the perfect programming language and ‘religious’ wars about languages have been ongoing since at least the ‘60s. To my mind, that ‘journey’ has value but there is _no_ destination. Different problem domains have different needs, including social, traditional and legal needs, that drive differing choices. And when it comes to a specific team choosing their language, what they know and what is available is often the key influence.

What has changed since I started programming, a scary number of years ago, is that more and more languages have free compilers / interpreters / runtime environments.
Post

Re: [Adam] Thursday, February 15, 2018

#155
Silverware wrote:
Sun Feb 25, 2018 5:03 pm
This is the reason for libraries and scripting languages yes.

Python is not the best choice for large, complicated programs. But it is a damn fine choice for getting something going fast and easy.

Javascript is also a fine choice for that, and (in my experience) stands up better to other "faster" languages than Python tends to. it also doesn't make use of the ridiculous indent programming. Nor does it advocate the "try it and see" approach that Python does. (try/catch is not really appropriate imo).
"Scripting language" is a term people use when they don't want to acknowledge the legitimacy of a language whose official implementation is an interpreter instead of a compiler.

Exception handling control structures in Python are optimized such that they're about as fast as the regular control flow structures in Python (indeed, for-loop iteration is controlled by raising StopIteration underlyingly). It's faster, for example, to try to access an item in a dict and catch KeyError when it isn't there than to check if the key is in it to begin with. The language standard has introduced type annotations for variables which, while are not used by the CPython interpretation (as of yet anyway), can be used to enforce stricter typing by other Python implementations, particularly for formal function parameters.

Because of the robustness of Python's exception handling, you almost need never check to see if a variable is None (Python's null), and the off-side rule for indenting function blocks is not ridiculous when you should be indenting your code anyway. It is extremely helpful not only for beginners who are learning how to code, but also for professionals who use Python who have to spend time reading other people's code. The indentation does enforce a certain style, yes, but on any project involving more than one person, adherence to a particular formatting style is necessary anyway, so why bother critiquing it? The indentation rule is waived for anything inside ( ), [ ], or { }, so it's not like list declarations or functions with lots of parameters are going to wrap lines on your terminal.
Shameless Self-Promotion 0/ magenta 0/ Forum Rules & Game FAQ
Post

Re: [Adam] Thursday, February 15, 2018

#156
Grumblesaur wrote:
Sun Feb 25, 2018 11:35 pm
you should be indenting your code anyway.

If it's something coders "should be" doing anyway, then there's no need for a language to force them to do it.

Also please consider how this "should" could be extended for consistency to lots of other things. If I think it's a universal "should," then you don't get to complain when I make you do it that way by language law -- does that seem like a good justification to you? "Everybody should be doing it anyway" seems to me to be dangerous ground on which to base programming language rules.

In other news, I've generally been enjoying JavaScript. My last few projects have been written in JavaScript (and HTML5/CSS, which chew up way too much of my time); it's a very natural-feeling way to express intent. It's not perfect, but what is? Some features are also browser-dependent, which can be annoying -- on the other hand, among other things I now know exactly which of the major browsers implement a stable sort() and which don't, and under what general conditions. :lol: Here's a jsfiddle sort stability tester I wrote, and here are the most recent results I got:

Code: Select all

Number of elements tested:        10        100       500       900
IE 11.0.10240.16683               stable    stable    stable    unstable
Edge 20.10240.16384.0             stable    stable    stable    unstable
Chrome 48.0.2564.116 m            stable    unstable  unstable  unstable
Brave 0.18.31                     stable    unstable  unstable  unstable
Firefox 44.0.2                    stable    stable    stable    stable
Opera 34.02036.25                 stable    unstable  unstable  unstable
Safari for Windows 5.1.7          stable    stable    stable    stable
mobile Safari (iPhone 7, iOS 10)  stable    stable    stable    stable

A nice thing about today's profusion of languages is that it gets easier to find one that fits your personal style (although if your style is iconoclastic, good luck finding enough people using the language to learn from their mistakes). It's better than everybody being forced to use COBOL and FORTRAN and PL/I (except for hobbyists using BASIC and FORTH and oddballs using APL and LISP :D ).
Post

Re: [Adam] Thursday, February 15, 2018

#157
Flatfingers wrote:
Mon Feb 26, 2018 12:45 am

A nice thing about today's profusion of languages is that it gets easier to find one that fits your personal style (although if your style is iconoclastic, good luck finding enough people using the language to learn from their mistakes). It's better than everybody being forced to use COBOL and FORTRAN and PL/I (except for hobbyists using BASIC and FORTH and oddballs using APL and LISP :D ).
Or DOS Batch script for those of us (few) who have a couple decades worth (!, like omg) of knowledge and experience.
I liken it to C, in that most people that try it, get lost in the Black Screen Of Do.Om (yes, the o.O is supposed to be there)..
.. it's funny watching people's expressions when I type out some code with ease :ghost:

And I concur, Flat, a current script I wrote using cacls, I have now removed from the unknowing fingers of my colleagues.. mostly because they could inadvertently utilise a switch to remove all existing permissions from petabytes of directories!!
As for usefulness, well, it means I don't have to stand over Explorer and click "continue" when it prompts an "Access Denied" prompt.. like seriously Microsoft?.. why don't you have an "ignore all" option to help us Windows Admins?! :ghost:
YAY PYTHON \o/

In Josh We Trust
-=326.3827=-
Post

Re: [Adam] Thursday, February 15, 2018

#158
Silverware wrote:
Sun Feb 25, 2018 5:03 pm
Python is not the best choice for large, complicated programs. But it is a damn fine choice for getting something going fast and easy.
I would argue none of the dynamically typed languages are a good choice for big projects. This may sound controversial or blasphemous (look how many projects are built on dynamic languages!!! facebook and twitter!!!), but it's the truth. See the next quote.
Grumblesaur wrote:
Sun Feb 25, 2018 11:35 pm
The language standard has introduced type annotations for variables which, while are not used by the CPython interpretation (as of yet anyway), can be used to enforce stricter typing by other Python implementations, particularly for formal function parameters.
Oh gee, I wonder why. I also wonder why a lot of javascript frameworks prefer typescript over javascript now. Oh boy. Maybe because letting compiler do most of the error checking for you for such little costs is actually good. Instagram invented a separate tool to analyze their application in runtime and then produce type-annotated code, it's absolutely ridiculous. Wow, I wonder where else that effort could have gone to. Maybe into using an actually statically typed language? "But it's a lot of typing!!!!!". Except no, in modern languages it's not. For example in typescript you only have to declare function argument types (not even the return type) and class member types. How many functions and data structures do you actually have compared to the amount of actual lines of code in them?
Dinosawer wrote:
Sun Feb 25, 2018 3:17 pm
easily downloadable other libraries.
Until you try installing something like wxwidgets on windows. Somehow you'll need to actually go to a webpage and download an actual installer and then actually run it. Things like maven somehow do not have that issue.


Imo there is definitely some value in having indentation-based blocks. It reduces code noise significantly and makes code easier to process (not always). From personal experience, I've recently opened the source code of a python tool I wrote maybe 3-4 years ago and I was able to read it much easier than I read my old code in other languages. It fails with big functions but as per google philosophy you shouldn't have them anyway. The whole language is built around having one way to do everything, not sure if it's good or not.

Also it's absolutely crazy how some people think exceptions are a good thing. Must feel amazing to have code which can stop executing at any line at any given moment without your control. Every function call is an implicit ticking bomb. Seems like even google realized that wasn't such a good idea and didn't put exceptions into Go.
Post

Re: [Adam] Thursday, February 15, 2018

#159
DoctorGester wrote:
Mon Feb 26, 2018 7:03 am
Dinosawer wrote:
Sun Feb 25, 2018 3:17 pm
easily downloadable other libraries.
Until you try installing something like wxwidgets on windows. Somehow you'll need to actually go to a webpage and download an actual installer and then actually run it. Things like maven somehow do not have that issue.

Code: Select all

pip install -U wxPython
¯\_(ツ)_/¯
Warning: do not ask about physics unless you really want to know about physics.
The LT IRC / Alternate link || The REKT Wiki || PUDDING
Image
Post

Re: [Adam] Thursday, February 15, 2018

#160
DoctorGester wrote:
Mon Feb 26, 2018 7:03 am
Silverware wrote:
Sun Feb 25, 2018 5:03 pm
Python is not the best choice for large, complicated programs. But it is a damn fine choice for getting something going fast and easy.
I would argue none of the dynamically typed languages are a good choice for big projects. This may sound controversial or blasphemous (look how many projects are built on dynamic languages!!! facebook and twitter!!!), but it's the truth. See the next quote.
Argue what you want, in this, you are wrong.

Weakly typed languages are exceptional at what they do, and can be used for anything from a single line, through to a project of a few million lines.
Your prejudices are both incorrect, and silly.

After all, there is zero difference at the end of the day, between a strongly typed version of the script, and a weakly typed version.
The main difference between the two, is that the user doesn't constantly have to think. "Am I an Int, or a Float, or a Double, or a Long Int, or a Byte?" they can just deal with their value as a number, and move on.

That being said, strongly typed languages tend to be compiled and as such run faster than non-compiled, weakly typed languages.
So if that's your main decider, what you are really arguing for is a compiled, and fast language, that tends to be strongly typed.

And if it's not, then you are arguing for complexity over simplicity.
In which case... I just get to laugh at you.
°˖◝(ಠ‸ಠ)◜˖°
Toba - A Development Dump
Post

Re: [Adam] Thursday, February 15, 2018

#161
The main difference between the two, is that the user doesn't constantly have to think. "Am I an Int, or a Float, or a Double, or a Long Int, or a Byte?" they can just deal with their value as a number, and move on.
The programmer might think then: "I hope this was an Int and not a Float".
The language is pushing the responsibility to validate using the correct type to the programmer. And the larger the project gets, and the more people work on it,
the more that gets to be a time intensive issue and cause of bugs.

I like a lot of the flexibilities in Javascript, but having no automatic typecheck is not one of them.
Post

Re: [Adam] Thursday, February 15, 2018

#162
Damocles wrote:
Mon Feb 26, 2018 12:55 pm
The main difference between the two, is that the user doesn't constantly have to think. "Am I an Int, or a Float, or a Double, or a Long Int, or a Byte?" they can just deal with their value as a number, and move on.
The programmer might think then: "I hope this was an Int and not a Float".
The language is pushing the responsibility to validate using the correct type to the programmer. And the larger the project gets, and the more people work on it,
the more that gets to be a time intensive issue and cause of bugs.

I like a lot of the flexibilities in Javascript, but having no automatic typecheck is not one of them.
No, no, no. That's the Strongly Typed mindset right there.
The Weakly Typed mindset is: "It's always the wrong format, convert it first."
The operation takes little to no time, and the data is always in the right format at the moment.

Want a number?

Code: Select all

(Var*1)
Want a string?

Code: Select all

(Var+"")
Want an Int?

Code: Select all

(Var*1|0)
Want a Bool? (This is the worst one, but honestly one almost never needs a raw bool.

Code: Select all

(Var&&true||false)
°˖◝(ಠ‸ಠ)◜˖°
Toba - A Development Dump
Post

Re: [Adam] Thursday, February 15, 2018

#163
Damocles wrote:
Mon Feb 26, 2018 12:55 pm
The language is pushing the responsibility to validate using the correct type to the programmer. And the larger the project gets, and the more people work on it,
the more that gets to be a time intensive issue and cause of bugs.
This guy gets it.
Dinosawer wrote:
Mon Feb 26, 2018 12:03 pm
pip install -U wxPython
Have you actually checked that? I'm aware of pip obviously, I was specifically arguing that a set of libraries needs special handling and can't be simply installed using pip. Maybe it can now, it sure wasn't the case when I used it.

https://wiki.wxpython.org/How%20to%20install%20wxPython\

Like if you maybe actually do some research before talking.
Silverware wrote:
Mon Feb 26, 2018 1:45 pm
The operation takes little to no time, and the data is always in the right format at the moment.
And with statically typed languages the operation is not there. And the data is GUARANTEED to be correctly typed. There is no burden of the programmer. What's the point of always doing that if you might as well be not doing that?

I've written medium sized projects in dynamic languages. Without covering the entirety of the project in units tests you are never sure if you are pushing the code without typos, and I thought we all agreed that people make typos? Stupid errors which could be caught by the compiler now need to be caught by your unit tests. And at this point after covering your codebase with unit tests calling your functions with all possible incorrect types you have to ask yourself: did you really save time with that?
Silverware wrote:
Mon Feb 26, 2018 12:17 pm
The main difference between the two, is that the user doesn't constantly have to think. "Am I an Int, or a Float, or a Double, or a Long Int, or a Byte?" they can just deal with their value as a number, and move on.
At which point you don't need to constantly think about that? A user tries to buy 3.5 oranges from your beautiful python website, you don't think about that?

Online Now

Users browsing this forum: No registered users and 2 guests

cron