Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Socracheese
Oct 20, 2008

SPIDERS POST DIGGER

Adbot
ADBOT LOVES YOU

double sulk
Jul 2, 2010

Cocoa Crispies posted:

if software is easy why do you have to go to college for it

if only i didn't have a poo poo gpa/the ridiculous amount of money necessary to go back to college :sigh:

gently caress loans

Zizzyx
Sep 18, 2007

INTERGALACTIC CAN CHAMPION

socracheese just a small piece of advice for you, if you don't want your fuckups being used to belittle you maybe you shouldn't post them

also maybe keep your opinions on math to yourself as well

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Zizzyx posted:

socracheese just a small piece of advice for you, if you don't want your fuckups being used to belittle you maybe you shouldn't post them

also maybe keep your opinions on math to yourself as well

or at least be humble

Toady
Jan 12, 2009

always gently caress up humbly

cleanhands
Jun 9, 2010

My opinions, though not completely awful are expressed in a tiresome and needlessly aggressive way. Please help me to chill out.
always gently caress up so big that you get promoted because of it

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.
resume generating event

Max Facetime
Apr 18, 2009

vapid cutlery posted:

the worst part of programming is developing software yea

Max Facetime
Apr 18, 2009

the worst part of sex is developing a boner

Sneaking Mission
Nov 11, 2008

i was working on something where calculating a convex hull of some stuff would of been kind of usefull but i decided i didnt care enough to spend time on it and noone else noticed

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>

Panic! At The cisco posted:

i was working on something where calculating a convex hull of some stuff would of been kind of usefull but i decided i didnt care enough to spend time on it and noone else noticed

use computational geometry in c

Sneaking Mission
Nov 11, 2008

nah

Meiwaku
Jan 10, 2011

Fun for the whole family!

Panic! At The cisco posted:

i was working on something where calculating a convex hull of some stuff would of been kind of usefull but i decided i didnt care enough to spend time on it and noone else noticed

-- Your friendly local nuclear power monitoring agency

buttcoin smuggler
Jun 25, 2011

Panic! At The cisco posted:

i was working on something where calculating a convex hull of some stuff would of been kind of usefull but i decided i didnt care enough to spend time on it and noone else noticed

there's an app for that

double sulk
Jul 2, 2010

buttcoin smuggler
Jun 25, 2011

detroit
Nov 11, 2009
trying to make a website should i learn python or erlang?

Nomnom Cookie
Aug 30, 2009



detroit posted:

trying to make a website should i learn python or erlang?

learn http

gangnam reference
Dec 26, 2010

shut up idiot shut up idiot shut up idiot shut up idiot

detroit posted:

trying to make a website should i learn python or erlang?

yeah id say php is pretty great for that maybe some lua on the side if you need a backend id say javascript maybe cakescript

Toady
Jan 12, 2009

build it with slashcode

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

detroit posted:

trying to make a website should i learn python or erlang?

erlang is entirely the wrong tool

learn html

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum

trex eaterofcadrs posted:

sorry kid, it's true, every single person that i respect as a programmer will readily admit the human race is writing poo poo software at this stage of the game

that doesn't mean everyone is a bad programmer, you do the best with what you've got

Zarithas
Jun 18, 2008

detroit posted:

trying to make a website should i learn python or erlang?
haskell is a prerequisite for any kind of web programming nowadays

you'll have to write your own haskell -> coffeescript -> javascript compiler, but that's par for the course

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror

detroit posted:

trying to make a website should i learn python or erlang?

learn php i guarantee you whatever you want to do will be easier than in python

buttcoin smuggler
Jun 25, 2011

Cocoa Crispies posted:

erlang is entirely the wrong tool

learn html

html programmers are always in high demand. good thing to put on your resumé imo

Nomnom Cookie
Aug 30, 2009



learn http and make a rest api. provide html, json and xml from each endpoint

0xB16B00B5
Aug 24, 2006

by Y Kant Ozma Post
Write your whole website in JavaScript and you can port it easily to windows 8 style ui apps

Meiwaku
Jan 10, 2011

Fun for the whole family!

Zarithas posted:

haskell is a prerequisite for any kind of web programming nowadays

you'll have to write your own haskell -> coffeescript -> javascript compiler, but that's par for the course

Listen to this wisdom.
Everyone else is making jokes at your expense.

tef
May 30, 2004

-> some l-system crap ->

Tiny Bug Child posted:

learn php i guarantee you whatever you want to do will be easier than in python

unless it involves writing non-white-power software that supports unicode

tef
May 30, 2004

-> some l-system crap ->
but yeah, assuming you don't have to do database stuff, user authentication, management,

and all you're doing is writing a bunch of html templates in ascii or latin-1.

then, yeah php is pretty easy. it's probably the easiest way to write a cgi-bin script.

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror

tef posted:

but yeah, assuming you don't have to do database stuff, user authentication, management,

php is really good at that stuff though

MononcQc
May 29, 2007

tef posted:

unless it involves writing non-white-power software that supports unicode

that's racist there's plenty of white people with funky characters in their alphabets

Meiwaku
Jan 10, 2011

Fun for the whole family!

MononcQc posted:

that's racist there's plenty of white people with funky characters in their alphabets

No, thats just disturbingly ignorant. ��

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror
there are 256 characters. the others are pretend. unicode is a fake idea.

Star War Sex Parrot
Oct 2, 2003

JPL Institutional Coding Standard for the C Programming Language

Sapozhnik
Jan 2, 2005

Nap Ghost
If you need explicit coding standards then your development team consists of either idiots or prima donnas, congrats

(it is very hard to find programmers who aren't one of the two, i'm a huge prima donna myself :smug: )

JawnV6
Jul 4, 2004

So hot ...
no, they just have to do things the Right way. you don't get a second shot in that line of work

that being said, if you had real competition they'd eat you alive shipping crap and iterating on it

Star War Sex Parrot
Oct 2, 2003

adaz posted:

There are 31 separate rules but a few major ones. I'll briefly go over the ones I understand.

1.) No compiler warnings/errors. Compilers are the things that turn the C programming language (which is more or less human readable) into the actual executable code used by the processors which isn't very human readable. The compilers have a large number of checks and warnings they can generate before compiling code as basic sanity checks. For your poo poo to make it into the codebase not a single warning or error can be thrown by the compiler even if that warning or error is, in fact, the compiler being wrong. This can be uncommon because the compilers with all their warnings turned on (And they have a LOT of warnings) are pretty hard to satisfy for some things. Most places are "compiles without any explicit errors and oh maybe this warning subset." The we don't care that its the compiler being wrong, fix it anyway is a check against people outsmarting themselves, i.e. believing its a compiler problem when in fact they didn't think of something.

2.) Every loop must have hard coded bounds. A loop is a programming element that, basically, says For <condition> do <something>. It's pretty common to have loops that say For all the things in this collection do X. Every loop must have a hard coded max # of times it'll iterate through (Fairly uncommon) to prevent an infinite loop even when such a thing should be impossible. For example, say I have a loop that says check the antennas (we have 2 antennas) to make sure they have power. Normally you wouldn't bother adding a bounds check on something like that (there are only 2 physical antennas!) but in this case you do no matter what to prevent the impossible - maybe a stray cosmic ray caused a bit to flip and now you have 8 antennas - from causing real problems.

3.) NO recursion ever. Which is really uncommon in my experience. Recursion is an element that can call itself. So say we have a piece of code that can add two numbers. Well, if it can recurse that means that same function can call itself (Adding two numbers) again if it wanted to. Again, trying to prevent an infinite loop, stack overflows (too much data waiting to be processed basically) and simplifying code complexity in theory.

4.) All tasks must communicate through an IPC form. IPC is inter-process communication. A process is basically a single element of a program, say in a spacecraft a process could be the part of the software that watches the fuel pressure/temperature. So if it's checking the amount of pressure in the fuel tanks it should report that information via some defined IPC form rather than directly modifying the FUEL_PRESSURE variable or whatever in the engine control software. With IPC you would do something like call a method on the Engine Control Software called UpdateFueldPressure or something and let the engine software handle updating its own data. This prevents some rogue element from corrupting your engine control routine and allows the engine routine to check all inputs for errors.

5.) A bunch of rules on tasks/task delay/and use of semaphores. Basically designed to avoid race conditions and data corruption. Makes coding much harder but prevents an enormous amount of bugs, even if for them to occur would be "nearly" impossible (sensing a theme?)

6.) No GOTO statements. This is basically a universal rule of programming anymore - most modern languages don't even have a goto statement - goto breaks control flow and destroys code clarity. So a typical program might look like this:

code:
1  If($variable equals 0){
2    $isPressured = PressurizeEngine()
3    if($isPressured equals True) {
4      ShutDownThrusters
5     }
6  }Elseif($variable equals 1) {
7    RotateThrusters()
8  }Else {
9    If($variable equals 5) {
10     FireThrusters
11   }Else {
12     ERROR
13   }
14 }
Ok it's a mildly terrible example (we're nesting too many calls), but the idea is that if a variable equals some value we execute some engine control function. But say we add a GOTO in that.

code:

1  If($variable equals 0){
2    $isPressured = DePressurizeEngine()
3    if($isPressured equals False) {
4      ShutDownThrusters
5     }
6  }Elseif($variable equals 1) {
7    DoSOmething else
8  }Else {
9    If($variable equals 5) {
10     FireThrusters
11   }Else {
12     GOTO 3
13     ERROR
14   }
15 }
SO now if the variable doesn't equal 0,1, or 5 we return an error code but oh wait, before that shutdownthrusters by going to line 4. Oh crap! they aren't depressurized *engine explodes*. GOTOs bypass all your normal sanity checks and make everything a nightmare.

7.) Limited scope of variables. Scope is basically what has access to what data. It's tempting when making a program to just declare a ton of "global" variables that everything in your program can read/write to at any time. This also means your program is going to be buggy as gently caress since all it takes is one misbehaving function and you can globally corrupt data for everyone. IT also leads to unreadable mess of code and limits the ability of the various code testing strategies to uncover bugs. Limiting the scope allows each function to hide its data from other functions easing development and fault detection.

8.) Check all return values. If a function (say my function is AddTwoNumbers(x,y) - which adds X + Y and returns the value) sends something back to you. You must check that number before doing anything with it. Basically a way of protecting against a function that is spitting out rogue data. It adds a lot of time to your code development if you're having to check every possible thing sent back to you.

9.) Each function checks its input values. In our example AddTwoNumbers would check the values of X & Y to make sure they fall in the bounds of the type before doing anything with them. Basically if X & Y are integers they can't be null or nothing and they can't be larger than the limit for integers as defined in your program. This prevents all sorts of errors and enforces the principle that each element in the software shouldn't trust anything sent to it by any other element, limiting the scope of fault when it occurs. Again, adds a lot of work for the programmers.

10.) Use assertions. I believe assertions work the same in C as other places, but they are basically statements that say, ok this poo poo should never occur in real life if it does send back an error code. Say we have a function that checks the temperature of the fuel. Well, when we preform an assertion on the input value and see that its reading a temperature of 2 million degrees that's a problem as its something that can never occur in real life. Assertions are designed to prevent errors because of values that shouldn't ever happen but wouldn't necessarily be caught by rules 8 & 9 (which often times just check for null values or data that is outside the range of the type).

The rest of it is mainly rules designed to enforce code clarity and makes sure you don't do a bunch of really nifty cool poo poo that nobody else will be able to understand easily. However that really nifty cool poo poo often makes the programmers life much easier.

The general idea is that each part of code shouldn't trust any other part of code whatsoever, the impossible will happen and you MUST code for it, and nothing that can cause race conditions/infinite loops/stack overflows can ever occur.

Sapozhnik
Jan 2, 2005

Nap Ghost
ok yeah my bad. Safety critical stuff does need a lot of process.

I thought it was going to be dumb crap like "identifiers should Look_Incredibly_Ugly (xzqvATALLTIMES);"

Sapozhnik fucked around with this message at 17:57 on Aug 8, 2012

Adbot
ADBOT LOVES YOU

Shaggar
Apr 26, 2006

Mr Dog posted:

If you need explicit coding standards then your development team consists of either idiots or prima donnas, congrats

(it is very hard to find programmers who aren't one of the two, i'm a huge prima donna myself :smug: )

the code clarity rules are basically: "dont do all those stupid loving obfuscation hacks they taught you in that 'functional'/p-language"

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply