d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Paying Fg For Java Homework > One-dimensional Array Question
Prev123Next
Add Reply New Topic New Poll
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Oct 31 2014 08:17pm
Quote (Minkomonster @ Oct 31 2014 09:50pm)
Your coworker sounds petty. Do you not have a tech lead or an architect maintaining code standards?


the oracle team has around 30 people, and they have strict standards for everything. can you believe that they're actually required to write all plsql in plain old notepad.exe? and they don't commit any code into source control (qvcs) until it goes into the test environment. one guy didn't suffix some of his variable names with _s for strings (eg: in_name_s), so the lead refused to approve it for production.

but our "java team" (by java, i mean we do everything except oracle ERP, eg python/grails/java/php/etc) of 5 people don't have strict standards. our boss saw how the oracle team handled it and didn't wanna do that to us. we use whatever technology we want to get stuff done. some of us use netbeans for java, others use intellij or eclipse. it's rare that two of us work on the same code base, so there wasn't really a need for standards. we typically just agree among ourselves on a project basis. it's only this past year that 3 of us worked on the same code so this issue came up. i have a bad habit of using short names for utility stuff i use the most. i alias my properties as p, my utility class is u, my UI utility class as ui. that really irritates my coworkers, though that's understandable. that's mostly a habit because i have a tiny ass monitor. when i use longer names, i have to h-scroll to see the entire line of code.

This post was edited by carteblanche on Oct 31 2014 08:19pm
Member
Posts: 1,995
Joined: Jun 28 2006
Gold: 7.41
Oct 31 2014 08:23pm
Code check -ins on my team are peer reviewed, and any discrepancies in standards and practices are resolved by the tech lead. His word is law. If he doesn't approve it doesn't get committed to source control.
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Oct 31 2014 08:35pm
Quote (Minkomonster @ Oct 31 2014 10:23pm)
Code check -ins on my team are peer reviewed, and any discrepancies in standards and practices are resolved by the tech lead. His word is law. If he doesn't approve it doesn't get committed to source control.


we don't have a tech lead for our team. we have 4 contractors who are all early 40s titled "java developer" and me. we're usually on different projects anyway.

on another note, we rarely get good requirements. we have a meeting or two with someone and they vaguely describe what they'd like, then we go off and build what we think they want. our tester ended up writing documentation/requirements after it's coded based on how the developers made it work, not how it was envisioned to work. would be a lot nicer if they could just hand us a document with screen mockups, business logic, data model, etc. but noooope.

all of the other 4 came from AT&T where it was documentation heavy. 90% of the job was meetings/documentation and 10% of the job was actually coding. that helped inspire how we work. anytime they wanna restart a server in production at ATT, they gotta get a meeting with the team, the boss, several vps, etc to get approval. it can take half a day or more. but here, we just talk to the DBA and ask him to bounce it and it's done before the coffee machine makes your latte.

This post was edited by carteblanche on Oct 31 2014 08:39pm
Member
Posts: 2,757
Joined: Nov 26 2007
Gold: 1,214.81
Nov 1 2014 08:37am
Code
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
int numbers[] = new int[5];
int index = 0;
Scanner scanner = new Scanner(System.in);
while (true) {
boolean error = false;
System.out.println("Enter number between 10 and 100");
int input = scanner.nextInt();
if (input < 10 || input > 100) {
System.out.println("Number must be between 10 and 100");
error = true;
}
for (int i : numbers) {
if (i == input) {
System.out.println("Number must be unique");
error = true;
}
}
if (error) {
continue;
}
numbers[index] = input;
index++;
System.out.println("Put " + input + " into array");
if (index == numbers.length) {
break;
}
}
for (int i : numbers) {
System.out.println(i);
}
}
}
Member
Posts: 1,995
Joined: Jun 28 2006
Gold: 7.41
Nov 1 2014 10:27am
Quote (labatymo @ Nov 1 2014 09:37am)
Code
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
  int numbers[] = new int[5];
  int index = 0;
  Scanner scanner = new Scanner(System.in);
  while (true) {
  boolean error = false;
  System.out.println("Enter number between 10 and 100");
  int input = scanner.nextInt();
  if (input < 10 || input > 100) {
    System.out.println("Number must be between 10 and 100");
    error = true;
  }
  for (int i : numbers) {
    if (i == input) {
    System.out.println("Number must be unique");
    error = true;
    }
  }
  if (error) {
    continue;
  }
  numbers[index] = input;
  index++;
  System.out.println("Put " + input + " into array");
  if (index == numbers.length) {
    break;
  }
  }
  for (int i : numbers) {
  System.out.println(i);
  }
}
}


hey don't you be undercutting me. My solution is robust, elegant, and extensible. It took thought to compose that design. You just threw everything in the main method like a freshman. I say boo to you.
Member
Posts: 11,881
Joined: Aug 17 2007
Gold: 0.00
Nov 1 2014 11:24am
This thread has far exceeded my expectations. :D
Member
Posts: 1,995
Joined: Jun 28 2006
Gold: 7.41
Nov 1 2014 11:27am
Quote (MidnightRider @ Nov 1 2014 12:24pm)
This thread has far exceeded my expectations.  :D


Well that statement alone is meaningless without a baseline to compare to. What exactly were your expectations?
Member
Posts: 11,881
Joined: Aug 17 2007
Gold: 0.00
Nov 1 2014 01:18pm
Quote (Minkomonster @ Nov 1 2014 01:27pm)
Well that statement alone is meaningless without a baseline to compare to. What exactly were your expectations?


I will quantify my expectations and report back within the week.
Member
Posts: 1,995
Joined: Jun 28 2006
Gold: 7.41
Nov 1 2014 01:24pm
Quote (MidnightRider @ Nov 1 2014 02:18pm)
I will quantify my expectations and report back within the week.


You're such a tease.
Member
Posts: 1,241
Joined: Jun 25 2011
Gold: Locked
Nov 2 2014 02:18am
Lol op must be so scared now
Go Back To Programming & Development Topic List
Prev123Next
Add Reply New Topic New Poll