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
Nomnom Cookie
Aug 30, 2009



Notorious b.s.d. posted:

yes, but the poo poo that gets stripped/changed can be really frustrating

things off the top of my head
  • anything sun.* is missing -- most notably sun.misc.Base64Encoder
  • the browser plugin is gone (reimplemented in icedtea)
  • java web start is gone (reimplemented in icedtea)
  • a ton of MBeans/JMX stuff is missing/reimplemented

it's the small stuff.

the java TCK just doesn't cover very much. it makes sure your compiler does the right thing, and your jvm executes bytecodes, and you have the std library. that's pretty much it. all the surrounding infrastructure can be missing

java.util.concurrent uses sun.misc.Unsafe so I don't think all the sun. packages are missing. unless openjdk ships a different implementation? that would be p. lovely if so

Adbot
ADBOT LOVES YOU

MrMoo
Sep 14, 2000

It's in OpenJDK 7 Mercurial:

http://hg.openjdk.java.net/jdk7/jdk7/jdk/file/9b8c96f96a0f/src/share/classes/sun/misc/Unsafe.java

Along with everything else:

http://hg.openjdk.java.net/jdk7/jdk7/jdk/file/9b8c96f96a0f/src/share/classes/sun/misc/

Flaming June
Oct 21, 2004


with regards to your latest article, do you know of cool books/articles of people other than yourself that actively try to spread programming to those outside of the crusty hardcore types?

i recently got my first dev job after living an unrelated background and while i'm trying to pick up stuff it is daunting sometimes with how little i know since i haven't written a compiler when i was 14 like my coworkers

reading about fun things even kids can accomplish would make it seem that, hey, they can do a thing with little/no experience. i can do one too :3:

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

Flaming June posted:

i recently got my first dev job after living an unrelated background and while i'm trying to pick up stuff it is daunting sometimes with how little i know since i haven't written a compiler when i was 14 like my coworkers

not to belittle your coworker's achievement, but don't be intimidated by compilers. they certainly can be monstrously complex, but the ones people hack together for shits and gigs aren't. if you work through the dragon book (which i think is still the best compiler text around), you'll have a simple one of your own written by page 80.

e: also go read through the YOSPOS project thread. look at the stuff hubris and qwerty have been doing, then come up with a simple lil' project of your own as a channel for your learning.

e2: http://forums.somethingawful.com/showthread.php?threadid=3561097&pagenumber=15&perpage=40#post418659702

coffeetable fucked around with this message at 01:59 on Aug 30, 2013

Flaming June
Oct 21, 2004

coffeetable posted:

not to belittle your coworker's achievement, but don't be intimidated by compilers. they certainly can be monstrously complex, but the ones people hack together for shits and gigs aren't. if you work through the dragon book (which i think is still the best compiler text around), you'll have a simple compiler written by page 80.

oh no, i was just using that as a metaphor that they are infinitely more experienced in this than i am. they have been doing this for years and years while i am new to the field (and especially so in doing it professionally)

it is lame to hear but i feel bad with how long it takes me to add new features that seem pretty simple at first :smith:

Flaming June
Oct 21, 2004


as a guy with a physics background, that was really funny


on a different note, is there a gold standard book on operating systems? i've done a few moocs to patch up the formal cs education i never received but i never did find one on that particular topic

tef
May 30, 2004

-> some l-system crap ->

Flaming June posted:

with regards to your latest article, do you know of cool books/articles of people other than yourself that actively try to spread programming to those outside of the crusty hardcore types?

somewhat, but far more local, or targeted to a specific demographic

quote:

i recently got my first dev job after living an unrelated background and while i'm trying to pick up stuff it is daunting sometimes with how little i know since i haven't written a compiler when i was 14 like my coworkers

reading about fun things even kids can accomplish would make it seem that, hey, they can do a thing with little/no experience. i can do one too :3:

eh, it's ok, their experience blinds them to things that you will see, don't worry about being new, just worry if you're not learning anything. right now i'm learning more about programming from talking to children than i have done from talking to adults. the kids just make drawings and games and make the computer fun. it isn't impressive but they're having way more fun than I have had recently with code.

the thing is, you don't need to be that clever to write good code. in some cases, writing really stupid code is often a good idea. by that i mean 'so simple and obvious, it's easy to maintain' as opposed to 'metaprogramming a new language to express the problem in'

obligatory go and read 'the practice of programming', it's a good book.

Condiv
May 7, 2008

Sorry to undo the effort of paying a domestic abuser $10 to own this poster, but I am going to lose my dang mind if I keep seeing multiple posters who appear to be Baloogan.

With love,
a mod


Flaming June posted:

on a different note, is there a gold standard book on operating systems? i've done a few moocs to patch up the formal cs education i never received but i never did find one on that particular topic

just read through all this stuff and watch the videos and you'll be an operating system master in no time.
http://www.templeos.org/

Notorious b.s.d.
Jan 25, 2003

by Reene

tef posted:

the thing is, you don't need to be that clever to write good code. in some cases, writing really stupid code is often a good idea. by that i mean 'so simple and obvious, it's easy to maintain' as opposed to 'metaprogramming a new language to express the problem in'

further down this road, if domain-specific languages are so powerful, why are they so rare?

it seems like every c.s. guy fuckin loves to play with a dsl, so why do we not see them in common use commercially?

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

Flaming June posted:

as a guy with a physics background, that was really funny


on a different note, is there a gold standard book on operating systems? i've done a few moocs to patch up the formal cs education i never received but i never did find one on that particular topic


The dinosaur book is the best I think, the other one I know of is the Tanenbaum book

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

Notorious b.s.d. posted:

further down this road, if domain-specific languages are so powerful, why are they so rare?

it seems like every c.s. guy fuckin loves to play with a dsl, so why do we not see them in common use commercially?

eh? they're really common. html, sql, (early?) matlab are all dsls

tef
May 30, 2004

-> some l-system crap ->

Flaming June posted:

on a different note, is there a gold standard book on operating systems? i've done a few moocs to patch up the formal cs education i never received but i never did find one on that particular topic

there are very very few books that are gold standard, but the trick is just to read more. the minix book is pretty well written but often idealistic. you may enjoy http://pdos.csail.mit.edu/6.828/2012/xv6.html xv6 too

Flaming June posted:

as a guy with a physics background, that was really funny

at the uni i frequented, the running joke was that physicists made better programmers than cs students. they learned just enough programming to solve their problem, and had a little bit more rigor and dicipline too. the cs students would spend most of the time trying to validate their education with endless abstractions

actually it wasn't a running joke it was more of a crushing realisation couched in humour

anyway, as a newcomer to programming, my aphorisms to you would be as follows

- if you feel the need to comment something to explain what the code is doing, rewrite the code: comments are useful ways to explain the intent and rationale of code, and aren't as useful when they serve as apologies for complexity

- write simple dumb code that is easy to debug and test. you'll thank me later.

- write defensive and slow code, check the assumptions you're making and hard code them into the code.

- don't worry so much about being stupid, it's better than thinking you're clever. you will always go into things with the possibility of learning

- don't write code you can extend, write code that's easy to replace or delete. frameworks and extensibility are best driven by hindsight, not optimistic views of the future. don't paint yourself into a corner under the guise of finding just the right abstraction. sometimes it's better to write 50 lines of code than 150 lines of setup so you only have to write or edit one line to change something—what happens is that your underlying assumptions about the problem change, so you'll have to rewrite all the framework and scaffold


if you code is boring and easy to understand, you're doing a good job.

tef
May 30, 2004

-> some l-system crap ->

Notorious b.s.d. posted:

further down this road, if domain-specific languages are so powerful, why are they so rare?

in ruby parlance, a dsl is what they call libraries.

quote:

it seems like every c.s. guy fuckin loves to play with a dsl, so why do we not see them in common use commercially?

excel.

unixbeard
Dec 29, 2004

Flaming June posted:

on a different note, is there a gold standard book on operating systems? i've done a few moocs to patch up the formal cs education i never received but i never did find one on that particular topic

If you want to dig around inside a real production os along the way http://www.amazon.com/The-Design-Implementation-Operating-System/dp/0201549794/

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Flaming June posted:

as a guy with a physics background, that was really funny


on a different note, is there a gold standard book on operating systems? i've done a few moocs to patch up the formal cs education i never received but i never did find one on that particular topic

Tanenbaum's Minix book: Operating Systems Design and Implementation

Intel's Software Developer Manual

Bloody
Mar 3, 2013

tef posted:

in ruby parlance, a dsl is what they call libraries.


excel.

sql?

Flaming June
Oct 21, 2004

wow, lots to respond to


tef posted:

the thing is, you don't need to be that clever to write good code. in some cases, writing really stupid code is often a good idea. by that i mean 'so simple and obvious, it's easy to maintain' as opposed to 'metaprogramming a new language to express the problem in'

what about "so simple and stupid, it doesn't actually work." i'm finding it infinitely more difficult to try and do simple things with production code since there are a ton of little hangups and exceptions with every little thing

tef posted:

obligatory go and read 'the practice of programming', it's a good book.

Hard NOP Life posted:

The dinosaur book is the best I think, the other one I know of is the Tanenbaum book

tef posted:

there are very very few books that are gold standard, but the trick is just to read more. the minix book is pretty well written but often idealistic. you may enjoy http://pdos.csail.mit.edu/6.828/2012/xv6.html xv6 too

unixbeard posted:

If you want to dig around inside a real production os along the way http://www.amazon.com/The-Design-Implementation-Operating-System/dp/0201549794/

thanks :unsmith:

i'm not interested in writing an os or anything like that. i've just been a windows user for most of my life and now am in the, erm, wonderful world of unix. it isn't so much that i want to just learn a lot about unix, but the experience open ups a horizon that there are many ways to do even simple stuff in the background. i find it to be kind of cool in a nerdy way

my knowledge about computers tends to run either in the super high abstract level or the super low level stuff (material science). there's a lot of ground in-between i would like to understand

tef posted:

at the uni i frequented, the running joke was that physicists made better programmers than cs students. they learned just enough programming to solve their problem, and had a little bit more rigor and dicipline too. the cs students would spend most of the time trying to validate their education with endless abstractions

actually it wasn't a running joke it was more of a crushing realisation couched in humour

one unusual aspect with regards to my formal education is that i did almost zero programming whatsoever while in college. i only used some materials in the higher level math courses i took (and sadly mostly forget now; both the programming and the math). i never interacted with the cs students so i never really had anyone to compare these skills to while there

tef posted:

anyway, as a newcomer to programming, my aphorisms to you would be as follows

- if you feel the need to comment something to explain what the code is doing, rewrite the code: comments are useful ways to explain the intent and rationale of code, and aren't as useful when they serve as apologies for complexity

- write simple dumb code that is easy to debug and test. you'll thank me later.

- write defensive and slow code, check the assumptions you're making and hard code them into the code.

- don't worry so much about being stupid, it's better than thinking you're clever. you will always go into things with the possibility of learning

- don't write code you can extend, write code that's easy to replace or delete. frameworks and extensibility are best driven by hindsight, not optimistic views of the future. don't paint yourself into a corner under the guise of finding just the right abstraction. sometimes it's better to write 50 lines of code than 150 lines of setup so you only have to write or edit one line to change something—what happens is that your underlying assumptions about the problem change, so you'll have to rewrite all the framework and scaffold


if you code is boring and easy to understand, you're doing a good job.

the job environment i am in is actually quite welcoming to these already, especially the second point. we have no distinct qa department, so all the devs write all the test code ourselves. one of the developers is very stern about code submissions that doesn't have tests to accompany it

the last dashed point is probably the most difficult to wrap my head around as the new guy. my projects have all been in either python or java, and at day one they wanted me to write up stuff in Backbone.js :psyduck: i have limited exposure to mvc and sometimes what you can and can't do with it is infuriating. the stuff already in place seems to be really modular, its just working with it to do new things that is rough


sorry for the wall post. this thread is honestly really good

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
i've got a dumb question. if you have a function whose job it is to return an object depending on the parameters fed into the function, what's the best way to handle a failure?

should i have a failure conditional that returns null or false?
should i have the function fail silently and have the application calling it expect an object and handle a missing one accordingly?
should i have it throw an exception and catch it somewhere up the stack in an appropriate manner?

i've been doing the first, but i have a sneaking suspicion that it's probably not the right way.

Flash z0rdon
Aug 11, 2013

change ur username immediately

Flash z0rdon
Aug 11, 2013

tia

Notorious b.s.d.
Jan 25, 2003

by Reene

coffeetable posted:

eh? they're really common. html, sql, (early?) matlab are all dsls

ill give you SQL

HTML isn't a programming language
Matlab is its own awful thing. It may have started as a dal

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

Notorious b.s.d. posted:

HTML isn't a programming language

what's your definition of a programming language

e: nm just googled it myself. i don't see why markup languages aren't programming languages, 'cause they're certainly used to instruct a machine to do a thing, but the wise men of the internet disagree so welp

coffeetable fucked around with this message at 04:11 on Aug 30, 2013

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
your mom

FamDav
Mar 29, 2008

Blinkz0rz posted:

i've got a dumb question. if you have a function whose job it is to return an object depending on the parameters fed into the function, what's the best way to handle a failure?

should i have a failure conditional that returns null or false?
should i have the function fail silently and have the application calling it expect an object and handle a missing one accordingly?
should i have it throw an exception and catch it somewhere up the stack in an appropriate manner?

i've been doing the first, but i have a sneaking suspicion that it's probably not the right way.

pick one, and do it consistently.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Blinkz0rz posted:

i've got a dumb question. if you have a function whose job it is to return an object depending on the parameters fed into the function, what's the best way to handle a failure?

should i have a failure conditional that returns null or false?
should i have the function fail silently and have the application calling it expect an object and handle a missing one accordingly?
should i have it throw an exception and catch it somewhere up the stack in an appropriate manner?

i've been doing the first, but i have a sneaking suspicion that it's probably not the right way.

throw the exception

jesus christ that's like textbook what they're for

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

coffeetable posted:

e: nm just googled it myself. i don't see why markup languages aren't programming languages, 'cause they're certainly used to instruct a machine to do a thing, but the wise men of the internet disagree so welp

j-langers can't stand that somebody who picks fonts for a living programs them in css

is prolog a programming language?

is an excel sheet a programming language?

is html a programming language?

is css?

is sass?

Bloody
Mar 3, 2013

Cocoa Crispies posted:

j-langers can't stand that somebody who picks fonts for a living programs them in css

is prolog a programming language?

is an excel sheet a programming language?

is html a programming language?

is css?

is sass?

yes
yes
no
no
no

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
why is css not a plang? its turing complete

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

FamDav posted:

pick one, and do it consistently.

received wisdom i've been working by is
  • don't throw an exception unless circumstances are actually exceptional. if you're expecting a function to fail in the normal course of operation, the code should be dealing with it in a calm and dignified manner.
  • fail silently, return a specific value or use a failure continuation - choose whichever makes clear that there is the possibility of failure and which makes clear how the code handles it. personally i try to avoid silent failures b/c they don't sit right with me, but~
  • option types are dreamy

coffeetable fucked around with this message at 04:36 on Aug 30, 2013

Bloody
Mar 3, 2013

coffeetable posted:

received wisdom i've been working by is
  • don't throw an exception unless circumstances are actually exceptional. if you're expecting a function to fail in the normal course of operation, the code should be dealing with it in a calm and dignified manner.
  • fail silently, return a specific value or use a failure continuation - choose whichever makes clear that there is the possibility of failure and which makes clear how the code handles it. personally i try to avoid silent failures b/c they don't sit right with me, but~
  • option types are dreamy

ignore all of this, throw an exception.

i hope this devolves into numerous pages of augh exception time

FamDav
Mar 29, 2008

coffeetable posted:

received wisdom i've been working by is
  • don't throw an exception unless circumstances are actually exceptional. if you're expecting a function to fail in the normal course of operation, the code should be dealing with it in a calm and dignified manner.
  • fail silently, return null or use a failure continuation - choose whichever makes the fact that there is the possibility of failure and how the code handles it clearest. personally i try to avoid silent failures b/c they don't sit right with me, but~
  • option types are dreamy

this but

FamDav posted:

pick one, and do it consistently.

what you think is clearest is not always clearest to someone else. pick a standard and stick with it so the person who has to read your code doesnt have to devote thought to it.

this applies to tabs vs. spaces, variable/function naming, and how you write your code in general. dumb and consistent code is good code.

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Cocoa Crispies posted:

throw the exception

jesus christ that's like textbook what they're for

Exceptions are for exceptional conditions.

Use an option type if you can't find a good way to prevent improper input in the first place

never fail silently if u can help it

double sulk
Jul 2, 2010

shaggar is gonna be here within 20 minutes

Bloody
Mar 3, 2013

why do people parrot "exceptions are for exceptional conditions"

he literally said "whats the best way to handle a failure of a function" is that not a loving exceptional condition? what the gently caress is an exceptional condition? is your exceptional condition so loving exceptional that it should just terminate the program? if thats the case why the gently caress do exceptions even exist

Bloody
Mar 3, 2013

Bloody posted:

ignore all of this, throw an exception.

i hope this devolves into numerous pages of augh exception time

Bloody posted:

why do people parrot "exceptions are for exceptional conditions"

he literally said "whats the best way to handle a failure of a function" is that not a loving exceptional condition? what the gently caress is an exceptional condition? is your exceptional condition so loving exceptional that it should just terminate the program? if thats the case why the gently caress do exceptions even exist

look at this loving moron springing his own trap ugh you make me sick

FamDav
Mar 29, 2008

FamDav posted:

pick one, and do it consistently.
              /
             /

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

Malcolm XML posted:

Exceptions are for exceptional conditions.

ftfy, go jack off in pony land

Malcolm XML posted:

Use an option type if you can't find a good way to prevent improper input in the first place

never fail silently if u can help it

now i'm conflicted because this is right

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Bloody posted:

why do people parrot "exceptions are for exceptional conditions"

he literally said "whats the best way to handle a failure of a function" is that not a loving exceptional condition? what the gently caress is an exceptional condition? is your exceptional condition so loving exceptional that it should just terminate the program? if thats the case why the gently caress do exceptions even exist

Springing trap:

Is failure exceptional? Everyone expects x/0 to fail so IEEE has rules on what u get (+/- inf or nan depending on x ) of course u can force it to signal sigfpe if you want instead making u handle the signal


Partial functions are a pain to deal with in general so i use exceptions sparingly and only when the type system can't handle it well

Notorious b.s.d.
Jan 25, 2003

by Reene

gucci void main posted:

shaggar is gonna be here within 20 minutes

maine loses power after ten pm, so everyone is busy pumping tomorrows shower water and lobster broth into the boiler

Adbot
ADBOT LOVES YOU

Notorious b.s.d.
Jan 25, 2003

by Reene

coffeetable posted:

what's your definition of a programming language

e: nm just googled it myself. i don't see why markup languages aren't programming languages, 'cause they're certainly used to instruct a machine to do a thing, but the wise men of the internet disagree so welp

Cocoa Crispies posted:

j-langers can't stand that somebody who picks fonts for a living programs them in css

is prolog a programming language?
is an excel sheet a programming language?
is html a programming language?
is css?
is sass?

html is a data format. this is distinct from a programming language because i don't have to solve the halting problem to interpret it

css was intended to be a data format but they hosed it up laughably badly and ended up turing complete by accident

excel was intended to straddle the line, and be turing complete in a limited way, but it turns out that being a fully-fledged programming language was actually useful and important, so they made that easier and easier over time

Notorious b.s.d. fucked around with this message at 06:18 on Aug 30, 2013

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