mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   PrimeNet (https://www.mersenneforum.org/forumdisplay.php?f=11)
-   -   TF fetching/reporting toolkit for Linux (https://www.mersenneforum.org/showthread.php?t=19304)

swl551 2014-05-06 01:36

[QUOTE=chalsall;372019]I understand your point. But...

In my world, VIM is my "IDE". If I want to remove a bit of code (C, Perl, Javascript, et al) by quickly adding a "if (0) { ... }" section around a block, I can. If I want to add a bit of code I can simply type it in. If a section of code is more readable in one line rather than two or three, I should able to do so (e.g. "if ([some condition]) {[action]}").

Hell, if a programmer wants to write their entire program on a single line, they should be able to do so. This is often done (using tools) with Javascript to lessen the download size of production code.[/QUOTE]


[QUOTE=chalsall;372019]I understand your point. But...

In my world, VIM is my "IDE". If I want to remove a bit of code (C, Perl, Javascript, et al) by quickly adding a "if (0) { ... }" section around a block, I can. If I want to add a bit of code I can simply type it in. If a section of code is more readable in one line rather than two or three, I should able to do so (e.g. "if ([some condition]) {[action]}").

Hell, if a programmer wants to write their entire program on a single line, they should be able to do so. This is often done (using tools) with Javascript to lessen the download size of production code.[/QUOTE]

I'm finding this indentation to be a very odd way of expressing flow logic.

[CODE]
for line in data:
if len(line) > 1:
print(line)
print("whitespace")
[/CODE]is different than
[CODE]
for line in data:
if len(line) > 1:
print(line)
print("whitespace")
[/CODE]is different than
[CODE]
for line in data:
if len(line) > 1:
print(line)
print("whitespace")
[/CODE]The lack of a clear "block" designation seems like a bug-a-thon waiting to happen.

hmmm, maybe I should look at Ruby.

chalsall 2014-05-06 02:06

[QUOTE=swl551;372743]hmmm, maybe I should look at Ruby.[/QUOTE]

Or, may I recommend Perl? :smile:

Very powerful, and easy to learn for anyone who knows C or C++;

ET_ 2014-05-06 09:33

[QUOTE=chalsall;372748]Or, may I recommend Perl? :smile:

Very powerful, and easy to learn for anyone who knows C or C++;[/QUOTE]

Apart from that regular expression thingie... :rolleyes:

Luigi

fivemack 2014-05-06 09:49

[QUOTE=swl551;372743]I'm finding this indentation to be a very odd way of expressing flow logic.

[CODE]
for line in data:
if len(line) > 1:
print(line)
print("whitespace")
[/CODE]is different than
[CODE]
for line in data:
if len(line) > 1:
print(line)
print("whitespace")
[/CODE]is different than
[CODE]
for line in data:
if len(line) > 1:
print(line)
print("whitespace")
[/CODE]
[/quote]

They're different, and they look different, and it's pretty clear how they differ. Nowadays we're pretty good at preserving white-space (maybe only because people liked posting ASCII art and having it not get mangled), which means we can use indentation for structure, and get intuitive clarity while saving vertical space.

The indents are remarkably wide - I tend to write python with one-space indents.

swl551 2014-05-06 12:32

[QUOTE=fivemack;372772]They're different, and they look different, and it's pretty clear how they differ. Nowadays we're pretty good at preserving white-space (maybe only because people liked posting ASCII art and having it not get mangled), which means we can use indentation for structure, and get intuitive clarity while saving vertical space.

The indents are remarkably wide - I tend to write python with one-space indents.[/QUOTE]

Indents are exaggerated for clarity. I guess the more you write python and the more you have to debug indent issues the better you get doing it. (Just like anything else).

blip 2014-05-06 12:50

[LEFT]Actually, I am in the middle of implementing something similar with a more traditional *ix approach using bash shell scripts, crontab, init.d,etc.
I intend to implement the web API specification as a library of shell functions.
If I find time, I can upload to a repo in the coming days.


[/LEFT]

chalsall 2014-05-06 16:27

[QUOTE=ET_;372768]Apart from that regular expression thingie... :rolleyes:[/QUOTE]

In my mind, native regular expressions are one of the things which makes Perl so powerful. When I have to do any text processing in C (a rarity these days) I often bring in the POSIX regular expression library.

Although I will agree that RegEx can be a bit of a steep learning curve, and can be of the "write once, read never" nature (as in, complex expressions can be difficult for a human to understand). But, having said that, the power they bring to the coder is, IMO, well worth the effort.

Xyzzy 2014-05-06 18:29

[url]http://ex-parrot.com/~pdw/Mail-RFC822-Address.html[/url]

Mini-Geek 2014-05-06 18:42

[QUOTE=Xyzzy;372814][url]http://ex-parrot.com/~pdw/Mail-RFC822-Address.html[/url][/QUOTE]

:never again:

swl551 2014-06-19 15:00

It turns out there is no reason to continue this work as it already exists

[url]http://mersenneforum.org/showpost.php?p=376218&postcount=57[/url]


All times are UTC. The time now is 09:48.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.