The Glade 4.0

"Turn the lights down, the party just got wilder."
It is currently Sun Nov 24, 2024 12:06 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 67 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
PostPosted: Fri Mar 04, 2016 3:09 pm 
Offline
Web Ninja
User avatar

Joined: Wed Sep 02, 2009 8:32 pm
Posts: 8248
Location: The Tunt Mansion
Can confirm government loves Java for some reason. Buddy develops for the court here and everything they do is old, poorly-written Java.


Top
 Profile  
Reply with quote  
PostPosted: Sat Mar 05, 2016 7:55 am 
Offline
God of the IRC
User avatar

Joined: Wed Sep 02, 2009 7:35 pm
Posts: 3041
Location: The United States of DESU
I can think of two popular uses of Java: Android app development and Minecraft modding.

_________________
Image


Top
 Profile  
Reply with quote  
PostPosted: Sat Mar 05, 2016 7:36 pm 
Offline
Commence Primary Ignition
User avatar

Joined: Thu Sep 03, 2009 9:59 am
Posts: 15740
Location: Combat Information Center
Mookhow wrote:
I can think of two popular uses of Java: Android app development and Minecraft modding.


I've heard that you can develop little apps in Java and sell them for a buck or two on the Google store thingy and expect to make $50 or a $100 or so just from people idly purchasing them. Is there any truth to that?

Also, here is my next project. I won't keep bugging you guys with every trivial book exercise but I did try to incorporate some feedback from my first program to get this. If you input a number, it finds the next prime number above it.

Code:
// ConsoleApplication3.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
#include <cmath>
using namespace std;

bool primenotfound(int checkplus);


int main()
{
   int checkfrom = 0;
   cout << "To determine the NEXT prime number, enter an integer: ";
   cin >> checkfrom;  // Find the next number that is prime above this one, regardless if this one is prime
   int checkplus = checkfrom + 1; // Start checking with this value
   while (primenotfound(checkplus)) {
      primenotfound(checkplus);  // go to function to check prime value
      ++checkplus;  // increase to the next value to check
   }
   cout << endl << "The next prime number after " << checkfrom << " is: " << checkplus << endl; //result output
    return 0;
}

bool primenotfound(int checkplus) {
   int checkroot = sqrt(checkplus);
   for (int counter = 2; counter <= checkroot; ++counter) {  //perform until a factor is found
      if (checkplus % counter == 0) {
         return true;  // a factor was found
      }
   }
   return false; // a factor was not found
}

_________________
"Hysterical children shrieking about right-wing anything need to go sit in the corner and be quiet while the adults are talking."


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Mar 07, 2016 9:58 am 
Offline
Deuce Master

Joined: Thu Sep 03, 2009 9:45 am
Posts: 3099
As you start coding more and larger things, be sure to start commenting up your code. At the very least, a comment describing the purpose of the functions you write. It can really help you later on when you want to reuse a function in something else, but don't necessarily remember a component name and searching fails you.

And if any other developer has to support your code, they need to know what the crap is going on. They shouldn't have to spend 20 minutes evaluating a function to figure out what it's for. But I know right now this is just a hobby for you.

_________________
The Dude abides.


Top
 Profile  
Reply with quote  
 Post subject: Re:
PostPosted: Mon Mar 07, 2016 10:42 am 
Offline
Commence Primary Ignition
User avatar

Joined: Thu Sep 03, 2009 9:59 am
Posts: 15740
Location: Combat Information Center
Screeling wrote:
As you start coding more and larger things, be sure to start commenting up your code. At the very least, a comment describing the purpose of the functions you write. It can really help you later on when you want to reuse a function in something else, but don't necessarily remember a component name and searching fails you.

And if any other developer has to support your code, they need to know what the crap is going on. They shouldn't have to spend 20 minutes evaluating a function to figure out what it's for. But I know right now this is just a hobby for you.


Heh, I don't think I will have any code written that anyone will need to support any time soon! But that's good advice; I can see where down the road I'd write something, then come back to it later and wonder what in the hell I had written.

_________________
"Hysterical children shrieking about right-wing anything need to go sit in the corner and be quiet while the adults are talking."


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 07, 2016 3:10 pm 
Offline
Web Ninja
User avatar

Joined: Wed Sep 02, 2009 8:32 pm
Posts: 8248
Location: The Tunt Mansion
It's also for you as much as it is for anyone else. Occasionally you'll go back to something you did 6 months ago and wont know wtf you were thinking when you made it.

Generally when I program anything, I comment out the process of what I plan to do at the very start. It helps you outline your entire project/class/function/method, identify things that may repeat (gotta stay DRY), and generally get a good understanding of what you have to do before you actually do it.

Code:
// -- Method Outline --
// Identify vars
// Populate initial states
// Update values on click/set/interaction
    // When done, hide this thing, set other thing


We aren't typing the same languages but forcing myself to outline things when I first started was a great help to not only starting off right, but also not getting lost in the middle of my work and not knowing where to go next. Sometimes you have a lot of moving parts and you forget where to go.


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 07, 2016 4:36 pm 
Offline

Joined: Sun Sep 06, 2009 12:09 pm
Posts: 733
I usually flowchart my more complex code on my whiteboard. When it comes to commenting I usually have 2 or 3 lines of comments per line of code.

Sent from my SM-G900V using Tapatalk


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Mar 07, 2016 6:30 pm 
Offline

Joined: Wed Sep 02, 2009 10:49 pm
Posts: 3455
Location: St. Louis, MO
You'll never win like that.
http://www.ioccc.org/

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject: Re:
PostPosted: Mon Mar 07, 2016 9:27 pm 
Offline
Commence Primary Ignition
User avatar

Joined: Thu Sep 03, 2009 9:59 am
Posts: 15740
Location: Combat Information Center
shuyung wrote:
You'll never win like that.
http://www.ioccc.org/


lol

Is there a bonus if you win unintentionally?

_________________
"Hysterical children shrieking about right-wing anything need to go sit in the corner and be quiet while the adults are talking."


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 07, 2016 9:45 pm 
Offline

Joined: Sun Sep 06, 2009 12:09 pm
Posts: 733
Diamondeye wrote:
shuyung wrote:
You'll never win like that.
http://www.ioccc.org/


lol

Is there a bonus if you win unintentionally?
I've worked with more than a few guys who could win it accidentally...


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Mar 13, 2016 5:23 pm 
Offline
Sensitive Ponytail Guy
User avatar

Joined: Fri Sep 04, 2009 10:18 pm
Posts: 2765
I used to do the "no comments" thing deliberately. Subscribed to the "if you can't understand it without comments, you shouldn't be reading it" philosophy. In theory, I now believe in the usefulness of comments ... but I still don't write 'em as often as I should.

_________________
Go back to zero, take a pill, and get well ~ Lemmy Kilmister


Top
 Profile  
Reply with quote  
PostPosted: Sun Mar 13, 2016 6:41 pm 
Offline

Joined: Sun Sep 06, 2009 12:09 pm
Posts: 733
Shelgeyr wrote:
I used to do the "no comments" thing deliberately. Subscribed to the "if you can't understand it without comments, you shouldn't be reading it" philosophy. In theory, I now believe in the usefulness of comments ... but I still don't write 'em as often as I should.
I had a guy like that who worked for me. He changed his tune after I made him write an 8 page essay on the importance of commenting his code. A shame I'm not going to be able to do stuff like that now that I'm all civilianified...

Making him work on some uncommented code written 20 years prior probably helped convince him, too, now that I think about it.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Mar 13, 2016 10:00 pm 
Offline

Joined: Thu Sep 03, 2009 10:03 am
Posts: 4922
I think comments should be used sparingly. Good code is generally readable self-documenting.


Top
 Profile  
Reply with quote  
PostPosted: Fri Mar 18, 2016 12:24 pm 
Offline

Joined: Sun Sep 06, 2009 12:09 pm
Posts: 733
It really isn't, and comments aren't really for you, but for the poor guy who has to figure your code out 5 years down the road.

Sent from my SM-G900V using Tapatalk


Top
 Profile  
Reply with quote  
PostPosted: Fri Mar 18, 2016 3:17 pm 
Offline
Commence Primary Ignition
User avatar

Joined: Thu Sep 03, 2009 9:59 am
Posts: 15740
Location: Combat Information Center
You guys are terrifying me. :shock:

_________________
"Hysterical children shrieking about right-wing anything need to go sit in the corner and be quiet while the adults are talking."


Top
 Profile  
Reply with quote  
PostPosted: Fri Mar 18, 2016 5:05 pm 
Offline

Joined: Sun Sep 06, 2009 12:09 pm
Posts: 733
If you've got a knack for it, coding really isn't that hard...the hardest part is keeping current on whatever language or framework is the flavor of the week.

Sent from my SM-G900V using Tapatalk


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 21, 2016 10:30 am 
Offline
Deuce Master

Joined: Thu Sep 03, 2009 9:45 am
Posts: 3099
Timmit wrote:
It really isn't, and comments aren't really for you, but for the poor guy who has to figure your code out 5 years down the road.

Pretty much this. Always assume the guy supporting your code is a violent psychopath that knows where you live.

_________________
The Dude abides.


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 21, 2016 2:38 pm 
Offline
Commence Primary Ignition
User avatar

Joined: Thu Sep 03, 2009 9:59 am
Posts: 15740
Location: Combat Information Center
Screeling wrote:
Timmit wrote:
It really isn't, and comments aren't really for you, but for the poor guy who has to figure your code out 5 years down the road.

Pretty much this. Always assume the guy supporting your code is a violent psychopath that knows where you live.


I already own a 12-gauge, so I have that covered.

_________________
"Hysterical children shrieking about right-wing anything need to go sit in the corner and be quiet while the adults are talking."


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 21, 2016 5:51 pm 
Offline

Joined: Sun Sep 06, 2009 12:09 pm
Posts: 733
Diamondeye wrote:
Screeling wrote:
Timmit wrote:
It really isn't, and comments aren't really for you, but for the poor guy who has to figure your code out 5 years down the road.

Pretty much this. Always assume the guy supporting your code is a violent psychopath that knows where you live.


I already own a 12-gauge, so I have that covered.
My M1a outranges your 12 gauge and 20 years of maintaining uncommented code has made me patient...comment your code ;)


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 22, 2016 8:44 am 
Offline
Commence Primary Ignition
User avatar

Joined: Thu Sep 03, 2009 9:59 am
Posts: 15740
Location: Combat Information Center
Timmit wrote:
Diamondeye wrote:
Screeling wrote:
Timmit wrote:
It really isn't, and comments aren't really for you, but for the poor guy who has to figure your code out 5 years down the road.

Pretty much this. Always assume the guy supporting your code is a violent psychopath that knows where you live.


I already own a 12-gauge, so I have that covered.
My M1a outranges your 12 gauge and 20 years of maintaining uncommented code has made me patient...comment your code ;)


Inside the house, range doesn't matter - and I'm not too frightened of Air Force guys on the ground. :mrgreen:

_________________
"Hysterical children shrieking about right-wing anything need to go sit in the corner and be quiet while the adults are talking."


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 23, 2016 8:20 am 
Offline
Eatin yur toes.
User avatar

Joined: Mon Sep 07, 2009 2:49 am
Posts: 836
Python for ease of use. Java if you want a big corp job. C/C++ if you want to move into smaller mobile or desktop app/game dev (where you'll then have the joy of all the variants and ecosystems - objective C, .Net/C#, - and the boutique breakouts like SWIFT rust and go... Joy :p)

Java Is Not Dead if you want a salary job.


Sent from my iPhone using Tapatalk


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Mar 23, 2016 10:48 pm 
Offline

Joined: Thu Sep 03, 2009 10:03 am
Posts: 4922
Also C if you want to do operating systems development on *nix devices.


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 23, 2016 11:28 pm 
Offline
Commence Primary Ignition
User avatar

Joined: Thu Sep 03, 2009 9:59 am
Posts: 15740
Location: Combat Information Center
If you guys are talking to me still, I'm not anywhere near developing operating systems.

_________________
"Hysterical children shrieking about right-wing anything need to go sit in the corner and be quiet while the adults are talking."


Top
 Profile  
Reply with quote  
PostPosted: Thu Mar 24, 2016 12:17 am 
Offline
Web Ninja
User avatar

Joined: Wed Sep 02, 2009 8:32 pm
Posts: 8248
Location: The Tunt Mansion
This is just hobby learning, Lex.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Mar 24, 2016 7:20 pm 
Offline

Joined: Wed Sep 02, 2009 10:49 pm
Posts: 3455
Location: St. Louis, MO
It's a short step from that to kernel developer.

_________________
Image


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 67 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 73 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group