You are here

Programing Question

3 posts / 0 new
Last post
dark_yux
Offline
Last seen: 10 years 2 months ago
Joined: 2007-10-23 11:23
Programing Question

OK I'm designing my own programming language and I'm adding a conditional assignment feature. Which design do you prefer?


! Word Based...
int x = if (input is int): input, else: __Null__;
! ...or symbol based?
int x = ? (input is int): input || __Null__;

Ken Herbert
Ken Herbert's picture
Offline
Last seen: 2 hours 52 min ago
DeveloperModerator
Joined: 2010-05-25 18:19
The first kind of confuses me

The first kind of confuses me because having a separator (the comma) and a keyword (else) and another separator (the colon) seems redundant (although if you are using the colon as control character after keywords this becomes not-so-redundant).

Also, in most languages I have used you'll find that ternary operators are usually symbol based.

So, I would definitely go with the second.

pawelmakles1
Offline
Last seen: 11 years 8 months ago
Joined: 2012-02-13 08:14
A Little Problem

HOW ARE YOU GOING TO DESIGN YOUR OWN PROGRAMMING LANGUAGE!!! Pardon

PHP5, MySQL, Apache, Ruby, Batch, EXE, CRX (Chrome Extensions), AU3(AutoIT v3), JAVA, JAVAScript, INI, INF, Flash, Visual Basic, C, C++, Turbo C, C#, BASIC, Pascal.

Log in or register to post comments