Thursday, February 9, 2017

Case in programming identifiers

By no means a comprehensive list, and feel free to give me alternate names or etymologies...
  • LoremIpsum
    • CamelCase
      • This is ambiguous and I really don't recommend using it. camelCase traditionally starts with a lowercase letter (do camels have a hump on their heads?).
    • UpperCamelCase
      • It is exactly the same as camelCase except with the first letter capitalized, and it is unambiguous, but this is rarely used.
    • PascalCase
      • This is the preferred case in Pascal, and I would dearly love for people to consistently call this case PascalCase and just get on with it.
  • Lorem-Ipsum
    • Train-Case
      • This is not something I have seen in the wild, but I have heard of it. A plausible etymology is a series of boxcars linked by couplings which aren't quite at the middle (as in spinal case) or at the ground level (as in snake case) but closer to the ground, over where the wheels would be.
      • Largely superfluous- if you want to use capital/lowercase letters together, then why would your standard use this and not camelCase or PascalCase?
  • lorem-ipsum
    • spinal-case
      • As in, the words seem to be connected centrally through a "spine".
    • kebab-case
      • As in, the words seem to be pierced through the middle by a skewer, as a kebab. Yum!
    • lisp-case
      • This is the preferred case in Lisp, and some refer to it this way, although I would call it somewhat less common these days.
  • loremIpsum
    • camelCase
      • The first word is not capitalized, but the second word is; the increase in case looks like a "hump" and reappears on subsequent words.
      • Common in Java, JavaScript, and myriad other languages.
      • In some shops, it's common to use PascalCase but include a Hungarian prefix lowercased; this results in camelCase (e.g. szCamelCase) identifiers, but Hungarian is also diminishing in popularity.
  • lorem_ipsum
    • snake_case
      • As in, the words are connected along the ground, like a slithering snake... why'd it have to be snakes?
      • Common in C/C++ identifiers, although I don't like it. I prefer camelCase even in C.
  • LOREM_IPSUM
    • SCREAMING_SNAKE_CASE
      • Taken as a modifier of snake case for its use of underscores, the SCREAMING aspect refers to making all letters capitalized, but I haven't heard SCREAMING in any other case- possibly because the idea of a screaming snake is particularly goofy.
      • Universal for C/C++ named constants.
  • LOREM-IPSUM
    • COBOL-CASE
      • COBOL is case insensitive (always capitals), and they don't support many delimiting characters, so hyphen is the best choice.

Monday, February 6, 2017

Dell XPS 13 9360

I want to state upfront that I am suspending my overall judgment of this machine until I can identify how difficult it plausibly is to fix my issues and how widespread these issues likely are. The last time I was buying a laptop, it was 2011 and I spent about $370 for a cheapie Lenovo, having no expectations other than buying the cheapest thing out there which had an i3 and 500GB HDD. For something more than three times the price, I expect a good deal more. And right now I'm getting it, but I'm kinda not at the same time.

This article will cover my impressions of all aspects of the machine, and will be updated continuously.


The good stuff

For my money, on paper and when checking it out in the store, this is the best laptop out there.

Prices starting at $1000, rising to $1300 for something with guts. I ordered mine with all the top specs except touchscreen, which unfortunately meant I was limited to 8GB RAM, which is the only hardware drawback. Kaby Lake i7 runs fantastic. Everything blazing fast with 256GB PCIe SSD, restarts are faster than I've ever seen for a laptop. It is only expensive compared to laptops which are made with lousy keyboards, lower specs, or such bulk and low battery life that they can't be considered effectively portable.

It has the same solid build quality and beautiful machined aluminum exterior as a Macbook Pro, with the unique addition of a carbon fiber touch surface (it feels exceptionally nice and keeps your hands cool and avoids smudges). Costs hundreds less than the Mac, but I'll be damned if I can spot what they have saved money on! It's not a surprise that Apple sucks on performance per dollar, but their industrial design is top notch. Have I been asleep for a long time and Dell has been making good-feeling PC laptops for years? Could be that I've not been paying attention, but this XPS surprised me in the store.

Keyboard has a delightful feel. I'm partial to clickiness and some tactile feedback but also a feeling of robustness. The feedback is roughly similar to Surface Book and high-end Lenovos that I've used, but those feel really chintzy, like I'm going to destroy them by punching the keys all the time. HP Spectre 360's keyboard feel robust, but I don't concur with the contention by some reviewers (Ars Technica and others) that the feedback is high-quality; it felt spongy to me, so that was right out despite some other merits. Newest Macbook Pro's keyboard is severely disappointing, the stand-out worst of the bunch (although I sort of liked the previous generations) because the keys are so flat and the travel so small. It's almost as bad a membrane keyboard. You really feel like you're just slamming your fingers against a solid surface. Not good.

I don't want to keep harping about Macbook Pro, because it was not on my buying list- but I include it because I can respect it as a fine, well-built machine. I don't like macOS and I don't like Apple's proprietize-everything ways. But even if you were to take those drawbacks away, I would prefer the feel of my Dell, which is something I never thought I'd say.

Battery life on the XPS is close to leading, if not leading. I can't verify an exact number, but I'm impressed with how it handles running all day. I can run it all day long and it still has a decent charge. The thing also charges with USB-C. So if you have a phone that charges with USB-C anyway, you could pack exactly one cable in your bag and charge both devices. Joy of joys!

The minor irritations

This may come just as an indictment of Windows 10 in general, but it's full of fluff. I had to remove Minecraft and Candy Crush and a few other games- since when were these built in to the OS? There are ads on the lock screen, ads in the start menu. All stupid, all easy to remove. I'm running Windows 10 Pro, by the way.

My first task was to use the Chrome Installer Finder (also known as Microsoft Edge) to get a browser on my PC. There are some slight improvements that Edge makes over the previous generation of Chrome Installer Finder (aka Microsoft Internet Explorer) but it's still pretty lame to use- thankfully you're only going to use it once before you get Chrome, and then the problem is academic.

Some annoyances I know are Dell-specific. I had McAfee pre-installed, and the second thing I did was remove it. Had to listen to it crying crocodile tears in big red letters that my system would burn to the ground without its protective aegis.


Ugh, wifi!

This is the meaty, juicy issue on this laptop. It's a shortlist of one. One gruesome issue out of the box is not a deal breaker weighed against the other virtues of this machine, and I am prepared to remain pleased if I can just overcome it.

https://www.reddit.com/r/Dell/comments/5hkiur/new_dell_xps_13_with_horrendous_wifi_connectivity/

The issues with the 9350 and 9360 are apparently well-documented by others, but the actual issues people mention are all over the place. It drops wifi connections, it doesn't connect to anything, it doesn't maintain the connection for more than 2 minutes, it has slow connectivity, or it doesn't even show networks. I didn't have any of those problems specifically, but bad driver/hardware could be the root cause of all of them and some.

My specific problem is two-fold:
  • I can connect to open wifi networks, but it doesn't resume the connection after waking from sleep, and it sometimes drops randomly even though the signal is unchanged in strength.
  • I cannot authenticate onto any encrypted wifi network. I know I get passwords wrong 50-70% of the time, but eventually I will enter it right. Never any joy here.
My progress:

  1. First attempt was letting the PC OEM (Dell) come to the rescue in the least intrusive way possible. Fuck phone calls, I want to see if you have some automated tool to help. And, actually, they do- a tool  called Dell System Detect that analyzes your PC for irregularities for drivers, diagnostics, &c and reports back on its findings. Seems to be fairly clever and quite comprehensive- if it actually provides meaningful feedback. Alas, it said everything was hunky dory, and that was not what I wanted to hear.
  2. Second attempt (I really hate calling tech support) was to see if manual driver updates will help. They handily make the driver installer available for your Killer 1535 wifi card, but after going through the hopeful process of installing and restarting the laptop (super fast restart, thanks PCIe SSD!) it made no apparent difference.
  3. Third attempt will be to finally call Dell and see if they can fix it, or failing that, send me a new wifi card. 


The call (2 hours of it)


Tech support guy was really nice, and it must be said, patient as hell. I have no beef with the technical aptitude of him or his supervisor- more of their wishful thinking that it was a simple configuration issue that I had overlooked.

Ultimately he took over my PC remotely and went to the driver download page and installed every single driver update offered, which I thought to be a bit overkill (what does the virtual buttons driver and serial IO driver have to do with wifi per se?) but hey, he has a process to complete. Ditto the annoyingly long list of diagnostic tools he downloaded onto my system- I'm just trusting that this is all protocol. Curiously, one of them was self-deleting after a few days. It prompted me to say that the session had expired and called an uninstaller for itself, which is something I haven't seen before.

After he ran all that and all the settings and drivers looked fine and up to date, I demonstrated again that logging in to a secured network was still impossible. He talked to a sup, I guess, and decided to go into Device Manager and tweak the preferred frequency to 5GHz when it was formerly no preference. That didn't work, so he tried 2.4 GHz. At this point I'm just drumming my fingers.

We still had the issue of not being able to connect to my office router (and, I promised him, my home router as well). So he tested with me setting up a wifi hotspot on my Nexus phone with a simple password. I actually was able to connect to it- but with the caveat that I connected to it about 6 inches from the device. However, to my chagrin, it was considered by him enough rope to hang my argument that accessing an encrypted wifi network was systematically impossible.

The tech was polite, and so was his manager, but I insisted that the problem was not solved and I needed some more effective remedy. Citing the reports of others with wifi issues, I asked for a replacement card and offered sufficient understanding that I would have the aptitude to open and install the new card. Moreover, they offered that although they could not guarantee a warranty for issues caused by my own labor, the warranty would resume if the machine functioned with apparently no degradation after the replacement. Satsified with this, I accepted their offer of a new card. Unfortunately, they said that they'd be sending me another Killer 1535. Seriously, does Dell just have a warehouse full of these things? I really, really wanted to control for that factor!

So, basically, I'm predicting the outcome breaks down like this.

  • 40% chance that replacing the card changes nothing because this is just not a good wifi card, whether due to hardware or driver issues, on this particular model.
  • 30% chance that it has another, different problem and is still just as useless to me.
  • 20% chance that something about the production process, possibly antenna placement, possibly the antenna itself, is wrong, and that by manual adjustment or other replacement parts I can fix it.
  • 10% chance that I actually have a dud wifi card and replacing it with no other alterations fully fixes the problem.


When it comes in the mail, I will install it with fastidious care. If the new card fixes the issue, I will attempt to the best of my abilities to provide a post-mortem analysis.

The final option, barring the failure of this, will be to buy something which others say is better supported with drivers on this particular device. A lot of people with XPS 9350s have found this Intel 7265 very suitable for Linux, and a handful have said it plays better with Windows than the OEM one too: https://www.amazon.com/Intel-Generation-Wireless-Computer-Notebook/dp/B00RCZ4I6S?tag=wpcentralb-20&ascsubtag=UUwpUdUnU41865

There may be other cards which would work equally well or better. If I get to this stage, I will research more and select the one I think is best.


To Dell

If you're seeing all the words I'm writing, understand that my criticism is meant to be constructive. If I didn't think you had a damn fine piece of hardware, I would not be wasting time with this and I would have returned it already.

I want you to improve this product on this issue so that I can actually recommend it to people. I will happily do so if I can isolate the problem and see you take measures to fix it.