|
MALE SHOEGAZE posted:also please keep posting updates in this thread. i think your posts are eventually going to inspire me to get into lower level stuff. i'll keep working on it as long as i'm autistic for 68k code seeing as i just fixed my atari st and it can read ms-dos floppies this might be a while
|
# ? Aug 18, 2016 15:30 |
|
|
# ? May 9, 2024 22:36 |
|
for some reason that xor thing used to show up in every lovely online pascal tutorial back in the 90s, and pascal programmers used to go over it. the only time it's actually useful if if you're targeting some 8-bit micro with only a few dozen bytes of ram and you have to make every one count.
|
# ? Aug 18, 2016 15:45 |
|
nah its only useful if you are somehow starved for registers. your temp swap-holder is never hitting memory.
|
# ? Aug 18, 2016 16:01 |
|
the only hypothetical ive come up with is if: * you're on a platform without shadow registers/banked registers * your register usage is highly optimized * you have extremely sensitive hand-coded interrupts that might interrupt this function * this one instance will cause you to use one more register than anywhere else in interruptable code * your isr needs all of the registers now your isr can save one fewer register on the stack at entry and restore one fewer at exit and, somewhere out there, there's a code base with exactly this for some reason
|
# ? Aug 18, 2016 16:03 |
|
Space Whale posted:So in multiple parts of this JS app there's loving loopy lookups and additions all over the place of ABigFuckingArray™ of various financial infos over a length of months for a whole deal, and products in the deal. a few pages ago, but is this a design pattern or something? because i found some js code here that does exactly the same thing
|
# ? Aug 18, 2016 16:25 |
Oh god, what does it say about me that I don't find this that horrifying by C macro standards?
|
|
# ? Aug 18, 2016 16:25 |
|
Bloody posted:the only hypothetical ive come up with is if: * and you're using an architecture that lacks a dedicated register<->register swap/exchange instruction
|
# ? Aug 18, 2016 16:39 |
|
HoboMan posted:a few pages ago, but is this a design pattern or something? because i found some js code here that does exactly the same thing No, it's "i can't grok into hash" Are you working for an isp near some big mountains by chance?
|
# ? Aug 18, 2016 16:43 |
|
Bloody posted:the only hypothetical ive come up with is if: even then it seems like temporarily spilling a register is still better. 1 op to spill, 2 ops to read the values you're swapping, 2 ops to write them back swapped, 1 op to read back the thing you spilled. c.f. some xor bullshit where you have to re-read the same locations over and over. the underhanded-c entry that used an "optimised" xor swap to surreptitiously weaken encryption was pretty cool though
|
# ? Aug 18, 2016 16:44 |
|
hackbunny: your whitespace is consistent and pleasing xor swap: the real danger is taking references and zeroing out a single element passed to both longjmp: i didn't understand why it passed the arg back out and seeing the #def for RAISE() made it clear and disheartening
|
# ? Aug 18, 2016 16:47 |
|
well all hack exceptions into c macros are incredibly ugly. at least everyone I've seen (which is to be honest not all that many)
|
# ? Aug 18, 2016 16:58 |
|
Jabor posted:even then it seems like temporarily spilling a register is still better. 1 op to spill, 2 ops to read the values you're swapping, 2 ops to write them back swapped, 1 op to read back the thing you spilled. c.f. some xor bullshit where you have to re-read the same locations over and over. yeah im not even sure it would save a register. probably uses fewer registers in the temp stash too, but there's so much platform-dependence in the hypothetical that who knows
|
# ? Aug 18, 2016 19:18 |
|
Space Whale posted:No, it's "i can't grok into hash" no, i'm not even in the same industry. that's why i asked if it was a pattern, because it is exactly the same goddamn thing here. maybe they both got the same terrible consultant at some point.
|
# ? Aug 18, 2016 21:28 |
|
lol no it's just the product of lovely hacker school grads who were taught only How To Code
|
# ? Aug 18, 2016 21:32 |
|
So I'm going through the database API we had our DBA write for some godforsaken reason.C# code:
|
# ? Aug 18, 2016 22:13 |
|
HoboMan posted:So I'm going through the database API we had our DBA write for some godforsaken reason. 100% success rate. looks good to me
|
# ? Aug 18, 2016 22:14 |
|
the DBAccess.ExecStoredProcedure method is lifted wholesale from the datalayer for the website and we purposely made it very flexible and general so it's easy to use as a main method of communicating with the database no matter the scenario, but no let's make an entire separate file containing only a single class containing only a static "Execute" method as a wrapper for every single individual stored procedure you might call. yeah that thing i posted was an entire file minus the usings at the top
|
# ? Aug 18, 2016 22:29 |
|
GameCube posted:lol no it's just the product of lovely hacker school grads who were taught only How To Code and then the people that say that "everyone needs to learn to code!!!!!" complain that there are no qualified engineers
|
# ? Aug 18, 2016 22:33 |
|
wait some of these use a different method invilving a bespoke DataTable class
|
# ? Aug 18, 2016 22:36 |
|
https://software.intel.com/en-us/python-distribution this is cool python is good
|
# ? Aug 18, 2016 23:16 |
|
actually python is bad
|
# ? Aug 18, 2016 23:58 |
|
don't project your ineptitude onto the language you can't remember how to use while you're using it
|
# ? Aug 19, 2016 01:07 |
|
MALE SHOEGAZE posted:also please keep posting updates in this thread. i think your posts are eventually going to inspire me to get into lower level stuff. before: after:
|
# ? Aug 19, 2016 01:18 |
|
Bloody posted:actually python is bad python's ok - the docs are pretty comprehensive in a lot of places, but there's very little guidance on what api you should be using - requests is nice, but urllib2 and many of the net stdlib is god drat awful, sorry - it works very well on windows, osx, and linux - python 3.5 finally has stuff going for it, and there's a typechecker, and a jit coming too - jupyter/numpy/conda/nltk, the specialists have enough going for them to help them do some heavy lifting i can see people moving away from python or not using it for loads of reasons - the whole white space thing sucks horribly in a repl - they've used python packaging in the past without recent versions of pip or virtualenv - python2 made unicode handling possible but not pleasant - you can do a lot of the web dev related things in node, there's enough equivalents, and it's easier to piss around with http stuff and i can see more python people picking up swift than go but python's ok, and it has lots of very bad bits, but it sorta makes up for it with, docs, community, and the occasional specialist library or tool but i've put up with some awful poo poo
|
# ? Aug 19, 2016 04:22 |
|
HoboMan posted:So I'm going through the database API we had our DBA write for some godforsaken reason. like, this is one of the reasons i like python, you can use as little of the language as you need to get something done i've seen a bunch of smart people really struggle with learning java without learning some sort of simplified scripting language first, without such an emphasis on objects. i mean the "public static void main" thing and then suddenly you're looking at 20 static methods you don't know what is happening but boy does it compile it's hard to teach people why local functions are good practice without letting them use globals badly, it's hard to teach objects without doing some whole "all the functions in one mess" first. when you force good behaviour on beginners they will handwave their way out of it. experts too. (aside: in python2 i've uniquely encountered chains of encode().decode().encode() trying to hammer the bad input out. in a lot of other languages it's "utf-8 is fine, it's just big ascii" and it accidentally works for webdevs) this is why i mostly like python, it's a teaching language it teaches you that programming is bad
|
# ? Aug 19, 2016 04:31 |
|
i think the main reason i dislike python is because the repl is bad. REPLs are really the main selling point of a dynamic language (for me, at least) and having a bad one just makes it feel pointless. i kind of dislike everything else about it too but i think that's mostly discomfort. e: also the fact that python is like, semi compiled (?, i don't actually really understand what python does here, what are .pyc files?), means that your debugger feels more like a C debugger than a nice REPL. maybe I'm just not familiar enough with its debugging tools. DONT THREAD ON ME fucked around with this message at 04:40 on Aug 19, 2016 |
# ? Aug 19, 2016 04:34 |
|
MALE SHOEGAZE posted:i think the main reason i dislike python is because the repl is bad. REPLs are really the main selling point of a dynamic language (for me, at least) and having a bad one just makes it feel pointless. are you using the stock repl or ipython
|
# ? Aug 19, 2016 04:47 |
|
.pyc files are what the python interpreter actually executes, they're not too much more complicated than the python AST compressed into binary
|
# ? Aug 19, 2016 04:49 |
|
fritz posted:are you using the stock repl or ipython probably the stock repl. i've never used python for more than a week or so at a time so i've never gotten very deep into the tooling.
|
# ? Aug 19, 2016 04:53 |
|
i dont like ipython
|
# ? Aug 19, 2016 04:54 |
|
and idk why. something always feels counterintuitive about the interface or something and my notebooks turn into huge messes and its gross
|
# ? Aug 19, 2016 04:56 |
|
i'm using python right now it's whatever
|
# ? Aug 19, 2016 04:58 |
|
i use python i also use pycharm also i can run programs (with an entry point of $800000) now Luigi Thirty fucked around with this message at 05:02 on Aug 19, 2016 |
# ? Aug 19, 2016 04:59 |
|
MALE SHOEGAZE posted:i think the main reason i dislike python is because the repl is bad. REPLs are really the main selling point of a dynamic language (for me, at least) and having a bad one just makes it feel pointless. tbh, i like that python insists on well indented code, it fits with bits like "" / '' aren't multiline but after using ruby for ~2 years, i can see the convenience of an explicit `end` like syntax rather than relying on when the whitespace goes missing maybe just for the whole "copy paste often destroys whitespace and ugh i am tired of asking people to wrap in tags to preserve structure" i guess explicit is better than implicit, who knew quote:e: also the fact that python is like, semi compiled (?, i don't actually really understand what python does here, what are .pyc files?), means that your debugger feels more like a C debugger than a nice REPL. maybe I'm just not familiar enough with its debugging tools.
|
# ? Aug 19, 2016 05:24 |
|
another thing i dislike about python is that it uses syntactic indicators to warn you against metaprogramming and special class programming stuff ('_', I think maybe '@', cant remember). i think that's all well and good, but I see a ton of metaprogramming in python and all of it screams 'HEY THIS IS A SPECIAL THING DONT DO THIS' even though it's super commonplace. the language should either give those features better support, or get rid of them.
|
# ? Aug 19, 2016 05:32 |
|
CPython compiles your source to bytecode (the .pyc files) for a virtual machine written in C Jython does the same but with Java and IronPython the same with the .net CLR
|
# ? Aug 19, 2016 05:36 |
|
numpy and scipy are king
|
# ? Aug 19, 2016 06:20 |
|
Python is pretty okay actually. Only assholes write giant systems in it but then again assholes write giant systems in ruby and Java and c# and etc
|
# ? Aug 19, 2016 06:28 |
|
Luigi Thirty posted:CPython compiles your source to bytecode (the .pyc files) for a virtual machine written in C i feel like ironpython should be the Rust backend
|
# ? Aug 19, 2016 06:31 |
|
|
# ? May 9, 2024 22:36 |
|
irony python
|
# ? Aug 19, 2016 06:56 |