mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > PrimeNet

Reply
 
Thread Tools
Old 2014-05-06, 01:36   #12
swl551
 
swl551's Avatar
 
Aug 2012
New Hampshire

23×101 Posts
Default

Quote:
Originally Posted by chalsall View Post
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:
Originally Posted by chalsall View Post
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.
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")
is different than
Code:
for line in data:
             if len(line) > 1:
                  print(line)
             print("whitespace")
is different than
Code:
for line in data:
             if len(line) > 1:
                  print(line)
print("whitespace")
The lack of a clear "block" designation seems like a bug-a-thon waiting to happen.

hmmm, maybe I should look at Ruby.
swl551 is offline   Reply With Quote
Old 2014-05-06, 02:06   #13
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

100110001001112 Posts
Default

Quote:
Originally Posted by swl551 View Post
hmmm, maybe I should look at Ruby.
Or, may I recommend Perl?

Very powerful, and easy to learn for anyone who knows C or C++;
chalsall is offline   Reply With Quote
Old 2014-05-06, 09:33   #14
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

2×3×11×73 Posts
Default

Quote:
Originally Posted by chalsall View Post
Or, may I recommend Perl?

Very powerful, and easy to learn for anyone who knows C or C++;
Apart from that regular expression thingie...

Luigi
ET_ is offline   Reply With Quote
Old 2014-05-06, 09:49   #15
fivemack
(loop (#_fork))
 
fivemack's Avatar
 
Feb 2006
Cambridge, England

3·2,141 Posts
Default

Quote:
Originally Posted by swl551 View Post
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")
is different than
Code:
for line in data:
             if len(line) > 1:
                  print(line)
             print("whitespace")
is different than
Code:
for line in data:
             if len(line) > 1:
                  print(line)
print("whitespace")
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.
fivemack is offline   Reply With Quote
Old 2014-05-06, 12:32   #16
swl551
 
swl551's Avatar
 
Aug 2012
New Hampshire

23·101 Posts
Default

Quote:
Originally Posted by fivemack View Post
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.
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).
swl551 is offline   Reply With Quote
Old 2014-05-06, 12:50   #17
blip
 
blip's Avatar
 
Jan 2014

2×73 Posts
Default

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.


blip is offline   Reply With Quote
Old 2014-05-06, 16:27   #18
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

9,767 Posts
Default

Quote:
Originally Posted by ET_ View Post
Apart from that regular expression thingie...
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.
chalsall is offline   Reply With Quote
Old 2014-05-06, 18:29   #19
Xyzzy
 
Xyzzy's Avatar
 
"Mike"
Aug 2002

2×23×179 Posts
Default

http://ex-parrot.com/~pdw/Mail-RFC822-Address.html
Xyzzy is offline   Reply With Quote
Old 2014-05-06, 18:42   #20
Mini-Geek
Account Deleted
 
Mini-Geek's Avatar
 
"Tim Sorbera"
Aug 2006
San Antonio, TX USA

426710 Posts
Default

Quote:
Originally Posted by Xyzzy View Post
Mini-Geek is offline   Reply With Quote
Old 2014-06-19, 15:00   #21
swl551
 
swl551's Avatar
 
Aug 2012
New Hampshire

23×101 Posts
Default

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

http://mersenneforum.org/showpost.ph...8&postcount=57
swl551 is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux install of CUDA toolkit for GT 430 card, maybe… ewmayer GPU Computing 66 2015-01-10 08:46
GPU72's fetching/reporting API Aramis Wyler GPU to 72 44 2013-04-10 13:41
GPU72.com TF worm fetching tool now available swl551 GPU to 72 83 2013-03-25 09:04
CUDA Toolkit for OpenSUSE 11.2--gcc 4.5 and up are not supported patrik GPU Computing 9 2012-04-07 03:50
NVIDIA CUDA C toolkit for G80 GPU available dsouza123 Programming 2 2007-02-18 12:50

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


Mon Aug 2 09:48:19 UTC 2021 up 10 days, 4:17, 0 users, load averages: 1.32, 1.29, 1.29

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

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.