Author Topic: private static bool GetTrue() { return true; }  (Read 7626 times)

Zakamiro

  • Hero Member
  • *****
  • Posts: 1053
  • Foxy mama.
    • View Profile
    • Someplace
Re: private static bool GetTrue() { return true; }
« Reply #15 on: June 12, 2008, 06:49:10 AM »
So, is it a worthy investment to learn C++? or would C/C# be a better alternative?

(no delphi, pascal, java, fortran, cobol, basic for me (yet) please & thanks)


We pressed on. Shortly afterwards, we arrived in a poisonous, post-apocalyptic hell - a sprawling, toxic dumping ground stretching for a mile or two. This is the final resting place for your old TV, computer or mobile phone.

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7197
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: private static bool GetTrue() { return true; }
« Reply #16 on: June 12, 2008, 08:12:03 AM »
Uhh, Java and C++ and C# are very similar. I've done quite a bit of work in Java, and actually really like the language, despite it's shortcomings. Networking is ridiculously easy in it. Networking in C++ is a PAIN, and I think C#'s networking is pretty much on par with Java's for ease of use.

If you're just learning a language to program, C# would probaby be your best bet, though C++ requires less code to do the real basic stuff (like console I/O) (of course, you can pare down C# programs quite a bit by not using the default projects from Visual Studio, lol.)

The first code I ever touched was VB6. Then I learned C++. After that, I took some highschool programming, and covered VB6 again, and learned Java. I also taught myself Turing, since they had it there (fun language, and REALLY FUCKING QUICK to write stuff in. I actually made a simple encryption engine for a small programming contest in it, despite only learning it in my spare time on school computers).

For simple programming concepts, VB or Turing (if you can find the compiler program) are simple as hell. However, VB all around blows for a lot of stuff, and Turing has syntax that isn't like C/C++.

All in all, aside from lisp, fortran, cobol, ASM, and brainfuck, you can begin learning with pretty much any language.
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

Spectere

  • \m/ (-_-) \m/
  • Administrator
  • Hero Member
  • *****
  • Posts: 5618
  • printf("%s\n", "Hi!");
    • View Profile
    • spectere.net
Re: private static bool GetTrue() { return true; }
« Reply #17 on: June 12, 2008, 09:21:34 AM »
:snip: C++ and C# are very similar.

Only in that you can migrate from one to the other without much of a problem.  C# and C++ are worlds apart as far as functionality and, for the matter, ease of use is concerned.  C# is closer to Java than C/C++.

If you're just learning a language to program, C# would probaby be your best bet, though C++ requires less code to do the real basic stuff (like console I/O)

Not really:

System.Console.WriteLine("Hello world!");

Stick that in main() and, regardless of references, you have Hello World in C#.  You need two lines to do the same thing in C++ (not including the main function declaration).

All in all, aside from [...] fortran [...] you can begin learning with pretty much any language.



Code: [Select]
INTEGER FLAG
100 READ(1,100) A,B,C,LC
IF(LC-9) 1,99,1
FORMAT(3F10.0,T80,I1)
10 CALL QUAD(A,B,C,X1,X2,FLAG)
WRITE(3,11) A,B,C
11 FORMAT('0A =',F11.0,2X,'B =',F11.0,2X,'C =',F11.0)
IF(FLAG-1) 20,30,20
20 WRITE(3,13) X1,X2
13 FORMAT('+',T50,'X1 =',F11.3,2X,'X2 =',F11.3)
GO TO 100
99 STOP
END

SUBROUTINE QUAD(A,B,C,X1,X2,FLAG)
INTEGER FLAG
FLAG=0
IF(A) 1,20,1
1 DISC=B**2-4.*A*C
IF(DISC) 30,2,2
2 X1=(-B+SQRT(DISC))/(2.*A)
X2=(-B-SQRT(DISC))/(2.*A)
RETURN
20 X1=-C/B
X2=X1
RETURN
30 FLAG=1
RETURN
END

YEAH FORTRAN!
"This is a machine for making cows."

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7197
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: private static bool GetTrue() { return true; }
« Reply #18 on: June 12, 2008, 09:27:49 AM »
COBOL = Completely Obsolete, Boring Old Language.

There was one for FORTRAN, but I've forgotten :/
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

Spectere

  • \m/ (-_-) \m/
  • Administrator
  • Hero Member
  • *****
  • Posts: 5618
  • printf("%s\n", "Hi!");
    • View Profile
    • spectere.net
Re: private static bool GetTrue() { return true; }
« Reply #19 on: June 12, 2008, 12:54:54 PM »
Don't knock COBOL too badly; it's still in semi-heavy use today.  Also, how many standard languages have programs that look like this?

Code: [Select]
       IDENTIFICATION DIVISION.
       PROGRAM-ID.    BOTTLE99.
       AUTHOR.        BILL BASS.
       DATE-WRITTEN.  APR 2008.
       DATE-COMPILED.
      *REMARKS.
      ******************************************************************
      * PURPOSE:
      *   THIS IS A DEMONSTRATION SAMPLE OF A COBOL II PROGRAM.
      *   IT WRITES AN 80 COLUMN OUTPUT FILE CONTAINING THE LYRICS OF
      *   THE SONG "99 BOTTLES OF BEER ON THE WALL".  IT DOES NOT NEED
      *   TO BE AS COMPLEX AS IT IS.  THIS WAS NOT AN ATTEMPT TO WRITE
      *   A "SHORT" PROGRAM OR A "MOST EFFICIENT" PROGRAM.  IT WAS
      *   INTENDED TO SERVE AS AN EXAMPLE OF WHAT ONE MIGHT COMMONLY
      *   SEE IN A "TYPICAL" MAINFRAME COBOL PROGRAM.
      ******************************************************************
       ENVIRONMENT DIVISION.
      ******************************************************************
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT LYRICS-FILE              ASSIGN TO LYRICS.
      ******************************************************************
       DATA DIVISION.
      ******************************************************************
       FILE SECTION.
       FD  LYRICS-FILE
           LABEL RECORDS ARE STANDARD
           RECORDING MODE IS F
           BLOCK CONTAINS    0 RECORDS
           DATA RECORD IS LYRICS-REC.

       01  LYRICS-REC                      PIC X(80).
      *
       WORKING-STORAGE SECTION.
       01  WORK-AREAS.
           05 WS-LYRICS-WRITTEN            PIC S9(8) COMP VALUE ZERO.
           05 WS-BOTTLE-NUM                PIC S9(4) COMP VALUE ZERO.
           05 WS-WHEN-COMPILED.
              10 WS-COMP-DATE.
                 15 WS-COMP-YEAR           PIC 9(4) VALUE ZERO.
                 15 WS-COMP-MON            PIC 9(2) VALUE ZERO.
                 15 WS-COMP-DAY            PIC 9(2) VALUE ZERO.
              10 WS-COMP-TIME.
                 15 WS-COMP-HOUR           PIC 9(2) VALUE ZERO.
                 15 WS-COMP-MIN            PIC 9(2) VALUE ZERO.
                 15 WS-COMP-SEC            PIC 9(2) VALUE ZERO.
                 15 WS-COMP-HSEC           PIC 9(2) VALUE ZERO.
                 15 WS-COMP-TZ-DIR         PIC X(1) VALUE SPACES.
                 15 WS-COMP-TZ-HOUR        PIC 9(2) VALUE ZERO.
                 15 WS-COMP-TZ-MIN         PIC 9(2) VALUE ZERO.
           05 WS-CURR-DATE                 PIC 9(8) VALUE ZERO.
           05 FILLER                       REDEFINES WS-CURR-DATE.
              10 WS-CURR-YEAR              PIC 9(4).
              10 WS-CURR-MON               PIC 9(2).
              10 WS-CURR-DAY               PIC 9(2).
           05 WS-CURR-TIME                 PIC 9(8) VALUE ZERO.
           05 FILLER                       REDEFINES WS-CURR-TIME.
              10 WS-CURR-HOUR              PIC 9(2).
              10 WS-CURR-MIN               PIC 9(2).
              10 WS-CURR-SEC               PIC 9(2).
              10 WS-CURR-HSEC              PIC 9(2).
           05 WS-DISPLAY-NUM               PIC --,---,--9 VALUE ZERO.
      *
       01  BEER-2-DIGIT.
           05 B2D-BOTTLES-1                PIC 99         VALUE ZERO.
           05 FILLER                       PIC X(30)      VALUE
              ' bottles of beer on the wall, '.
           05 B2D-BOTTLES-2                PIC 99         VALUE ZERO.
           05 FILLER                       PIC X(46)      VALUE
              ' bottles of beer.'.
      *
       01  BEER-1-DIGIT.
           05 B1D-BOTTLES-1                PIC 9          VALUE ZERO.
           05 FILLER                       PIC X(30)      VALUE
              ' bottles of beer on the wall, '.
           05 B1D-BOTTLES-2                PIC 9          VALUE ZERO.
           05 FILLER                       PIC X(48)      VALUE
              ' bottles of beer.'.
      *
       01  BEER-1-MORE.
           05 FILLER                       PIC X(30)      VALUE
              '1 bottle of beer on the wall, '.
           05 FILLER                       PIC X(50)      VALUE
              '1 bottle of beer.'.
      *
       01  BEER-NO-MORE.
           05 FILLER                       PIC X(37)      VALUE
              'No more bottles of beer on the wall, '.
           05 FILLER                       PIC X(43)      VALUE
              'no more bottles of beer.'.
      *
       01  TAKE-2-DIGIT.
           05 FILLER                       PIC X(34)      VALUE
              'Take one down and pass it around, '.
           05 T2D-BOTTLES-1                PIC 99         VALUE ZERO.
           05 FILLER                       PIC X(44)      VALUE
              ' bottles of beer on the wall.'.
      *
       01  TAKE-1-DIGIT.
           05 FILLER                       PIC X(34)      VALUE
              'Take one down and pass it around, '.
           05 T1D-BOTTLES-1                PIC 9          VALUE ZERO.
           05 FILLER                       PIC X(45)      VALUE
              ' bottles of beer on the wall.'.
      *
       01  TAKE-1-MORE.
           05 FILLER                       PIC X(34)      VALUE
              'Take one down and pass it around, '.
           05 FILLER                       PIC X(46)      VALUE
              '1 bottle of beer on the wall.'.
      *
       01  TAKE-NO-MORE.
           05 FILLER                       PIC X(34)      VALUE
              'Take one down and pass it around, '.
           05 FILLER                       PIC X(46)      VALUE
              'no more bottles of beer on the wall.'.
      *
       01  BUY-SOME-MORE.
           05 FILLER                       PIC X(35)      VALUE
              'Go to the store and buy some more, '.
           05 FILLER                       PIC X(45)      VALUE
              '99 bottles of beer on the wall.'.
      *
       01  BLANK-LINE                      PIC X(80)      VALUE SPACES.
      ******************************************************************
       PROCEDURE DIVISION.
      ******************************************************************
           ACCEPT WS-CURR-DATE           FROM DATE YYYYMMDD
           ACCEPT WS-CURR-TIME           FROM TIME
           MOVE FUNCTION WHEN-COMPILED     TO WS-WHEN-COMPILED
      *
           DISPLAY '****************************************'
                   '****************************************'
           DISPLAY '**** BEGIN PROGRAM BOTTLE99'
           DISPLAY '**** COMPILED: '
                   WS-COMP-YEAR '/' WS-COMP-MON '/' WS-COMP-DAY ' '
                   WS-COMP-HOUR ':' WS-COMP-MIN ':'
                   WS-COMP-SEC  '.' WS-COMP-HSEC
           DISPLAY '**** START AT: '
                   WS-CURR-YEAR '/' WS-CURR-MON '/' WS-CURR-DAY ' '
                   WS-CURR-HOUR ':' WS-CURR-MIN ':'
                   WS-CURR-SEC  '.' WS-CURR-HSEC
           DISPLAY '****************************************'
                   '****************************************'
           DISPLAY '*'
      *
           OPEN OUTPUT LYRICS-FILE
      *
           MOVE 99                         TO B2D-BOTTLES-1
           MOVE 99                         TO B2D-BOTTLES-2
           WRITE LYRICS-REC              FROM BEER-2-DIGIT
           ADD +1                          TO WS-LYRICS-WRITTEN
      *
           PERFORM 1000-MATCHING-VERSES    THRU 1000-EXIT
               VARYING WS-BOTTLE-NUM FROM 98 BY -1
               UNTIL WS-BOTTLE-NUM < 2
      *
           WRITE LYRICS-REC              FROM TAKE-1-MORE
           WRITE LYRICS-REC              FROM BLANK-LINE
           ADD +2                          TO WS-LYRICS-WRITTEN
      *
           WRITE LYRICS-REC              FROM BEER-1-MORE
           WRITE LYRICS-REC              FROM TAKE-NO-MORE
           WRITE LYRICS-REC              FROM BLANK-LINE
           ADD +3                          TO WS-LYRICS-WRITTEN
      *
           WRITE LYRICS-REC              FROM BEER-NO-MORE
           WRITE LYRICS-REC              FROM BUY-SOME-MORE
           ADD +2                          TO WS-LYRICS-WRITTEN
      *
           CLOSE LYRICS-FILE
      *
           DISPLAY '****************************************'
                   '****************************************'
           DISPLAY '**** RUN STATISTICS FOR PROGRAM BOTTLE99'
           DISPLAY '****************************************'
                   '****************************************'
           DISPLAY '*'
           MOVE WS-LYRICS-WRITTEN          TO WS-DISPLAY-NUM
           DISPLAY '* LYRICS RECORDS WRITTEN = ' WS-DISPLAY-NUM
           DISPLAY '*'
      *
           DISPLAY '****************************************'
                   '****************************************'
           DISPLAY '**** END PROGRAM BOTTLE99'
           ACCEPT WS-CURR-DATE           FROM DATE YYYYMMDD
           ACCEPT WS-CURR-TIME           FROM TIME
           DISPLAY '**** ENDED AT: '
                   WS-CURR-YEAR '/' WS-CURR-MON '/' WS-CURR-DAY ' '
                   WS-CURR-HOUR ':' WS-CURR-MIN ':'
                   WS-CURR-SEC  '.' WS-CURR-HSEC
           DISPLAY '****************************************'
                   '****************************************'
      *
           GOBACK.
      *****************************************************************
      *    THIS PARAGRAPH WRITES THE FIRST 98 MATCHING VERSES
      *****************************************************************
       1000-MATCHING-VERSES.
      *****************************************************************
           IF WS-BOTTLE-NUM > 9
               MOVE WS-BOTTLE-NUM          TO T2D-BOTTLES-1
               MOVE WS-BOTTLE-NUM          TO B2D-BOTTLES-1
               MOVE WS-BOTTLE-NUM          TO B2D-BOTTLES-2

               WRITE LYRICS-REC          FROM TAKE-2-DIGIT
               WRITE LYRICS-REC          FROM BLANK-LINE
               WRITE LYRICS-REC          FROM BEER-2-DIGIT
               ADD +3                      TO WS-LYRICS-WRITTEN
           ELSE
               MOVE WS-BOTTLE-NUM          TO T1D-BOTTLES-1
               MOVE WS-BOTTLE-NUM          TO B1D-BOTTLES-1
               MOVE WS-BOTTLE-NUM          TO B1D-BOTTLES-2

               WRITE LYRICS-REC          FROM TAKE-1-DIGIT
               WRITE LYRICS-REC          FROM BLANK-LINE
               WRITE LYRICS-REC          FROM BEER-1-DIGIT
               ADD +3                      TO WS-LYRICS-WRITTEN
           END-IF
           .
       1000-EXIT. EXIT.

NOT ENOUGH!  ...thankfully
"This is a machine for making cows."

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7197
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: private static bool GetTrue() { return true; }
« Reply #20 on: June 12, 2008, 03:37:42 PM »
Wow, an "english" programming language. Too bad it takes too much code to be practical :/
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

Spectere

  • \m/ (-_-) \m/
  • Administrator
  • Hero Member
  • *****
  • Posts: 5618
  • printf("%s\n", "Hi!");
    • View Profile
    • spectere.net
Re: private static bool GetTrue() { return true; }
« Reply #21 on: June 12, 2008, 06:34:13 PM »
Indeed.  The programmers in the last 50s and 60s were masochists.

In all honesty, the COBOL parser is pretty impressive.  You can literally make a lot of statements as terse or verbose as your little black heart desires.  One example that the Wikipedia page has deals solving the quadratic equation (x = (-b
"This is a machine for making cows."

Zakamiro

  • Hero Member
  • *****
  • Posts: 1053
  • Foxy mama.
    • View Profile
    • Someplace
Re: private static bool GetTrue() { return true; }
« Reply #22 on: June 12, 2008, 11:22:08 PM »
so, visual c++ 2005. worthy investment?


We pressed on. Shortly afterwards, we arrived in a poisonous, post-apocalyptic hell - a sprawling, toxic dumping ground stretching for a mile or two. This is the final resting place for your old TV, computer or mobile phone.

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7197
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: private static bool GetTrue() { return true; }
« Reply #23 on: June 12, 2008, 11:42:20 PM »
Ugh, quite honestly, if you're going to learn a language, don't shell out money to do so. You can obtain VC++ through a PERFECTLY LEGITIMATE site, or you could use one of the MANY free C++ IDEs.
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

Spectere

  • \m/ (-_-) \m/
  • Administrator
  • Hero Member
  • *****
  • Posts: 5618
  • printf("%s\n", "Hi!");
    • View Profile
    • spectere.net
Re: private static bool GetTrue() { return true; }
« Reply #24 on: June 13, 2008, 12:12:45 AM »
You can obtain VC++ through a PERFECTLY LEGITIMATE site, or you could use one of the MANY free C++ IDEs.

What are you talking about?  Microsoft's been providing free development tools for years:

http://www.microsoft.com/express/

So no, don't spend money on it when you can download it, legally, for free.  The only thing that the express editions lack are mainly enterprise-level tools (Crystal Reports, versioning control, etc).  You can even get an express edition of SQL Server if you want.
"This is a machine for making cows."

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7197
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: private static bool GetTrue() { return true; }
« Reply #25 on: June 13, 2008, 12:26:44 PM »
I forgot about express. Plus, why get 2005 express when they now have 2008 express?
This is going in my sig. :)

BANNED FOR BAD PUNS X_x

Zakamiro

  • Hero Member
  • *****
  • Posts: 1053
  • Foxy mama.
    • View Profile
    • Someplace
Re: private static bool GetTrue() { return true; }
« Reply #26 on: June 14, 2008, 09:18:44 AM »
I actually have a legit copy of visual studio 2005 pro or w/e. pretty interesting when you use both vbasic and c++ to work on the same project in it.  I think I'm going to go read through my books and learn it. :>


(probably both my C++ Primer, 3rd Ed. and Ivor Horton's Beginning Visual C++ 2005.)

Edit:

I'll make a timeline thread about my learnings of c++. Here's the link:  http://www.spectere.net/smf/index.php?topic=583.0
« Last Edit: June 14, 2008, 03:56:02 PM by Zakamiro »


We pressed on. Shortly afterwards, we arrived in a poisonous, post-apocalyptic hell - a sprawling, toxic dumping ground stretching for a mile or two. This is the final resting place for your old TV, computer or mobile phone.

Bobbias

  • #1 Poster
  • Hero Member
  • *****
  • Posts: 7197
  • 404 Avatar not found.
    • View Profile
    • Magnetic Architect
Re: private static bool GetTrue() { return true; }
« Reply #27 on: June 14, 2008, 10:07:43 AM »
Nice link, lol.
This is going in my sig. :)

BANNED FOR BAD PUNS X_x