Readit News logoReadit News
BrS96bVxXBLzf5B commented on Rawdrawandroid – Build Android apps without any Java, in C and Make   github.com/cnlohr/rawdraw... · Posted by u/doodlesdev
Lerc · a year ago
Looking at the Flappy Bird post earlier I noted the structure of the repo to be simultaneously elegantly structured and yet still more complex than I would prefer.

The structure is (using [dirname] notation for directories)

    [Repo Root]
        ...git and github files, READMEs...
        [Flappy Bird]
           ... project files, keystore, build.bat ...
           [App]
             [build] 
                 ... I'm ok with tools making a mess here as long as outputs is tidy ...
                 [outputs/apk]    
                    ..the actual .apk
             [src]
                [main]  this seems a little off,  main contains libs and resources 
                   Android_Manifest.xml     Yep ok, I'll rant about that later, that's its own thing
                   [assets]   all good
                   [res] Wait what?  that's like a synonym for assets, (but for a different layer) 
                   [libs] Hang on, these are .so files.  built libs should be in the build dir
                   [jni] This looks like what src or src/main should have had inside it
 
So ignoring the outer layer for the README etc. which isn't needed for an Android app, Just encapsulation for presentation. Arguably the same applies for the next layer too. I feel like the contents of App could be placed in here at no loss.

I'd Shuffle it around to make [Flappy Bird] contain [main] and [build]. move [libs] to [build/libs] rename [jni] to [src].

If you had an architecture like that then the one-true-build-system should be a command line tool that you can point at [main] and it does what [Flappy bird]/build.bat does only with auto detection of the installed tools, optional config file overrides, optional commandline overrides.

AndroidManifest is another issue entirely I'd like something that invisibly converted something sane to XML and I'd never see it again, but I'll grin and bear it. A decent validator and maybe I'd like a standalone AndroidManifest editor that knew what everything did and could provide appropriate boilerplate.

After typing this up (mostly as organizing my thoughts), I actually think you could have a relatively painless way to make Android Apps.

BrS96bVxXBLzf5B · a year ago
The `src` folder is structured that way because the Android NDK demands it. They're not just chosen by convention, but because the build tool searches for those files and subdirectories.
BrS96bVxXBLzf5B commented on Vim is touch-typing on steroids   trickster.dev/post/vim-is... · Posted by u/rl1987
p-e-w · 3 years ago
> Shift+k over a keyword to open the man page

Any widely used modern editor/IDE will have plugins to do the same thing.

> having some custom scripts that read ctags and could tab-complete keywords from our large codebase

Contextual completion as offered by modern IDEs or language servers is vastly superior to Ctags, and you don't have to home-cook anything to get it working.

> and having the same editor on our embedded servers and VMs as on dev machines

That's what SSHFS is for. No need to limit yourself to whatever happens to be installed on the remote machine. You don't even have to copy config files around.

BrS96bVxXBLzf5B · 3 years ago
okay? you've pivoted from "not understanding" vim to having an anti-vim boner. other people in the same environement achieved as much or more than me with different tools. and those different tools didn't work for me. that's all that's going on here.

(sshfs is not a direct substitute for being able to quickly interact with a remote environment)

> having some custom scripts that read ctags and could tab-complete keywords from our large codebase

for clarity i meant that I had a completion in the terminal when not in the editor to quickly jump to a tag in a file. `vim -t <keyword>`. i could be in a terminal, execute a remote command on a machine, know what I wanted to look at next and quickly go there without much effort. And again, other people were productive without doing this. these were just my tools and i liked them.

BrS96bVxXBLzf5B commented on Vim is touch-typing on steroids   trickster.dev/post/vim-is... · Posted by u/rl1987
p-e-w · 3 years ago
When engineers report that switching to Vim has massively improved their productivity, I can't help but think that the way they work must be very, very different from my own.

When I "program", 95% of what I do is read documentation and other technical resources, conceptualize what I want to happen, and construct the corresponding logic flow, while trying to anticipate potential problems and corner cases. In other words, most of what I do doesn't involve touching the keyboard at all.

If Vim magically tripled the speed at which I'm able to edit text, I doubt it would have a noticeable impact on my overall productivity. In fact, even if you gave me a brain-computer interface that allowed me to manipulate text at the speed of thought, it wouldn't matter much. I touch-type at around 70 WPM, which is very average, but if I two-finger typed at 15 WPM instead I would still be able to produce exactly as much code as I do today.

Simply put, text manipulation is not at all a productivity bottleneck for me. I need much more time for thinking about code than I need for writing it.

Is this really unusual? How do people operate for whom Vim gives a productivity boost? Does code just flow from their brains into their fingers? I don't get it.

BrS96bVxXBLzf5B · 3 years ago
I agree with your point but fwiw when I worked a full time C job doing things with servers running a custom Linux kernel the biggest conveniences were Shift+k over a keyword to open the man page (most of my time was reading docs too!), having some custom scripts that read ctags and could tab-complete keywords from our large codebase and open the files at the right line, and having the same editor on our embedded servers and VMs as on dev machines (and even now that's half of why vim is still my primary).

There were people at the company who were more efficient than me using Sublime + mouse, but I was less efficient using Sublime.

(but really the biggest reason I use vim as a slow and sloppy typer and not a computer person is, hotkeys make my hands hurt, I've managed to avoid any RSI or pains like this, and I like vim better than vim keybindings in other editors.)

other productivity gains not related to typing were the search/replace in vim, embedded terminal, and being in and staying in a terminal made it easier and quicker to switch to scripty things, searching or reformatting files etc

BrS96bVxXBLzf5B commented on Research links aspartame to anxiety in mice   news.fsu.edu/news/univers... · Posted by u/cachecrab
omnibrain · 3 years ago
Still, the same amount of regular coke and monster would be worse.

A wise man once said: It's best if you drink water. If you drink one coke a week, then it's best you drink a regular one with sugar. But if it's more and you can't help yourself, then at least drink diet coke instead of regular coke.

BrS96bVxXBLzf5B · 3 years ago
What makes this man wise, when the effects of excess sugar and a blood sugar spike are well documented and aspartime in diet is one of the most heavily-researched sweetners with nothing more than questionable claims attached (and unlike some sweeteners does not have a GI load)?
BrS96bVxXBLzf5B commented on Ask HN: Programming without a build system?    · Posted by u/mikewarot
CPUTranslator · 3 years ago
If you can get into the beta, the Jai programming language by Jonathan Blow ticks the box of "no build system required." With how the build system is managed (just running arbitrary code at compile-time that modifies the build process), I can do this 99% of the time:

  #run compile_to_binary("name_of_binary");
  
  main :: () {
    // ...
  }

  #import "base"; // my own library that has 'compile_to_binary'
I'll go into depth about what this does, but if you're not interested, skip to the final code snippet.

The above code '#run's any procedure at compile-time (in this case 'compile_to_binary' which is defined in the library I imported). That procedure (really a hygienic macro) configures my 'workspace' to compile down to a 'name_of_binary' executable in the current directory. Any third-party libraries I've imported will be linked against automatically as well.

To do this without a dedicated procedure, just put this in the same file as 'main':

  #run {
    options: Build_Options_During_Compile;
    options.do_output = true;
    options.output_executable_name = "name_of_binary";
    set_build_options_dc(options);
  }

  main :: () {
    print("This is all I need to build a project\n");
  }

  #import "Basic";
  #import "SDL"; // or whatever...
Then compile:

  jai above_file.jai
I've done this for projects with hundreds of files that link in SDL, BearSSL, etc.

The best part is neither of these systems are a requirement to build your project. Running the compiler against a Jai file will do everything I do with my own system (I just like having the ability to configure it in code).

Jai has been a breath of fresh air in terms of "just let me write code," so I highly recommend it if you can get in the beta.

BrS96bVxXBLzf5B · 3 years ago
If you can get into the beta. I'm a ten year C++ programmer and focus a lot on games but my dove's song didn't reach Jonathan Blow's ears, or something. I fear I might not be the "right" demographic. Which is disappointing.
BrS96bVxXBLzf5B commented on Does anyone else finds AWS and other Amazon services overly complicated?    · Posted by u/damacaner
BrS96bVxXBLzf5B · 3 years ago
Entered the thread for a different reason. No, I don't really find building the API request complicated. I mean, it is but they provide a python example that I was easily able to get working in lua without major issues. And you spend half a day wondering why it's returning forbidden until you get it right and then it's done.

What is complicated is receiving the response, that different services sometimes operate in regions and sometimes operate globally (but have a us-east-1 endpoint) and that some return XML, some return JSON, some return a gzipped response and some not, and much of it I haven't found documentation for and have had to figure out how to wrap calls to different services to be able to interact with them in a sensible manner.

BrS96bVxXBLzf5B commented on The pool of talented C++ developers is running dry   efinancialcareers.com/new... · Posted by u/pjmlp
BrS96bVxXBLzf5B · 3 years ago
I could have been a talented C++ developer. Hell, I _am_ a good C++ developer. I should be, I've been doing it for a decade. Across a range of projects, from hardware to web backends to games and art.

But aside from a brief 3 years as a C developer (embedded hardware product) I've never been close to being one. Because when I was coming out of university seven years ago with a good CV and projects I could competently talk about, and I _could_ do the whiteboard segments, somehow I ... couldn't do them the way they wanted? And they, the very sparsely spread places with listings at the time, were offering no money for a new grad to somehow make their way across the country to interview, only to be offered a low salary (the C job I got was at the risk of a £180 train ticket three weeks before I would have had nowhere to live).

Now? I maintain a fleet of Wordpress sites for a digital agency for a modest £40k a year as the company's sole "someone who knows anything about Linux" person. Because my coworkers are lovely, my boss doesn't stress about anything and lets us flex our time and the clients are nice. Money is tight and definitely less than my skillset but going through the hoops of the "clever" side of the industry to be well paid and well stressed sounds daunting. There was no nurture for anyone not conforming to a very specific template which shows its face on the ranty side of Twitter.

Deleted Comment

BrS96bVxXBLzf5B commented on Shirky.com is gone   web.archive.org/web/20060... · Posted by u/lkrubner
ElevenLathe · 3 years ago
$30/month indefinitely adds up pretty fast. It's $360/yr or $18,000 over 50 years. It feels like pocket change to someone with stable IT employment, but it shuts out a fair chunk of the population.
BrS96bVxXBLzf5B · 3 years ago
Definitely expensive for an individual or small group which is why I emphasised agreement with the message. The question was specifically about the cost estimate they gave.

Edit: Re-reading what I wrote and how much I quoted I realise now that wasn't clear :)

BrS96bVxXBLzf5B commented on Shirky.com is gone   web.archive.org/web/20060... · Posted by u/lkrubner
sumtechguy · 3 years ago
Most of the time it is time and/or money.

Vulins found every other day in some obscure package you thought you were one and done with. You get to spend a couple of hours fixing it. Oh new update on the java core you are using few more hours. Oh that update breaks 2-3 things. More time. You float the idea that someone else takes it. But those who step up have 'other ideas' what they want the site to be. Oh and your base OS is 2 releases back better get on that.

Then the actual cost. While you can get a cheap site up and going for not much. If you get even slightly popular you are now looking at a decent amount of money for many people. You may not see a couple hundred a month as 'no big deal' but many people do. You can pay a provider to take some of that patching work out of your hands but you pay for that.

The programming world is very ephemeral. We get bored easy. We move on quickly. Sometimes we are just cheapos. Things that cost time and money get left to rot or turned off.

What I find interesting in my 'internet' life. Is I always seem to find out about the really interesting places as they are being closed out :(

BrS96bVxXBLzf5B · 3 years ago
> Then the actual cost. While you can get a cheap site up and going for not much. If you get even slightly popular you are now looking at a decent amount of money for many people. You may not see a couple hundred a month as 'no big deal' but many people do. You can pay a provider to take some of that patching work out of your hands but you pay for that.

Agree with the whole message and tone of your comment but wondering about this bit. We run a bunch of Wordpress sites with decent traffic and a bunch of badly optimised front-end, heaps of old plugins from decades passed: we can hit 20k uniques and a million requests per day, with nightly backups for $30/mo. It could be less if we didn't care about completely surviving every traffic spike and bot crawl.

u/BrS96bVxXBLzf5B

KarmaCake day243March 24, 2019View Original